Re: possible problem with gettimeofday

From: Duane Wessels <wessels@dont-contact.us>
Date: Tue, 22 Apr 97 07:58:37 -0700

oskar@is.co.za writes:

>Hi
>
>I have been trying to get our be server to fall over by opening hundreds of
>connections to it... (I have been having problems with linux's limit
>on filehandles). I found a "hackerz" program that opens any amount of
>connections to a server (I know, very simple code)...
>All it does is open them, never actually sends or requests any data.
>
>I midified it a little and every time squid fell over. I then tried
>on a FreeBSD machine, and it didn't fall over, but the load
>on the machine went crazy - a ktrace showed that it was doing thousands
>of "gettimeofday" calls....
>
>Normal?
>
>>From the first guess, it seems that squid walks through all of the
>filehandles calling gettimeofday for each of them...
>
>squid 1.1.9 with patches, FreeBSD 2.2.something
>
>I don't have time to look at it, I am afraid, and our caches aren't so
>loaded that it causes major problems.

Whats happening is this:

comm_select_incoming() gets called in comm_select() after every FD
with I/O pending. The reason is to keep the ICP requests flowing
quickly and to prevent the HTTP socket listen queue from getting
too backed up. gettimeofday() is called in comm_select_incoming();
the only reason for that would be to get more accurate timestamps
and delays in the log file.

Probably we need to be smarter about how often comm_select_incoming()
gets called. It should be possible to measure the rate of ICP
and HTTP connections compared to the number of active FD's and, only
all comm_select_incoming(), say every 5 FD's.

Duane W.
Received on Tue Jul 29 2003 - 13:15:41 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:16 MST