Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46938 invoked from network); 29 Jan 2013 13:18:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2013 13:18:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.49 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.215.49 mail-la0-f49.google.com Received: from [209.85.215.49] ([209.85.215.49:41156] helo=mail-la0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/A7-10721-E2CC7015 for ; Tue, 29 Jan 2013 08:18:38 -0500 Received: by mail-la0-f49.google.com with SMTP id fs13so281418lab.36 for ; Tue, 29 Jan 2013 05:18:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=hm24Gm1FlBhScGigxAUEmwQ2Zp/0ygXbJSak29JUfrM=; b=pdlNw421J7tsIkPN6j9qQlQwl322Av3a6IZkUXYVA2kZBzVTa1TJEelIyYYzi2SPEk ek1MKjazAh4AcvBICgsBf+V0nK0NlDtgLIDMQe2AjWVKJQAYSMXGJuTchMyjjD5VRdpj rIYxSmdYaLCVt9QdqYXNANvy/NGWtS5T9n6cNMOO6IOBZnNJWEj5dTLiGgm4osdgD812 0tCg+zE+WbnEoh+dVV4geVRULMAmacKk0b/015dDhhBlge0/LSWCbus5VgUrK9UGaRPF G7/WyhzMiWvYarg8zY3/iDcxj36+WoBI/wGZuwlefl042pZqZcjIbjg9eeF5W+XQ0LpY RlXQ== MIME-Version: 1.0 X-Received: by 10.112.83.133 with SMTP id q5mr484019lby.40.1359465515485; Tue, 29 Jan 2013 05:18:35 -0800 (PST) Received: by 10.112.2.69 with HTTP; Tue, 29 Jan 2013 05:18:35 -0800 (PST) In-Reply-To: References: <1359459921.3916.105.camel@guybrush> Date: Tue, 29 Jan 2013 14:18:35 +0100 Message-ID: To: Zeev Suraski Cc: =?ISO-8859-1?Q?Johannes_Schl=FCter?= , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] ZTS - why are you using it? From: pierre.php@gmail.com (Pierre Joye) On Tue, Jan 29, 2013 at 1:52 PM, Zeev Suraski wrote: >> -----Original Message----- >> From: Pierre Joye [mailto:pierre.php@gmail.com] >> Sent: Tuesday, January 29, 2013 2:19 PM >> To: Zeev Suraski >> Cc: Johannes Schl=FCter; PHP internals >> Subject: Re: [PHP-DEV] ZTS - why are you using it? >> >> On Tue, Jan 29, 2013 at 1:06 PM, Zeev Suraski wrote: >> >> >> It is inter process sharing and is very expensive, nothing to compare >> > with shared >> >> memory within a single process, accross many threads. >> > >> > What are you basing that assertion on? Shared memory should have >> > identical performance to regular process memory. It's mapped in very >> > similar way. >> >> Testing maybe? > > Retest then, you've got it wrong. Shared memory (or memory mapped files > as they'd be on Windows) are simply memory, it's available to the process > in exactly the same way and while the OS does slightly different > book-keeping for it in how it populates the pages - it's negligible. It is not negligible, also the locking is different. Also, if I remember correctly there is no rwlock support either, which is a huge cons. >> No, we can't. The main reason of the bugs and performance issue is due > to the >> current implementation and how extensions developers have to deal with > it. It is >> not separable from discussing what could be the worst decision we ever > made, >> droping thread safety. > > Well, I'm not interested in discussing the implementation when the need > isn't clear to me. > For example, you could say that thread-safe PHP would be 2x faster. Or 2= x > more memory efficient. Or will enable us to do XYZ which we otherwise > can't. There are quite a few things I can do on Windows only in thread safe environments (f.e. ESENT, builtin DB, used by AD for example, damned fast). > For now, an *utopian* ZTS mode would, at best, not give us anything. > Even if we put aside the performance/reliability issues - why would > someone want that mode over other modes? I must be really unclear or something along this line. Alone on IIS, there are dozen of features you can't do nor use using fastcgi. Apache could also be used in a better way (windows here too, linux has a module for both builds of apache). btw, have you tried to compare IIS/FastCGI (I won't even try with apache+fastcgi) on Windows vs nginx-fpm on linux? I would be very surprised if your numbers show that they are equivalent. > Pierre, I'm sorry, but when you state something like '[shared memory] is > inter process sharing and is very expensive', there's no other way to > describe it other than a myth. Better theoretical performance is a > misconception. The best PHP performance/density available today is on > nginx, which couldn't be farther away from > multithreaded-PHP-in-process-arch. > > Even after what you just said, you've yet to bring up a single reason for > why one would want to use ZTS inside a web server context. You seem to > love ZTS with a vengeance but you can't quite explain why. My 'company' > didn't decide anything regarding ZTS. It was me, probably the person wit= h > the most experience with ZTS back in the day, and it was probably much > more difficult for me than anybody else to realize that the ZTS approach > was the wrong path to go to as it was my baby project. It could have been the wrong path for some situation back then, but it is definitively not wrong to improve thread safety. I would rather have one single build instead, and enable the ts related stuff when necessary. It will add some more functions in the engine but it would be much more clear and easier than what we have now. > BTW, for the love of [insert here], I'm not talking about killing thread > safety. That's how it looks and that's where this discussion is going, tbh. > It's useful for long running processes, and who knows, maybe in > the future we'll have threads inside PHP. But I *am* talking about > telling people that using ZTS in production is not recommended and that > they should be using FastCGI instead. As far as I remember, we already do that for a couple of web servers. And in the long run, I will rather tell not to use FastCGI for dedicated hosting and the likes. That being said, I also met many ISPs which are not happy with the all-fastcgi, memory usageand performance were the issues (have to read my backlog for other details :). Cheers, -- Pierre @pierrejoye