Hey guys... I am building a new server for a predominantly php/mysql website and don't know whether I should install Apache 2 with the Prefork MPM or just go with Apache 1.3.x.
I've read so many wierd things about PHP and Apache 2 that I'm not sure what to do. What do you guys like to run? What do you suggest?
Apache 2 Prefork, better than 1.3?
Moderator: General Moderators
- seodevhead
- Forum Regular
- Posts: 705
- Joined: Sat Oct 08, 2005 8:18 pm
- Location: Windermere, FL
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Apache 2 Prefork, better than 1.3?
I would go ahead with Apache 2. You do not have to install the MPM stuff, and there is only a slight amount of issue between PHP and Apache 2 with MPM, but I think it is only under a few, specific circumstances.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Re: Apache 2 Prefork, better than 1.3?
...I can elaborate on that. Apache 2's MPMs (multi process modules, I believe) determine the process architecture apache will use. One can be in use at a time. Normally one has to be chosen at build time but if you are a Ubuntu user you will be able to change MPMs as easily as installing packages.
For Apache 2 there's a choice of threaded, prefork and worker. The official recommendation is prefork despite being the lowest because it isn't threaded at all. The risk is that because PHP is designed to be extensible anybody can write a C extension that isn't thread safe. I seems nobody really knows which ones are and which ones aren't. If you are confident you won't be using thread unsafe extensions you'll want the faster threaded or worker MPMs otherwise stick to prefork. Personally I use prefork.
I believe the speed difference between threaded and preforked MPM is fairly significant. Apache 2.2 offers even more MPMs that I haven't looked into properly.
For Apache 2 there's a choice of threaded, prefork and worker. The official recommendation is prefork despite being the lowest because it isn't threaded at all. The risk is that because PHP is designed to be extensible anybody can write a C extension that isn't thread safe. I seems nobody really knows which ones are and which ones aren't. If you are confident you won't be using thread unsafe extensions you'll want the faster threaded or worker MPMs otherwise stick to prefork. Personally I use prefork.
I believe the speed difference between threaded and preforked MPM is fairly significant. Apache 2.2 offers even more MPMs that I haven't looked into properly.
- seodevhead
- Forum Regular
- Posts: 705
- Joined: Sat Oct 08, 2005 8:18 pm
- Location: Windermere, FL
Re: Apache 2 Prefork, better than 1.3?
Boy, thanks so much for the great replies guys. I went ahead and had it compiled using the prefork MPM.
My server has dual Quad-core Xeons.... I'm not losing any dual quad-core power by using prefork am I? Like, I won't be running php on one single core right?
My server has dual Quad-core Xeons.... I'm not losing any dual quad-core power by using prefork am I? Like, I won't be running php on one single core right?
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Re: Apache 2 Prefork, better than 1.3?
I doubt it. That question might be better posed to someone who knows a thing or two about kernels.