Re: New PHP SAPI for Nginx
| From: | Rasmus Lerdorf | Date: | Fri, 26 Jun 2015 05:39:46 +0000 |
| Subject: | Re: New PHP SAPI for Nginx | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86894@lists.php.net to get a copy of this message | ||
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.
-Rasmus
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc