Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Nov 1997 02:17:25 -0800
From:      David Greenman <dg@root.com>
To:        Joe McGuckin <joe@via.net>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: 'sys' is consuming %50 of cpu 
Message-ID:  <199711061017.CAA10471@implode.root.com>
In-Reply-To: Your message of "Wed, 05 Nov 1997 12:11:32 PST." <199711052011.MAA27359@monk.via.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
>I've got a web server that was just upgraded to a 300Mhz Pentium II.
>
>Now the load average is down to a more manageable '20'.
>
>This machine has around 3K tcp connections to it according to netstat.
>Here they are listed by type:
>
>CLOSE_WAIT                5
>LAST_ACK                 25
>ESTABLISHED             443
>SYN_RCVD                 59
>FIN_WAIT_1              341
>LISTEN                    1
>TIME_WAIT               723
>FIN_WAIT_2             1716
>CLOSING                  29
>
>One thing I've noticed is that vmstat reports that the kernel
>is using over 50% of the cpu:
...
>Is there anything I can do to reduce the amount of cpu the kernel is using?
>With this many network connections, would I gain anything by making the
> TCBHASHSIZE
>larger?

   Yes, increasing TCBHASHSIZE would help - I use 2048 on wcarchive. Be sure
to keep it a power of two, however. You didn't mention which version of
FreeBSD this was with, but there are some general things I can say...first,
the suggestion made by others to upgrade the ethernet card to a Intel Pro/100B
is a good one. This should trim 10-15% off the CPU time (some from system,
some from interrupt). There is, however, a scalability problem in FreeBSD with
handling many thousands of connections like you have on your machine. I've
been working on this issue on & off for nearly 3 years (I implemented the PCB
hashing in FreeBSD more than 2 1/2 years ago), but just started looking at it
again recently about a week ago. There are many things to do, and hopefully
I'll have some major improvements for this problem in the 3.0 release.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711061017.CAA10471>