Apache 2 Prefork, better than 1.3?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Apache 2 Prefork, better than 1.3?

Post by seodevhead »

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?
User avatar
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?

Post by RobertGonzalez »

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.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: Apache 2 Prefork, better than 1.3?

Post by Ollie Saunders »

...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.
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Re: Apache 2 Prefork, better than 1.3?

Post by seodevhead »

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?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: Apache 2 Prefork, better than 1.3?

Post by Ollie Saunders »

I doubt it. That question might be better posed to someone who knows a thing or two about kernels.
Post Reply