Page 1 of 1

MPM Preforking? What is that?

Posted: Mon Jan 08, 2007 9:09 am
by Ollie Saunders
PHP Manual on [url=http://uk.php.net/manual/en/install.unix.apache2.php]Apache 2 Installation[/url] wrote:We do not recommend using a threaded MPM in production with Apache2. Use the prefork MPM instead, or use Apache1.
What is this? How do I make sure that I am using prefork MPM?

Posted: Mon Jan 08, 2007 9:29 am
by feyd

Posted: Mon Jan 08, 2007 11:23 am
by Ollie Saunders
Yeah I looked at that I was hoping for an explanation as to why PHP likes preforking but not threading...not that I understand what either of them are.

Posted: Mon Jan 08, 2007 11:37 am
by feyd
Because it dislikes multithreading?

Posted: Mon Jan 08, 2007 12:15 pm
by volka
It's a "please-dont-add-more-trouble" precaution as described in
http://uk.php.net/manual/en/faq.installation.php#faq.installation.apache2 wrote:1. Why shouldn't I use Apache2 with a threaded MPM in a production environment?
see also http://en.wikipedia.org/wiki/Thread-safe

Posted: Mon Jan 08, 2007 2:39 pm
by Christopher
ole wrote:Yeah I looked at that I was hoping for an explanation as to why PHP likes preforking but not threading...not that I understand what either of them are.
I believe the reason is that some extensions are not thread-safe. I also believe the core of PHP and many extensions work fine on a multi-threaded webserver. I have used the threaded MPM on production servers without problems, but that is with a very basic installation. Using preforking with Apache2 is the safe thing to do if you don't know if all the extensions you are using are thread-safe.