Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 1996 19:27:42 -0700 (MST)
From:      Marc Slemko <marcs@znep.com>
To:        "S(pork)" <spork@super-g.com>
Cc:        questions@FreeBSD.ORG, isp@FreeBSD.ORG
Subject:   Re: Tuning for WWW performance...
Message-ID:  <Pine.BSF.3.95.961114190603.1504A-100000@alive.ampr.ab.ca>
In-Reply-To: <Pine.LNX.3.92.961114154644.7909H-100000@super-g.inch.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In -stable, from config.c, MAXUSERS tunes:

 #define NPROC (20 + 16 * MAXUSERS)
 int     maxproc = NPROC;              /* maximum # of processes
 */
 int     maxprocperuid = NPROC-1;      /* maximum # of processes per user */
 int     maxfiles = NPROC*2;           /* system wide open files limit */
 int     maxfilesperproc = NPROC*2;    /* per-process open files limit */
 int     ncallout = 16 + NPROC;        /* maximum # of timer events */

 /* maximum # of mbuf clusters */
 #ifndef NMBCLUSTERS
 int     nmbclusters = 512 + MAXUSERS * 16;
 #else
 int     nmbclusters = NMBCLUSTERS;
 #endif

CHILD_MAX and OPEN_MAX are not affected by MAXUSERS.  CHILD_MAX
and OPEN_MAX should certainly be set, maxusers around 128 or so
would be good (ignore the warning from config), NMBCLUSTERS you
probably don't need to set if MAXUSERS is big enough.

On Thu, 14 Nov 1996, S(pork) wrote:

> Howdy,
> 
> I was just reading through the FAQ's and archives, and I came up with some
> conflicting info; some people were replying that the "MAXUSERS" option
> will take care of mbuf allocation, max open files per user, and max
> processes per user.  Then other folks were giving individual options such
> as "NMBCLUSTERS=4096", "CHILD_MAX= ", "OPEN_MAX= "...  Which is correct?
> And if MAXUSERS can do all of this, what is the formula it uses to
> generate the other values?
> 
> >From what I can tell, it looks like the following requirements must be met
> for a high-performance dedicated web server:
> 
> 1.  Being able to have enough processes for all incoming requests

Assuming you are using a forking server like apache.

> 2.  Being able to have enough files open (4-ish/apache process for access,
> error, browser, referer)

In apache the logs are opened once for all the child processes, so
if you have lots of virtual domains with seperate log files then
you need lots of file descriptors.

> 3.  Having enough buffer space for the sockets
> 
> If I can get some good answers on this, I'd love to throw together a page
> for the FAQ titled "Optimizing FBSD for high-performance web serving" or
> the like...  Then next time someone asks, everyone can say "Look at the
> FAQ!"

There is some BSD advice on the Apache page somewhere under
http://www.apache.org/ that isn't bad.

> 
> Thanks,
> 
> Charles
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.961114190603.1504A-100000>