Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74080 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62102 invoked from network); 9 May 2014 06:46:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 May 2014 06:46:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 209.85.220.172 cause and error) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.220.172 mail-vc0-f172.google.com Received: from [209.85.220.172] ([209.85.220.172:43537] helo=mail-vc0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/AC-15882-2E97C635 for ; Fri, 09 May 2014 02:46:58 -0400 Received: by mail-vc0-f172.google.com with SMTP id hr9so4704331vcb.3 for ; Thu, 08 May 2014 23:46:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type; bh=cSOSRrWRu2jpiZBlMZe9yqE/rn6NxjwgNbCx1Vj2IUQ=; b=K8L4wE3en9QO8/hwdWCBRwZIkjk9Eb1AjfYh21r523qIC6fkklv1apXTU8aNgn1UvQ Hkfi0N7ayqbrqX2je6Zu7OYFgwipFQiA6bwjgdb/ujZIy6CG4z4NxKN21nFvOPMUA3Sf vYdNSz5uewoIaybk5SalhJFzz6o1v8kkg8Jz4DNHAiPesvULAIQAxT5mwEk01FbGWS9S 8BNjpsLFzrX35YAQnIiaCS6G3/ZmKqMmlchZm9yDXbPSq5dfH2TnkdanNf89uoUaTjHc og+VnAlC1SHpwowFOhdfCwoS/JfGfzdrqk+iMM2n7Y+RZ/MX/uFxazQFlPKD9UXMc7ob Nk5A== X-Gm-Message-State: ALoCoQmS2plyG5HqjZUiu3NwoZNjNYLFeYCV7dHhXa1KkeuxdZS9Ro1tq4iTFOdgSrKz+U6BdV8pQvbdR4vSnsikxOj8KvhSYAForpHmh/jm4A7Z8F0A5MfnVnkmMuoF+LkeVYAxeJAC X-Received: by 10.52.72.138 with SMTP id d10mr5741245vdv.15.1399618015238; Thu, 08 May 2014 23:46:55 -0700 (PDT) References: <5369CED9.5010001@php.net> <4339111475046055305@unknownmsgid> <578A5A21-A820-42AD-A218-FB8049F63B82@zend.com> <3A72C770-9A9F-40C9-9DFE-F40478709BA8@ajf.me> <311084565853739035@unknownmsgid> <536BA9FE.1090408@lerdorf.com> <2c470224f5eca827363a3c5878bc709d@mail.gmail.com> <536C08E9.6090902@lerdorf.com> In-Reply-To: <536C08E9.6090902@lerdorf.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQEftMwaGDy2m3QH84O/axsSuTXZAQJQjPokAQyBFxwCma+kwwKeu99vAh3SXOoB6WgWogIOSIbSAs+YOHkBMJHCNgGXweLTAfgxM5cC0Di9nQHy2d6Lm79DYIA= Date: Fri, 9 May 2014 09:46:47 +0300 Message-ID: <2e899d0c507e0c82455341a5f9e6e08a@mail.gmail.com> To: Rasmus Lerdorf , Andrea Faulds Cc: Andi Gutmans , Sebastian Bergmann , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: RE: [PHP-DEV] phpng: Refactored PHP Engine with Big Performance Improvement From: zeev@zend.com (Zeev Suraski) > On 5/8/14, 2:24 PM, Zeev Suraski wrote: > > 1. You're right it buys operational stability; But then, people > > who'll go on a major PHP version upgrade will expect some level of > > operational instability (we should hope so at least, because they'll > > probably get > it). > > App breakages are an order of magnitude (or two or three) more painful > > than relatively simple changes to monitoring tools or administrative > > scripts. > > We tend to provide very good forward compatibility with E_DEPRECATED > warnings and a detailed UPGRADING document. This means you can prepare a > codebase for the next major release well ahead of time and run it in > production > on the previous version while it is easy for the developers to run a newer > PHP > version on a dev vm to make sure everything gets caught. At the point of > the > upgrade it becomes quite painless. That is, the work is nicely spread out > and > there is no jarring company-wide disruption since all app breakages have > been > pre-fixed. While that's true in theory, in practice I think it's rarely the case. My experience has been that when companies decided to move to a new version - that's the time they did the code migration, and not a moment sooner. Beforehand, they'd just turn off E_DEPRECATED to quiet it down. That may not be the nice or right thing to do, but it appears to be the most popular course of action. That said - we can do something along the same lines here, to be nice to those who play nice. We can issue an official 'mod_php is being deprecated' notice when the server starts up - even as soon as 5.6 - and then actually deprecate it in the next major version. Depending on the kind of feedback we see, we can choose whether to actually pull it out or just keep the deprecation warning. Last, I think we're ignoring the fact that the work involved in actually doing the move to FastCGI is very simple and centralized, as opposed to a full app audit - sometimes a source code audit - that is needed when we change constructs or function behavior. It's difficult to compare the complexity of changing codebases of tens, hundreds and sometimes millions of lines of code - to that of relatively minor setup issues. > When swapping out an infrastructure element like the web server or at > least an > architectural aspect of the web server, it is something that touches a lot > of > moving parts and hits not just the dev team but also the test and ops > teams quite > hard. It is hard to prepare for because you don't really know if you > missed > something until you swap out the production implementation that is running > at > scale. So the angst involved is much higher. I think that if we publish it sufficiently ahead of time; Plus point the die hards to where they can get the old mod_php; The amount of angst would actually be much lower than some of the bigger changes we've made over the course of PHP's history. I find it difficult to believe that a change that can be implemented within a couple of hours on a bad day - and with perhaps a couple of extra days to account for scripts and monitoring configurations - would create that much backlash. I think people will appreciate we're pushing them towards the right choice. > > 2. I never argued that FastCGI/fpm is faster than mod_php; It's > > probably not (it's roughly as quick from my experience). But it's *a > > lot* more scalable (in terms of in-machine scalability), since it > > breaks the 1:1 mapping between Apache processes and PHP processes. > > Often, for a typical setup of with hundreds of Apache children, you > > could use just several dozen PHP processes when using FastCGI. With > > mod_php, after a short while you'd have each Apache process consume a > > dozen or more megabytes of memory - times hundreds of processes that's > > a lot of memory; With FastCGI, you'll only have several dozen > > processes consuming that much memory, while the Apache processes can > > stay lean. Not to mention you get to use more efficient mpm's, ones > > mod_php doesn't support - and save even more memory. With requests > > growing shorter, simpler while also rapidly growing in frequency - this > > sort of > density is very important IMHO. > > Yup, I don't disagree that it is a more efficient model, especially for > smaller > shops that don't have the luxury of using CDNs and having multiple server > pools > for different purposes. However, for larger sites, every request that > makes it > through to the Apache+mod_php process tends to be an actual heavy PHP > request. Static files aren't handled by that pool of servers. In that > scenario the > server density differences between FastCGI and mod_php becomes much > smaller. If every request is heavy you are going to need the same number > of > each. You gain a bit by not having the Apache piece in each PHP process, > but it > isn't all that significant and when weighed against the operational cost > of > switching it doesn't seem all that attractive. I still come across a lot of sites of large companies (not the top Internet companies, but still quite large) where Apache does end up serving at least some of the static files. We needn't assume that every medium-large website has experts working to squeeze every last bit of performance out of it, since unfortunately it's not true. Also, maybe it's me but my experience is that Apache really mishandles a situation where it runs out of processes - so more often than not, configurations allow for a lot more processes than may actually be needed. FastCGI/fpm seem to do a much better job at handling a large number of requests with just a handful (or dozenful) of processes. > I would love to be able to convince > sites like that to switch, but I haven't been able to come up with enough > technical benefits to outweigh the operational costs yet. Well, I think deprecating it would be pretty convincing :) Zeev