Operating System - HP-UX
1834394 Members
1706 Online
110066 Solutions
New Discussion

Re: Problem with Socket.open( ) at 105 req/sec.

 
Meenakshi Sundaram
Occasional Contributor

Problem with Socket.open( ) at 105 req/sec.

Hi,
Am doing a test in which I try to retrieve content from my web server (iplanet 4.1) at the request rate of 105 req/sec. And I have nearly 50 threads for doing this operation.
At times I see that the Socket.open() takes a very large time (more than 20 secs!!!).
Any pointers as to why this should happen ?

Regards,
M Meenakshi Sundaram
2 REPLIES 2
rick jones
Honored Contributor

Re: Problem with Socket.open( ) at 105 req/sec.

when a TCP connection is properly closed, one side is required to remain in TIME_WAIT state for a period of time. under HP-UX that is 60 seconds and for production, I would probably not make it any lower.

a TCP connection is "named" by the four-tuple of local/remote IP address and local/remote port number.

there can be delays if an attempt is made to establish a new connection while an old connection by the same name is in TIME_WAIT.

depending on the rev of UX you are running, the default anonymous port number range is either 5000 ports or 16384 ports.

105 connections per second, with a TIME_WAIT of 60 seconds would be inthe range of 6000 simultaneous TIME_WAITs, so I'm guessing that you are running from a 10.20 system.

the truely proper thing to do is to have the app specify port numbers itself via the bind() call. that is what SPECweb96 and SPECweb99 code does. that gives you upwards of 60K port numbers per IP address, which means you could do 1000 connections per second per IP pair before possibley running into TIME_WAIT reuse.

I believe that Java may not expose that to the application writer :(

That means you have to tweak the anonymous port range. under 10.20 that would be via nettune and tcp_high_port_enable (iirc). under 11, that would be ndd and tcp_smallest_anon_port.

i would _NOT_ suggest forcing abortive closes of the TCP connection, nor woudl I suggest shortening the TIME_WAIT state.
there is no rest for the wicked yet the virtuous have no pillows
art morlock
Advisor

Re: Problem with Socket.open( ) at 105 req/sec.

Rick wrote:
"a TCP connection is "named" by the four-tuple of local/remote IP address and local/remote port number. there can be delays if an attempt is made to establish a new connection while an old connection by the same name is in TIME_WAIT.
I believe that Java may not expose that to the application writer :( "

So if we have an application that is directed to a fixed IP address and port number, what can we do to handle high volumes?

Thanks,
Art