Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86894 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83236 invoked from network); 26 Jun 2015 05:39:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2015 05:39:55 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.220.45 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.220.45 mail-pa0-f45.google.com Received: from [209.85.220.45] ([209.85.220.45:33617] helo=mail-pa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/E1-57329-9A5EC855 for ; Fri, 26 Jun 2015 01:39:54 -0400 Received: by padev16 with SMTP id ev16so62681149pad.0 for ; Thu, 25 Jun 2015 22:39:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=qWR2ZMXmUhqJ/oh7nEq/NZSI74ei2bagMDMF8Z+o3ys=; b=bR+5rqzitjT1ysILw7WHo3bFbkoam/5TKZZ0bDPGmGG3zzxD1KitH080ZR3szRA4kr irKG31PL/ON0Ud1P0dXhI0AR9/qo+UM5XRWFxrHxheUQCaFEd/ptegWSzCtQS6SKXROJ m+MKJ0ajxK/YQvnIvmY8dndJ4DjBlv6ZIOC0JUhuAzFRA+BtNofvuy3ukT6wx8BJecDz BwqjtUVgw1FoeJEjs6g4OptXjwaEZ1deWTKyRuVJkDi/XnrrfAWCI6JtypeloddB0TOX I39u8NGYepCEZv22qOHXWDxGH38BvUV8L33k+SFUL6B8+vfXhH08f5c52C05+aQelplz 7Hvw== X-Gm-Message-State: ALoCoQkvoK3HFVVpIhkFmrW+awT2liaVf1zImqt1q/2dm4+N1Iw/ymZnUnoWBHDgNkbxTIkrfMuX X-Received: by 10.66.161.135 with SMTP id xs7mr4145757pab.154.1435297189944; Thu, 25 Jun 2015 22:39:49 -0700 (PDT) Received: from [192.168.200.14] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id bx8sm32129912pab.38.2015.06.25.22.39.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2015 22:39:47 -0700 (PDT) Message-ID: <558CE5A2.2050300@lerdorf.com> Date: Thu, 25 Jun 2015 22:39:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "S.A.N" , internals References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="r4UXn3ukAUl7Q4f5URT3xJHJlM8V6sswi" Subject: Re: [PHP-DEV] New PHP SAPI for Nginx From: rasmus@lerdorf.com (Rasmus Lerdorf) --r4UXn3ukAUl7Q4f5URT3xJHJlM8V6sswi Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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/ >=20 > 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. >=20 > 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. -Rasmus --r4UXn3ukAUl7Q4f5URT3xJHJlM8V6sswi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWM5aIACgkQlxayKTuqOuAMvwCeM+u6qHTYvq7vte14lJM43/Qc ew0AnRCN5kgop8tO2rRU3I88hj+1GHEF =GvrE -----END PGP SIGNATURE----- --r4UXn3ukAUl7Q4f5URT3xJHJlM8V6sswi--