MPM Preforking? What is that?

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

MPM Preforking? What is that?

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Because it dislikes multithreading?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
Post Reply