Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Dec 1998 11:06:12 -0500
From:      Graeme Tait <graeme@echidna.com>
To:        aron <aron@flyingcroc.com>
Cc:        Rob Miracle <rwm@tansoft.com>, FreeBSD-questions@FreeBSD.ORG
Subject:   Re: NMBCLUSTERS: Max Sane Values??
Message-ID:  <366D4E73.BC22DE85@echidna.com>
References:  <Pine.NEB.4.04.9812071317130.288-100000@chaos.necropolis.org>

next in thread | previous in thread | raw e-mail | index | archive | help
It bothers me here that several posts have occurred on this (Apache TCP/IP tuning,
mbuf exhaustion) and related subjects, which are obviously rather technical in
nature, and no answers (AFAIK) have been forthcoming. And we're talking people with
machines panicking here, even (gulp) threatened by management with abandoning
FreeBSD! I didn't learn much from the archives either, although maybe I was looking
in the wrong places.


Perhaps the FreeBSD group needs a formal mechanism to escalate unresolved critical
support issues to a level where they get appropriate attention. Maybe hard to do in a
volunteer effort, but maybe better than losing users, or having the OS
mis-performing.


aron wrote:
> 
> More info on my little mbuf problem after digging through more docs...
> 
> This is a 3.0-RELEASE box with 512MB RAM (soon to be 1GB) running
> exclusively as a web server (apache 1.3.2) AFAIK it is running with the
> default config using lingering_close()... Would anyone by chance know if
> using SO_LINGER instead would be a benefit?
> 
> I'm still digging around to find the appropriate timeouts to tweak to
> bring down my massive amounts of sockets in TIME_WAIT
> 
> anyway any hints or pointers appreciated


As a raw beginner running his first server, I wanted to learn about some of the
performance/tuning issues, so I started digging around.

I posted a question about memory requirements here. No answers - actually, one
belated (but appreciated) answer. However, although somewhat helpful, that answer was
a referral to Sun information, and didn't really answer my questions.

I read all the information on the Apache site at
http://www.apache.org/docs/misc/perf.html, including that for systems other than
(Free)BSD. The link from the Solaris section to
http://www.rvs.uni-hannover.de/people/voeckler/tune/EN/tune.html was by far the most
illuminating.

Digging around from there, I found the value TCPTV_MSL (default 30sec) defined in
/usr/src/sys/netinet/tcp_timer.h, which seems to be the controlling parameter for the
TIME_WAIT interval (see tcp_input.c). OTOH, it looks like you *really* want to
understand what's going on if you shorten this.

Any advice?


It seems to me that a FreeBSD FAQ on Apache (and other heavy network load) tuning is
sorely needed. (E.g., how does cdrom.com do it?). Clearly, the out-of-the-box FreeBSD
configuration is not adequate.

What is at http://www.apache.org/docs/misc/perf-bsd44.html#detail is OK as far as it
goes (although somwhat dated?), but any tuning guide which fails to quantitively
relate tuning parameters to load conditions is surely rather meaningless. (E.g, "we
crank that value [NMBCLUSTERS = 4096]" - good for how many hits/second, etc.?)

I've seen people post that a low end Pentium running FreeBSD/Apache can easily
saturate 10Mbps ethernet. From what I've learned so far, in a real world environment
(very many slow dial-up connections, transferring relatively small files), this is a
non-trivial tuning exercise. My guess is that you would need to be at levels
comparable to those corresponding to the quoted data below to be approaching this
regime.

I also have this silly(?) idea that I want to know how to tune to prevent panics or
performance loss in advance, rather than fix problems after a production server
starts collapsing once or more a day. Sorry, feeling a bit frustrated and overwhelmed
here, but I *do* have this nagging feeling that in researching all this, I'm
unnecessarily reinventing the wheel.


 
> detail info follows:
> 
> > netstat -m
> 18508/21856 mbufs in use:
>         7358 mbufs allocated to data
>         11150 mbufs allocated to packet headers
> 7049/9094/10240 mbuf clusters in use (current/peak/max)
> 20920 Kbytes allocated to network (78% in use)
> 0 requests for memory denied
> 0 requests for memory delayed
> 0 calls to protocol drain routines
> 
> > netstat -Aanf inet | grep TIME_WAIT | wc -l
>     7171
> 
> > netstat -Aanf inet | grep FIN_WAIT_2 | wc -l
>      560
> 
> > ps ax | grep httpd | wc -l
>      702
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



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