I have received questions from customers about load testing reports that show their server doing some unexpected things. For example, a customer sent some server monitor that showed a pattern of large peaks of CPU utilization followed by a precipitous drop to a low level of usage. He wanted to know why LoadStorm wasn’t applying a consistent load to his system as evidenced by the CPU spikes.
First, it is important to think about the big picture of what is going on. He had not told me if this CPU was one of many in a round robin configuration or if this was even on a web server at all. He was obviously ignoring other measurements of traffic on the server – most notably the web server logs. Wouldn’t it be a better indicator of the LoadStorm’s load to see the timestamps and volume of requests in the IIS (he is on MS stack) server logs?
There are thousands, if not millions, of configuration permutations possible with any web application. One configuration setting that could cause a roller coaster affect in CPU utilization is the limit of connections allowed from clients. While there are many considerations that could influence your decision for how many simultaneous connections you want as max, generally speaking, you want to give the web server as many as will be supported effectively by your CPU and RAM. This is especially true if the machine is dedicated to be a web server only.
Apache has different ways to control the maximum number of simultaneous client connections, such as the MaxClients directive for the whole server, and other ways to fine tune processes and threads. IIS provides a way to set the max connections for each specific Web site.
On Microsoft’s support site, there is a help topic that provides good information to Set Client Connection Limits.
To set the maximum number of client connections:
- Log on to the Web server computer as an administrator.
- Click Start, point to Settings, and then click Control Panel.
- Double-click Administrative Tools, and then double-click Internet Services Manager.
- Right-click the Web site that you want to configure, and then click Properties.
- Click the Web site tab.
- If you want to support an unlimited number of connections, click Unlimited.
- To set a specific number of connections, click Limited To, and then type the number of connections that you want the server to support (the default setting is 1000).
- Click OK.
Steven Warren suggests in his blog that you tweak the registry to improve IIS’ performance relative to connections.
The registry settings for IIS are stored in HKEY_LOCAL_MACHINE | SYSTEM | CURRENTCONTROLSET | SERVICES | INETINFO | PARAMETERS. You can work with Listenbacklog – This registry setting specifies how many active connections IIS has in its queue. The default value is 15. It can range all the way up to 250.
I recommend doing some research on your own system to see how many client connections you allow. Then figure out (experimentation may be necessary) how many connections you can effectively service on your machine. You don’t want to overload the machine, but you don’t want to waste horsepower while restricting users.
This is just one more performance engineering aspect to tune your web application. I suggest you invest a few hours to make sure you have it optimized for your environment. Test, tune, test, tune, test, tune….rinse and repeat.