Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86901 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19764 invoked from network); 26 Jun 2015 09:45:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2015 09:45:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:37217] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/B5-57329-54F1D855 for ; Fri, 26 Jun 2015 05:45:41 -0400 Received: by wicgi11 with SMTP id gi11so12698745wic.0 for ; Fri, 26 Jun 2015 02:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mPrembDikQxoVDXvX48wBuUZLkFjOt+j1K9uBCvgnys=; b=FA4V0MoW9Xvm07jtdn1QBcQvfClExefULSAJsncbh5Iw8zPpBy9hKCDgUoaYIZ4AyK VZXRDyRPYVsxcIOA5g8SyDGZeZYN+uYXED4FQq/4OVczOj+CgcwPfD8bXciHWOnJ/2JT jWmLWo6YUVmzbrcPNU61pUKP4BpazPwLkVewB95pz7E6vJ27kKJOAtzDx+3ez1fdvWM6 Khxf4SdC5bgC/7aEYO7LKR7gjyRhao9klbkps+XZgeEKr1nktOUKXPna0YPhrJuYsg1B yRRcLmrNWv/XjSf77VOGJ/8FkbJIdDo4CnGCqvpDmJc976kkyErzOeTE9t0X/GSOO8e2 7BtQ== MIME-Version: 1.0 X-Received: by 10.194.92.10 with SMTP id ci10mr1349878wjb.49.1435311937956; Fri, 26 Jun 2015 02:45:37 -0700 (PDT) Sender: are.you.winning@gmail.com Received: by 10.180.186.103 with HTTP; Fri, 26 Jun 2015 02:45:37 -0700 (PDT) In-Reply-To: <558CE5A2.2050300@lerdorf.com> References: <558CE5A2.2050300@lerdorf.com> Date: Fri, 26 Jun 2015 10:45:37 +0100 X-Google-Sender-Auth: _oc69HrRzmnT77yvjv92MKQtRok Message-ID: To: Rasmus Lerdorf Cc: "S.A.N" , internals Content-Type: multipart/alternative; boundary=047d7bfd0654342fb80519689a7f Subject: Re: [PHP-DEV] New PHP SAPI for Nginx From: cw@daverandom.com (Chris Wright) --047d7bfd0654342fb80519689a7f Content-Type: text/plain; charset=UTF-8 On 26 June 2015 at 06:39, Rasmus Lerdorf wrote: > On 06/25/2015 01:31 PM, S.A.N wrote: > > New versions Nginx, implement thread pools, > > http://nginx.com/blog/thread-pools-boost-performance-9x/ > > > > I think this is a good opportunity to write a Nginx module (PHP SAPI) > > which is to process requests for PHP scripts in processes Nginx. > > > > Quality advantages, as compared with the FPM, no network overhead, > > less memory consumption, may be implemented mode ZTS (Zend Thread > > Safety). > > Putting an entire PHP request in one of these nginx threads seems like a > bad idea to me. Tons of things in PHP or in libraries called by PHP are > blocking, plus ZTS mode is slower, uses more memory than non-ZTS mode > and is in general just more complex to work with, especially when it > comes to process-wide things like env, locale and signals. Having a > clear separation between PHP and the web server makes many things much > simpler and more robust. You can also already do nginx to php-fpm > without any network overhead by using a unix domain socket. > > I too would be very surprised if there's anything to be gained by turning PHP into a full module for nginx, I suspect that at best it just "won't be any slower" than fpm. I feel that any time spent on doing something like this would have been better spent improving fpm, which is a generic interface to an arbitrary web server, rather than creating an entirely new codebase to maintain which serves a much more niche purpose. --047d7bfd0654342fb80519689a7f--