PHP needs a lot more memory than, say, serving static files. If you
used PHP with the worker threaded MPM, and it worked (I haven't heard
many stories of people doing this under Linux), wouldn't you just have
to dial back the number of threads to pretty much the number of
processes you would have allowed under the prefork MPM? The overhead
of a process is pretty tiny next to the overhead of a PHP framework.

Aren't you therefore just paying a performance and stability price
(threadsafe is slower than non-threadsafe, your extensions may or may
not play nice...) for not a lot of benefit under Linux when PHP runs
under the worker threaded MPM?

The best configuration I'm aware of is to run Apache with the worker
threaded MPM, and run PHP in a fastcgi pool, so that you can have
hundreds of threads serving static and cached content in a hurry, and
a smaller pool of more expensive PHP processes. I'm interested to hear
if anyone feels there is a superior model for single-server PHP
hosting under Linux.

(I realize that static files could be pushed out to CDNs and the like
but our clients much prefer to have a single straightforward hosting
bill to pay, thus the single-server thing for most cases.)

On Tue, Feb 28, 2012 at 4:13 AM, jpauli <jpa...@php.net> wrote:
> On Mon, Feb 27, 2012 at 10:12 PM, William A. Rowe Jr.
> <wr...@rowe-clan.net>wrote:
>
>> On 2/27/2012 6:58 AM, jpauli wrote:
>> > PHP through mod_php on Linux should compile without ZTS.
>> >
>> > configure script searches for apxs binary and tries to invoque "apxs -q
>> > MPM" to figure out what MPM has been compiled in Apache for the TS flag
>> to
>> > be defined or not (thus, activating PHP ZTS, or not).
>>
>> Right...
>>
>> > Mainly on Linux, Apache should have been installed with prefork MPM ans
>> > "apxs -q" should return that, then configure should not define
>> > PHP_BUILD_THREAD_SAFE.
>>
>> No, 2.2 and 2.4 don't default to prefork, it's suboptimal, most linux
>> distros have moved away from it...
>>
>> Sorry but 2.2 defaults to prefork.
> The new 2.4 platform has introduced loadable MPM, like any other module ,
> thus we cant detect through
> apxs which MPM is used anymore. For this, we would need to play with httpd
> -M
>
>
>
>> > Recently we had a bug with the new Apache 2.4 API where apxs doesn't
>> answer
>> > about the MPM configuration anymore, leading to a ZTS build by default.
>> > This bug has now been fixed, was https://bugs.php.net/bug.php?id=61172.
>>
>> Wrong fix.  Out of the box you don't know which mpm may be loaded, because
>> the mpm is now loadable (although a full daemon stop/start is necessary).
>> The only mod_php loadable under any circumstance is TS enabled.
>>
>
> Yes, but ZTS has a performance/memory penalty due to globals locks.
> I would much prefer having a nonZTS PHP together with a non threaded MPM
>
> Julien.P
>
>
>> If you want php/linux single-child, fastcgi is the only rational approach.
>>
>> > I dont know anything about windows, sorry
>>
>> Always threaded.
>>
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>



-- 
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to