A customer reported an Iguana message error condition in the following test scenario: 17 channels and 2,500 messages queued per channel (42,500 messages in total). The channel used the ‘net.http’ module to act as a web client, and to communicate with a web server hosting a C# based web service. The customer reported at approximately 16,500 messages, Iguana began to report errors. Netstat output showed a similar number of listings for web service’s IP and port. The one-to-one correlation between messages and sockets meant that the cURL was not reusing the socket connection. After a period of time, an operating-system-imposed limit constrained Iguana, and it reported an error condition.The Iguana Translator’s ‘net.http’ module is an HTTP 1.1 compliant client that uses the cURL library for its implementation. Different combinations of HTTP verbs and headers in HTTP negotiation can have a dramatic effect on effective message throughput. In practice, the Iguana Translator uses a standard cURL library and can reuse socket connections. In fact, in baseline tests, the Translator has demonstrated 1,000+ messages per second per channel.
Two approaches were tested for effects on speed and Iguana service under load. One focused on closing HTTP sockets as quickly as possible, while the other focused on reusing HTTP socket connections.
After the socket client and server processes are both closed, the open sockets linger for an operating system configured time (default is 2 minutes). This is reported by netstat until the operating system cleans them up. The operating system can be configured to clean up the sockets more quickly by lowering the TcpTimedWaitDelay registry entry.
Approach #1 is a quick fix to improve service under load. It updates a registry setting to close idle sockets quicker, which frees up system resources. This quick fix will provide a scalability improvement, but not a complete solution. The issue of Iguana reporting a socket error may be resolved with this setting, or at the very least, the socket resource exhaustion symptom may appear less frequently.
Approach #2This approach is preferred for both speed and improved service under load. Test results show that Iguana cURL libraries support socket reuse. Setting the ‘Connection=Keep-Alive’ header in both the HTTP client request and the HTTP server response is integral for socket reuse. Online documentation for cURL and web servers both suggest that this is the default behaviour. To run high message loads between an Iguana client and a web server it is recommended that HTTP socket connections be reused.