Before I get to the speed/performance issue that I want to highlight, I’ll review some of the basics of 2-way SMS in NowSMS and provide a few starter links for beginners who might have stumbled upon this post.
The 2-way SMS facility of NowSMS is designed to facilitate the processing of inbound, or mobile originated, SMS messages.
When NowSMS receives an SMS message, it will evaluate the content of the message, and can either execute a program, or connect to an HTTP URL (such as a PHP, Perl or ASP script), passing the content of the received message to program or script.
The basics of 2-way SMS are described in the NowSMS manual and at the following link:
A good basic troubleshooting guide for initially setting up 2-way SMS can be found at the following link: http://www.nowsms.com/discus/messages/1/4520.html
The above link also has some simple PHP and ASP examples for processing received SMS messages.
If you are processing more than 10 inbound SMS messages per second, it may be necessary to configure NowSMS to allocate more threads for the 2-way command processing, depending on the speed of your 2-way command script.
NowSMS will receive messages from the SMSC connection as quickly as it can, so that messages do not backup at the service provider.
After receiving the SMS messages from the service provider, NowSMS queues the received messages, and a separate thread within NowSMS evaluates the received messages and processes the 2-way commands, so other gateway activity of sending and receiving messages can continue while the 2-way commands are being processed.
The program thread that processes the 2-way commands processes only one message callback at a time, waiting for current 2-way command to complete before processing the next message.
If your 2-way command script is running on a web server on the same local network, and is reasonably quick in its processing, NowSMS can process approximately 100 messages per second for HTTP-based 2-way commands in ideal situations. However, not all configurations are ideal, and in typical configurations, NowSMS spends more time waiting for the 2-way command to complete than in the actual processing of the message. This waiting for the 2-way command has a significant impact on 2-way command message throughput.
It is possible to configure NowSMS to allocate more 2-way command processing threads to provide higher throughput by editing SMSGW.INI, and under the [SMSGW] section header, adding 2WaySMSThreadCount=## … where ## is the number of threads to allocate.
In future versions of NowSMS, we will be enabling the use of HTTP keep-alive sockets, which our tests have shown can increase single threaded “ideal” throughput to a range of 175 to 200 messages per second processed by a single 2-way command. While that will offer some performance boost, typical configurations are not limited by the speed at which NowSMS processes 2-way commands, but rather by the speed at which actual 2-way command scripts perform their processing logic. For those typical configurations, allocating multiple 2-way command processing threads can offer a performance boost.
For comments and further discussion, please click here to visit the NowSMS Technical Forums (Discussion Board)...