Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
4.  TCP/IP Tunable Parameters TCP Tunable Parameters tcp_ecn_permitted  Previous   Contents   Next 
   
 

tcp_conn_req_max_q

Description

The default maximum number of pending TCP connections for a TCP listener waiting to be accepted by accept(3SOCKET). See also "tcp_conn_req_max_q0".

Default

128

Range

1 to 4,294,967,296

Dynamic?

Yes

When to Change

For applications such as web servers that might receive several connection requests, the default value might be increased to match the incoming rate.

Do not increase the parameter to a very large value. The pending TCP connections can consume excessive memory. And if an application is not fast enough to handle that many connection requests in a timely fashion because the number of pending TCP connections is too large, new incoming requests might be denied.

Note that increasing tcp_conn_req_max_q does not mean that applications can have that many pending TCP connections. Applications can use listen(3SOCKET) to change the maximum number of pending TCP connections for each socket. This parameter is the maximum an application can use listen() to set the number to. This means that even if this parameter is set to a very large value, the actual maximum number for a socket might be much less than tcp_conn_req_max_q, depending on the value used in listen().

Commitment Level

Unstable

tcp_conn_req_max_q0

Description

The default maximum number of incomplete (three-way handshake not yet finished) pending TCP connections for a TCP listener.

For more information on TCP three-way handshake, refer to RFC 793. See also "tcp_conn_req_max_q".

Default

1024

Range

0 to 4,294,967,296

Dynamic?

Yes

When to Change

For applications, such as web servers that might receive excessive connection requests, you can increase the default value to match the incoming rate.

The following explains the relationship between tcp_conn_req_max_q0 and the maximum number of pending connections for each socket.

When a connection request is received, TCP first checks if the number of pending TCP connections (three-way handshake is done) waiting to be accepted exceeds the maximum (N) for the listener. If the connections are excessive, the request is denied. If the number of connections is allowable, then TCP checks if the number of incomplete pending TCP connections exceeds the sum of N and tcp_conn_req_max_q0. If it does not, the request is accepted. Otherwise, the oldest incomplete pending TCP request is dropped.

Commitment Level

Unstable

Changes From Previous Release

For information, see "tcp_conn_req_max_q0".

tcp_conn_req_min

Description

The default minimum value of the maximum number of pending TCP connection requests for a listener waiting to be accepted. This is the lowest maximum value of listen(3SOCKET) an application can use.

Default

1

Range

1 to 1024

Dynamic?

Yes

When to Change

This can be a solution for applications that use listen(3SOCKET) to set the maximum number of pending TCP connections to a value too low. Increase the value to match the incoming connection request rate.

Commitment Level

Unstable

TCP Parameters Set in the /etc/system File

These parameters can be set only in the /etc/system file. After the file is modified, reboot the system.

The following entry sets tcp_conn_hash_size:

set tcp:tcp_conn_hash_size=1024

tcp_conn_hash_size

Description

Controls the hash table size in the TCP module for all TCP connections.

Data Type

Signed integer

Default

512

Range

512 to 1,073,741,824

Implicit

The value should be a power of 2.

Dynamic?

No. The parameter can only be changed at boot time.

Validation

If you set the parameter to a value that is not a power of 2, it is rounded up to the nearest power of 2.

When to Change

If the system consistently has tens of thousands of TCP connections, increase the value accordingly. With the default value, TCP performs well up to a few thousand active connections. Note that increasing the hash table size means more memory consumption so set an appropriate value to avoid wasting memory unnecessarily.

Commitment Level

Unstable

ipc_tcp_conn_hash_size

Description

Controls the hash table size in an IP module for all active (in ESTABLISHED state) TCP connections.

Data Type

Unsigned integer

Default

512

Range

512 to 2,147,483,648

Implicit

It should be a power of two.

Dynamic?

No. This parameter can only be changed at boot time.

Validation

If you set the parameter to a value that is not a power of 2, it is rounded up to the nearest power of two.

When to Change

If the system consistently has tens of thousands of active TCP connections, increase the value accordingly. With the default value, the system performs well up to a few thousand active connections. Note that increasing the hash table size means more memory consumption so set an appropriate value to avoid wasting memory unnecessarily.

Commitment Level

Unstable

TCP Parameters With Additional Cautions

Changing the following parameters is not recommended unless there are extenuating circumstances that are described with each parameter.

tcp_ip_abort_interval

Description

The default total retransmission timeout value for a TCP connection in milliseconds. For a given TCP connection, if TCP has been retransmitting for tcp_ip_abort_interval period of time and it has not received any acknowledgment from the other endpoint during this period, TCP closes this connection.

For TCP retransmission timeout (RTO) calculation, refer to RFC 1122, 4.2.3. See also "tcp_rexmit_interval_max".

Default

8 minutes

Range

500 millisecond to 1193 hours

Dynamic?

Yes

When to Change

Do not change this value. See "tcp_rexmit_interval_max" for exceptions.

Commitment Level

Unstable

 
 
 
  Previous   Contents   Next