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

David S. Miller (davem@redhat.com)
Fri, 19 Oct 2001 14:56:39 -0700 (PDT)


From: Benjamin LaHaise <bcrl@redhat.com>
Date: Fri, 19 Oct 2001 17:30:55 -0400

On Fri, Oct 19, 2001 at 01:59:24PM -0700, David S. Miller wrote:
> And, for a 640MB ram machine, a 4MB hash table is perfectly
> reasonable.

That isn't wholly true. A 4MB hash table can never fit in the cache of
an Athlon, and for one that's being used as a workstation with 1GB of
ram and maybe 60 connections active on average, that's a huge waste of
ram, and a guarantee that there will be lots of cache misses which just
aren't required. Keep the cache footprint as low as possible -- it
results in a system that performs better.

It doesn't need to "fit in the cache" to perform optimally, that's
a load of crap Ben.

I actually tested this, and in fact on a cpu that has a meager 512K
cache at the time, and it did turn out to be more important to keep
the hash chains short than to keep it fitting in the cache.

So please don't give me any crap about "fitting in the cache" unless
you can show me hard numbers that show that it does in fact perform
worse.

Let me clue you in. If the hash chains get long, you (instead of
cache missing on the table itself) are missing the cache several
times over walking the long hash chains.

Franks a lot,
David S. Miller
davem@redhat.com
-
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/