Advertisment

How do you manage HTTP server apps?

author-image
CIOL Bureau
Updated On
New Update

Mukesh Bansal

Advertisment

UNIX can handle only a limited number of outstanding TCP connection requests., which reside in a UNIX queue called the backlog. The queue also has a limited capacity.

Default sizes of the backlog queue differ between UNIX flavours and implementations. For example, BSD flavours of UNIX define the size of the backlog queue through the SOMAXCONN constant. The queue size is computed as:

 



Backlog queue size (SOMAXCONN * 3) /2 + 1

Advertisment

By default, the SOMAXCONN constant is set to value, 5, thus allowing a maximum of 8 outstanding TCP connections to be held on the backlog queue. For busy web servers, system admins should look to increase the backlog size from the default values. Failure to do so can effectively limit the overall availability of their web servers with the Internet.

The Http server software actively closes each TCP connection when the file transfer has completed. This is done by sending the client a TCP packet with the FIN flag set. TCP protocol allows either the client or server to perform the active close on a \ny connection. However, the end that performs this operation must place the connection in a state known as TIME-WAIT to ensure that any straggler packets are properly handled. During the TIME-WAIT duration, the connection information inside the TCB must be saved.

UNIX servers allocate upto 1024 (approx) TCBs. The nestat program can be used to determine the number of outstanding TCBs currently in TIME-WAIT state.

tech-news