Greg Ames wrote:
>
>
> Paul, since you have quite a few monster files mixed in with the little
> stuff, please tune the threaded parameters judiciously. We don't have
> any automatic protection yet for low MaxRequestsPerChild combined with
> high ThreadsPerChild combined with small scoreboards combined with long
> & short downloads. Don't assume the threaded parms in the config you
> got from me and/or apache.org make any sense at all - apache.org has
> only run prefork in production (FreeBSD).
>
> That said, I guess the threaded mpm really isn't ready for prime time,
> unless:
> * you are prepared to tune it (we can help), or
> * you know that your download times are all pretty uniform.
>
I should probably elaborate some on the tuning, in case folks want to
play. Basic stuff first, more advanced stuff after more sleep:
The threaded MPM currently uses MaxRequestsPerChild just like Apache 1.3
and 2.0 prefork do, tha it, when a process hits the magic number, it
quits accepting new connections. But since ThreadsPerChild will usually
be > 1 , one thread can be serving something that takes a really long
time, while the rest of the threads run thru the little stuff
lickety-split. That process goes into what I call a "quiescing" state,
and is useless as far as serving any new requsts although it takes up
space in the scoreboard.
So you can give yourself some immunity to this phenomenon by starting
with the number of threads per process really small (e.g. 2), and the
max number of processes really big (e.g. whatever you use with prefork
or 1.3), and increasing MaxRequestsPerChild. Bump up MaxClients in your
config file to the max number of processes you want, and lower
ThreadsPerClient. While you're in there, if you don't think you have
memory leaks, bump MaxRequestsPerChild way up. Change HARD_SERVER_LIMIT
in server/threaded/mpm_default.h to give the scoreboard enough room for
your processes. You can lower HARD_THREAD_LIMIT to match
ThreadsPerChild if you want to minimize the shared memory used by the
scoreboard, or just leave it as-is if shared memory is not causing
problems.
If this works out for you, you can gradually increase the number of
threads and decrease the max number of processes. I would keep an eye
on things using ps and mod_status. (yeah, I know it needs work for
threaded, but it's something...)
Greg