Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2008 16:05:22 -0400
From:      Bill Moran <wmoran@potentialtech.com>
To:        FreeBSD <freebsd@optiksecurite.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC
Message-ID:  <20081027160522.bd32e714.wmoran@potentialtech.com>
In-Reply-To: <4906196C.8000407@optiksecurite.com>
References:  <49060AE0.3000301@optiksecurite.com> <8efc42630810271157u2202e7f7xfb89a7004d072ae9@mail.gmail.com> <4906196C.8000407@optiksecurite.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In response to FreeBSD <freebsd@optiksecurite.com>:

> Simon Chang a =E9crit :
> >> collecting pv entries -- suggest increasing PMAP_SHPGPERPROC
> >>
> >> I've read that this is mainly caused by Apache spawning too many proce=
sses.
> >> Everyone seems to suggest to decrease the MaxClients directive in Apac=
he(set
> >> to 450 at the moment), but here's the problem...i need to increase it !
> >> During peaks all the processes are in use, we even have little drops
> >> sometime because there isn't enough processes to serve the requests. O=
ur
> >> traffic is increasing slowly over time so i'm affraid that it'll becom=
e a
> >> real problem soon. Any tips on how I could deal with this situation,
> >> Apache's or FreBSD's side ?

[snip]

> I don't really understand why we are getting this error since there is=20
> plenty of Inactive RAM in the system (2G inactive on a 4G server with=20
> amd64). Is this a "normal" error in this case?

It's not about physical RAM, it's about kernel tables that are tracking
RAM usage per process.  When situations occur that cause these tables to
fill up, the kernel can't track RAM any more (even if it has plenty) so
it has to scan the entire table to garbage collect unused PV entries.
Depending on the exact circumstance, this usually won't hurt much, but
it does create a performance problem while the kernel is working on it.

Raising PMAP_SHPGPERPROC works most of the time.  You can also re-tune
your Apache setting to keep processes from constantly spawning and
dying.  For example, set the max spare and min spare servers settings
higher, so Apache keeps more spare servers around instead of spawning
them on demand and killing them when the demand ends.

Another option is to upgrade to 7.X, which seems to have replaced the
mechanism by which this is done to be more dynamic and not have this
problem.

--=20
Bill Moran
http://www.potentialtech.com



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