Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58237 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83935 invoked from network); 28 Feb 2012 14:35:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2012 14:35:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain punkave.com designates 209.85.210.170 as permitted sender) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:65415] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/20-17048-516EC4F4 for ; Tue, 28 Feb 2012 09:35:02 -0500 Received: by iaeh11 with SMTP id h11so2909501iae.29 for ; Tue, 28 Feb 2012 06:34:59 -0800 (PST) Received-SPF: pass (google.com: domain of tom@punkave.com designates 10.42.72.130 as permitted sender) client-ip=10.42.72.130; Authentication-Results: mr.google.com; spf=pass (google.com: domain of tom@punkave.com designates 10.42.72.130 as permitted sender) smtp.mail=tom@punkave.com Received: from mr.google.com ([10.42.72.130]) by 10.42.72.130 with SMTP id o2mr15075882icj.8.1330439699183 (num_hops = 1); Tue, 28 Feb 2012 06:34:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.72.130 with SMTP id o2mr12363562icj.8.1330439699095; Tue, 28 Feb 2012 06:34:59 -0800 (PST) Received: by 10.231.108.135 with HTTP; Tue, 28 Feb 2012 06:34:59 -0800 (PST) In-Reply-To: References: <5a1d155ad465d1ec2e6461f5347d859f.squirrel@www.l-i-e.com> <4F4BF1C6.8010104@rowe-clan.net> Date: Tue, 28 Feb 2012 09:34:59 -0500 Message-ID: To: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQnIG8YZkXVE87DmoIjLU1x6jEKkiNOOH6IYp1/WhisZSsc4JSSEnDdW5nKKFfmha6Navd8b Subject: Re: [PHP-DEV] pecl, zts, non-zts, fastcgi and Apache From: tom@punkave.com (Tom Boutell) 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 wrote: > On Mon, Feb 27, 2012 at 10:12 PM, William A. Rowe Jr. > 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 fla= g >> to >> > be defined or not (thus, activating PHP ZTS, or not). >> >> Right... >> >> > Mainly on Linux, Apache should have been installed with prefork MPM an= s >> > "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 http= d > -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=3D611= 72. >> >> Wrong fix. =A0Out of the box you don't know which mpm may be loaded, bec= ause >> 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 approac= h. >> >> > 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 >> >> --=20 Tom Boutell P'unk Avenue 215 755 1330 punkave.com window.punkave.com