SMS Speed

SMS Speed SearchSearch
Author Message
gensupport
New member
Username: Gensupport

Post Number: 1
Registered: 12-2017
Posted on Thursday, December 28, 2017 - 03:29 pm:   

Hi,

I've installed NowSMS Gateway trial version and did testing using 4 modems.
Below are result of the testing.

I send sms to NowSMS API and it takes 2-3 seconds to get the response no matter where we test
from :-
- localhost (PC that install NowSMS Gateway)
- same network different PC
- different network

Average speed to NowSMS API when we open:-
1 thread - 28 sms
2 threads - 45 sms
3 threads - 65 sms
4 threads - 86 sms
5 threads - 106 sms

May I know, it's testing result above speed is normal? or need license to get good speed?
If not normal, how to increase the throughput?
PC low spec will cause the speed of sending become slow?If yes please recommend the minimum specification to install this NowSMS Gateway.
Are you recommended deploy on Windows 10?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5892
Registered: 08-2008
Posted on Thursday, December 28, 2017 - 09:33 pm:   

Hi,

I understand you also spoke about this with my colleague Keith, and your speed issue of concern is the speed at which you can submit messages to NowSMS.

When you say API, what exactly are you doing?

2-3 seconds to respond is certainly excessive. But I don’t know what tools or API you are using, so there is no advice that I can offer.

The best way to get me to understand is if you enable the SMSDEBUG.LOG and run your test submissions single threaded. Then let me see that log.


Des
NowSMS Support
gensupport
New member
Username: Gensupport

Post Number: 2
Registered: 12-2017
Posted on Friday, December 29, 2017 - 03:58 am:   

Hi,

It waits 2-3 seconds to receive response when we submit SMS to http://localhost:8800
We get the sending script from https://www.nowsms.com/download/sendsms-php.txt

Tested 150 sms in one time.
for ($i=0; $i<150; $i++)
{
$x = SendSMS($nowsmsHostUrl, $nowsmsUsername, $nowsmsPassword, $phoneNo, 'Test Message today'.date("Y-m-d H:i:s"));
print "RESULT ".date("Y-m-d H:i:s").json_encode($x)."\n\n\n";
}

Below is sample of SMSDEBUG.LOG run with single thread.

10:52:47:040 [1] ThreadListenForConnections: Before accept
10:52:47:040 [1] ThreadListenForConnections: After accept
10:52:47:043 [22] ThreadProcessConnection: Processing connection from xxxxxx...
10:52:48:065 [22] ProcessRead: End of socket
10:52:48:065 [22] WaitForSocketClose: WinSock reported ioctlsocket complete
10:52:48:065 [22] ThreadProcessConnection: Request processing complete
10:52:48:144 [1] ThreadListenForConnections: Before accept
10:52:48:144 [1] ThreadListenForConnections: After accept
10:52:48:147 [22] ThreadProcessConnection: Processing connection from xxxxxx...
10:52:49:087 [22] ThreadProcessConnection: Updating cached user info
10:52:49:087 [22] ThreadProcessConnection: Processing request /
10:52:49:087 [22] name: Phone
10:52:49:087 [22] name: Text
10:52:49:087 [22] ParseMultipart: POST / HTTP/1.1
Authorization: Basic Z2Vuc3VwcDpiZXJzaWg0Mjg=
Host: xxxxx
Accept: */*
Content-Length: 282
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------cf61fd0eb756

Phone=0112345678&Text=Test%20Message%20today2017-12-29%2010%3A52%3A47&
10:52:49:088 [22] Debug: 1 recipient entries
10:52:49:088 [22] ThreadProcessConnection: POST / HTTP/1.1
Authorization: Basic Z2Vuc3VwcDpiZXJzaWg0Mjg=
Host: xxxxx
Accept: */*
Content-Length: 282
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------cf61fd0eb756

Phone=601123418091&Text=Test%20Message%20today2017-12-29%2010%3A52%3A47&
10:52:49:088 [22] CheckBlackList: 0112345678
10:52:49:090 [22] VerifySudirsExist: C:\PROGRA~2\NowSMS\Q\gensupp
10:52:49:091 [22] VerifySudirsExist: Created directory
10:52:49:093 [22] CheckPreferredRouteMulti: Default Route Available
10:52:49:093 [22] CheckPreferredRouteMulti: NowSMSModem - samsungNote5
10:52:49:093 [22] CheckPreferredRouteMulti: Default Route Available
10:52:49:093 [22] CheckPreferredRouteMulti: NowSMSModem - asus
10:52:49:093 [22] CheckPreferredRouteMulti: Default Route Available
10:52:49:093 [22] CheckPreferredRouteMulti: NowSMSModem - asus
10:52:49:093 [22] MessageRoutesAdd: gensupp\5A322BB4.REQ
10:52:49:093 [22] MessageRoutesAdd: NowSMSModem - samsungNote5 NowSMSModem - asus NowSMSModem - asus
10:52:49:094 [20] Debug: Signaled
10:52:49:094 [19] Debug: Signaled
10:52:49:094 [21] Debug: Signaled
10:52:49:100 [19] ThreadProcessModem: Processing 5A322BB4.REQ...
10:52:49:118 [22] ProcessRead: End of socket
10:52:49:119 [22] WaitForSocketClose: WinSock reported ioctlsocket complete
10:52:49:119 [22] ThreadProcessConnection: Request processing complete
10:52:49:124 [19] InetServerConnect: Connected to nowsmsmodem_samsungNote5 (1.1.1.1:80)
10:52:49:125 [19] ThreadProcessModem: POST / HTTP/1.1
Content-Type: application/x-nowsms-outboundmessage-sms
Host: nowsmsmodem_samsungNote5
User-Agent: Now SMS/MMS Gateway v2017.04.07
X-NowSMS-ReceiveSMS: Yes
X-NowSMS-ReceiveSMSPort: 8990
X-NowSMS-ReceiveMMS: Yes
Accept: */*
Content-Length: 116
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 8235
Registered: 10-2002
Posted on Friday, December 29, 2017 - 02:23 pm:   

Interesting...

I run the same script and it takes 1 second to submit all 150 messages.

Here's an excerpt of my debug:

08:19:49:469 [39] ThreadProcessConnection: Processing connection from x.x.x.x...
08:19:49:469 [39] ProcessRequest: /
08:19:49:469 [39] ThreadProcessConnection: Processing request /
08:19:49:469 [39] Debug: 1 recipient entries
08:19:49:469 [39] ThreadProcessConnection: POST / HTTP/1.1
Authorization: Basic xxxxxxxx
Host: xxxx.smshosts.com
Accept: */*
Content-Length: 67
Content-Type: application/x-www-form-urlencoded

Phone=%2Bxxxxxxxxxxx&Text=Test+Message+today2017-12-29+07%3A19%3A47

I'm trying to understand why yours is different...as I can clearly see 2 unexpected 1 second delays in your log. I also see that the POST from your PHP script uses a different MIME type and includes an extra header (Expect:). And there appears to be an extra empty HTTP request before the actual message submission.

I'm guessing this all has something to do with how PHP is configured...and more specifically CURL, which is used to make the HTTP request.

We just updated this script a few months ago to use CURL, so I'm guessing there are version differences that we are not aware of.

Try changing:

curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);

to:

curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

I'm guessing the above change will remove the extra connection that you are seeing, which I'm guessing is PHP trying to determine which auth methods are supported.

And add:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

NowSMS does not understand the Expect header, which is introducing a 1 second delay (times 2 because of the extra connection).

-bn

Bryce Norwood
Now SMS/MMS Support
gensupport
New member
Username: Gensupport

Post Number: 4
Registered: 12-2017
Posted on Thursday, January 04, 2018 - 04:13 am:   

Hi,

Its working, thanks a lot.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 8239
Registered: 10-2002
Posted on Thursday, January 04, 2018 - 06:29 pm:   

Hi,

Thanks for that confirmation. I have updated the scripts on our web site with these changes.

-bn

Bryce Norwood
Now SMS/MMS Support