Re: web server (and TCP) performance tuning?

From: Lucius Chang (luciuschang@hotmail.com)
Date: Mon Jun 12 2000 - 23:23:41 EST


Thanks to Chris, Alan, and Dan for the replies.

I spent the day implementing a poll()-based version of
the server and making sure it was correct. To be efficient,
only the file descriptors that are in use are in the
pollfd array. However, this isn't a great savings for
me, since about 80% of the descriptors turn out to be
"active" in this server. I tested it using 4000 descriptors.

This new implementation using poll() seemed to actually
have higher overhead than the select()-based version. On
some level, this makes sense - select uses 2 bits per
descriptor for the read/write sets, and since they're
in/out parameters, that's 4 bits each. Poll uses one int
plus two shorts, for a total of 64 bits per descriptor.

If we assume 4000 descriptors in the select version and
3200 in the poll version, that comes out to 2KB per call
versus 25.6KB/call.

Even so, that wouldn't explain the performance I'm getting
with either version. Are there any tunable parameters
relating to the networking code? Hash table sizes,
enabling/disabling delayed acks, etc? The same program on
a different operating system gets about 50% higher performance.
I'm sure I'm overlooking something small. Any suggestions
would be appreciated.

Thanks again,
Lucius Chang

>From: Chris Wedgwood <cw@f00f.org>
>To: Lucius Chang <luciuschang@hotmail.com>
>CC: linux-kernel@vger.rutgers.edu
>Subject: Re: web server (and TCP) performance tuning?
>Date: Mon, 12 Jun 2000 20:15:38 +1200
>
>On Mon, Jun 12, 2000 at 12:52:05AM -0400, Lucius Chang wrote:
>
> Basically, I need to deal with thousands of file
> descriptors, thousands of TCP connections, etc.
>
>If it really is thousands, use poll not select.
>
> I've compiled a kernel with modified values for
> FD_SETSIZE, NR_OPEN, OPEN_MAX, INR_OPEN, and NR_FILE.
>
>You don't need to mess with these for 2.2.x and above, these are all
>dynamic (except FD_SETSIZE, but that doesn't matter since you don't
>want select anyhow).
>
> Does anyone know of a document explaining what network
> characteristics need to be changed and how to do it?
>
>It should just work -- squid works with many file-descriptors for
>example.
>
>I wrote a detection system once that used about 80,000 FDs for lack
>of anything better to do...
>
>
>
> --cw
>
>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:27 EST