Web server considerations
Even though the Web server is a very mature technology, it can still be tuned to get better performance, especially on large Web sites. This section covers the common performance considerations for all the Web servers, and is platform independent.
Listeners for threads or processes
If the Web server only receives dynamic requests for the Application server, the number of HTTP listeners needs to be only slightly more than the number of threads being defined in the Application Server. In WebSphere Commerce, where static content (that is, image files such as GIF and JPG format) are being served by the Web server instead of the file serving servlet, more listeners need to be configured in order to achieve optimal performance.
Image distribution
Static images are stored on the Web server and served from the Web server as associated pages are accessed. For implementations that have a large number of images, distributing these images over multiple directories is recommended, to reduce operating system scan time, as the Web server serves the images. Based on our experience, no more than 50,000 images should be placed in one image directory.
Log
Web servers allow different levels of logging for different sets of information. Even though this logging is very useful to diagnose problems, it has significant performance impact on high volume Web sites.
To ensure better performance, keep the logging format simple and limit it to reporting server errors.
Keep-alive
In the HTTP protocol, each request creates a new socket connection to the server and sends a request. When the server responds, it creates another socket connect to respond to the client. This concept is very simple to understand, but very slow from the performance perspective. It would be ideal if the same connection could be used for both the request and the response. This is where the keep-alive function is used, to allow the server to manage long connections. The maximum requests that a browser can make on one long connection and the maximum time the connection may stay active are both configurable parameters.
Keep-alive is on, by default, for most of the Web servers. The settings for parameters related to keep-alive depend on the Web site traffic characteristics. The maximum number of keep-alive connections and keep-alive timeout values need to be tuned in such a way that the trade-off between performance (avoiding creation of socket connections) and resources (the keep-alive connection cannot be reused for another connection until timeout) is balanced.