Prefork Vs Worker Mpm In Apache

Home » CentOS » Prefork Vs Worker Mpm In Apache
CentOS 1 Comment

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

One thought on - Prefork Vs Worker Mpm In Apache

  • 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!