Re: Awfully slow /proc/net/tcp, netstat, in.identd in 2.4 (updated)

Simon Kirby (sim@netnation.com)
Fri, 19 Oct 2001 08:59:44 -0700


On Fri, Oct 19, 2001 at 02:57:50PM +0200, Andi Kleen wrote:

> On Thu, Oct 18, 2001 at 09:42:22AM -0700, Simon Kirby wrote:
> > There is definitely something really broken here. One of our web servers
> > that was having the problem before has now decided to hit a load average
> > of 50 because identd is taking so long to parse /proc/net/tcp and give
> > back ident information.
>
> See my last mail. The hash tables are too big. Set a smaller one
> during this patch by using the new tcpehashorder= command line option.
> It sets the hash table size as 2^order*4096 on i386. You can see the
> default order by looking at the dmesg of an machine booted without
> this option set.
> You can find out how much it costs you by looking at
> /proc/net/sockstat. If the tcp_ehash_buckets value is the same as
> with the default hash tab size then it didn't cost you anything.
> If the value is very similar it's probably still ok; just if you
> get e.g. average bucket length >5-10 it's probably too small.
> The smaller the hash table the faster should identd work.

Hmm, yeah, on this box with 640 MB I see:

TCP: Hash tables configured (established 262144 bind 65536)

(I'm guessing this means that the hash table has 32k buckets.)

Yes, that's fairly large, but not that huge for machines which will have
tons of sockets open.

Normally we use nothing like that:

sockets: used 133
TCP: inuse 118 orphan 3 tw 171 alloc 119 mem 132
RAW: inuse 0
FRAG: inuse 0 memory 0

...but shrinking the size slightly won't really fix the problem, it will
just make it less obvious.

Direct lookups for identd, service probes, etc., are definitely the
better way to go, but it would be nice if netstat didn't suck as well.

Simon-

[ Stormix Technologies Inc. ][ NetNation Communications Inc. ]
[ sim@stormix.com ][ sim@netnation.com ]
[ Opinions expressed are not necessarily those of my employers. ]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/