TCP Tuning
Optimizing HTTP Server Performance 4-7
Specifying Retention time for Connection Table entriesThe TCP connection table maintains data associated with connections. The server
maintains a TCP connection table entry for some time after a connection is closed,
so that it can identify and properly dispose of any leftover incoming packets from
the client.
Access speed to this table impacts performance; the access speed depends on the
number of entries in the table, and on its hash size. The number of entries in the
table depends on the rate of incoming requests, and the lifetime of each connection.
You can control the length of time that TCP connection table entries are maintained
with the tcp_close_wait_interval parameter (renamed
tcp_time_wait_interval on Solaris 2.7). This parameter is commonly set to
60,000 ms. Use the following command to set it (note the difference in parameter
name for Solaris 2.6 and 2.7).
On Solaris 2.6:
prompt>/usr/sbin/ndd -set /dev/tcp tcp_close_wait_interva l 60000
On Solaris 2.7, and HP-UX:
prompt>/usr/sbin/ndd -set /dev/tcp tcp_time_wait _interval 60000
Increasing the Handshake Queue LengthDuring the TCP connection handshake, the server, after receiving a request (SYN)
from a client, sends a reply, and waits to hear back from the client. The client
responds to the server’s message and the handshake is complete. Upon receiving
the first request from the client, the server makes an entry in the listen queue. After
the client responds to the server’s message, it is moved to the queue for messages
with completed handshakes. The second queue makes it possible for the server to
continue servicing requests for which the handshake has been completed.
On Intel Solaris, the maximum length of the queue for incomplete handshakes is
governed by tcp_conn_req_max_q0, which by default is 1024. The maximum
length of the queue for requests with completed handshakes is defined by
tcp_conn_req_max_q (default is 128).
Note: If your user population is widely dispersed (with respect to
Internet topology), you may want to set this parameter to a higher
value. You can improve access time to the TCP connection table
with the tcp_conn_hash_size parameter.