Hey guys, We had to recompile apache 2.4.12 because we needed to disable thread safety in php (ZTS). Because for some reason when compiling php with the --disable-maintainer-zts with the worker mpm model and checking the php info page, it was saying that thread safety was still enabled. So when we recompiled apache to use the prefetch worker model instead of worker, the php info page was showing that thread safety was disabled. But after that change apache processes spiked from around 11 processes per machine to well over 250 processes at any given time. These are the tuning settings we have in apache: StartServers 10 #MinSpareServers 10 #MaxSpareServers 25 ServerLimit 250 MaxRequestWorkers 250 MaxConnectionsPerChild 1000 KeepAlive On KeepAliveTimeout 30 EnableSendfile Off So I was just wondering how this change could've cause this problem of having the number of apache processes spike. And if there are any other changes we can make to apache to bring the process count down? Also I realize that installing apache / php from source isn't standard practice on red hat variants. But at the time that these servers were setup the latest apache at that time (2.4.12) wasn't available as an RPM. So we just decided to install from source. Thanks Tim -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
lists at benjamindsmith.com
2015-Nov-04 01:09 UTC
[CentOS] prefork vs worker mpm in apache
On Tuesday, November 03, 2015 10:17:22 AM Tim Dunphy wrote:> Hey guys, > > We had to recompile apache 2.4.12 because we needed to disable thread > safety in php (ZTS). Because for some reason when compiling php with the > --disable-maintainer-zts with the worker mpm model and checking the php > info page, it was saying that thread safety was still enabled. > > So when we recompiled apache to use the prefetch worker model instead of > worker, the php info page was showing that thread safety was disabled. > > But after that change apache processes spiked from around 11 processes per > machine to well over 250 processes at any given time. > > These are the tuning settings we have in apache: > > StartServers 10 > > #MinSpareServers 10 > > #MaxSpareServers 25 > > ServerLimit 250 > > MaxRequestWorkers 250 > > MaxConnectionsPerChild 1000 > > KeepAlive On > > KeepAliveTimeout 30 > > EnableSendfile Off > > > So I was just wondering how this change could've cause this problem of > having the number of apache processes spike. And if there are any other > changes we can make to apache to bring the process count down?There isn't near enough info here to respond coherently. A few questions that might be useful to ask: How many hits/second are you serving? How long does a hit take to serve? Why do you need to disable thread safety? What's the system load? What compile options did you use? What does iostat report? Does the server work? What does top report? What's your memory utilization? What are your php.ini settings? Are you using zend optimizer or APC? ... etc... Often, when trying to get details to anticipated questions together for posting to a list, I find the answer. Good luck!