If we assume it takes on average one minute for a user to read a
single http file, then the server will get a request (small packet)
every 6 milliseconds (10 000 connections). A 70 byte message takes 149
microseconds to read (Pentium 100). That message gets put on a
userland queue for later processing. The server reads all http
requests and places them on a queue. When it has scanned all fds for
activity, it then does non-blocking reads to attempt to service each
request in the queue. It takes 76 microseconds to read a 1024 bytes
from the cache and write them out. Note that there are not going to be
10 000 requests in the queue. It's more like 10 to 100. Most people
are still reading their page.
So, if the requested page is in the cache, it takes 146 microseconds
to process, ignoring the time spent in poll(2) and scanning the pollfd
list to see which descriptors are active. The latter takes 2.3
milliseconds. This is obviously time wasted, since the kernel has
already had to scan this list.
There is another problem in that poll(2) on 10 000 descriptors takes
48 milliseconds for a timeout of 0 (or 29 milliseconds with the patch
I sent last night). But I have some ideas on that too...
Regards,
Richard....