HP-UX TCP/IP Performance White Paper, March 2008

22
has been changed to 0. A value of 0 (default) will auto-tune the tcphashsz in proportion to the number of
cores in the system during the system bootup. The minimum value is 0, and the maximum is 65536. If this
tunable is set in the range of 1 to 255, then it will be increased to 256. It is recommended that the value of
tcphashsz be set to 0 so that the system can choose an optimal tcphashsz value.
4.2.4 Tuning the listen queue limit
The listen queue limit can affect Web server performance. The following sections discuss the listen queue
and the listen backlog.
4.2.4.1 The Listen Queue
An important concern for Web servers is to ensure that the server is able to handle the load placed on it by
clients. The rate at which clients connect to servers can vary considerably. Under low loads the server will
be able to service the incoming connection requests without any delay. However, as the incoming
connection load increases, the Web server will not be able to handle the connections as quickly as they
arrive. This is a very common scenario for any type of server. A “buffer” to store the incoming connection
requests is provided so as to not drop any incoming connection request that cannot be processed
immediately by the server.
This "buffer" is normally referred to as the "listen queue". When the server establishes the listening TCP
endpoint, it specifies an upper limit for the number of established connections that will be allowed to wait in
the listen queue. This limit is variously known by terms such as "listen backlog", "listen backlog limit",
"backlog", "listen queue limit".
Client connection attempts in excess of this limit will be ignored. Clients will typically retry for a while, and
then give up, often reporting the failed attempt as a "connection timeout". Note that client connection
attempts which do not time out only get into the listen queue. They may still wait for a long time to receive
service from the application.
4.2.4.2 The Listen Backlog and Web Server Performance
Choosing a good backlog value is a matter of balancing web server behavior and system performance
against the expected client load and the consequences of clients being unable to connect. For commercial
Web sites, such as web-based retail businesses or Web sites that rely on advertising revenue, clients unable
to connect often represent lost business. For Web sites providing services, inability to connect can be seen
as poor service. In such examples it is highly desirable to avoid having clients which are unable to
connect.
The listen backlog is only one of a number of factors that affects the system's ability to service client
requests. Generally, more significant factors will be things such as Web server configuration, the type of
services being accessed by clients (e.g. static versus dynamic content, encrypted versus unencrypted
connections, etc.), and simply the system's raw computing and I/O capacity.
Tools such as glance(1), top(1) and sar(1M) on HP-UX 11i may be used to determine whether the
system is operating at its physical capacity. If you determine that the system is not operating at capacity,
and yet clients are being turned away, it is reasonable to consider whether you need to increase the listen
queue limit.