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).
What do you think about this?
Thank.
Hi
2015-06-25 22:31 GMT+02:00 S.A.N ua.san.alex@gmail.com:
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).What do you think about this?
Thank.
If there is someone willing to implement this (and maintain it), I
don't see any reason for why this could not be accepted into PHP. I
would expect such, if implemented by someone, to first be available in
7.1.0, although we could do exceptions like we did for FPM which came
in 5.3.3 or something, although that was before tuning to our RFC
process and such.
--
regards,
Kalle Sommer Nielsen
kalle@php.net
If there is someone willing to implement this (and maintain it), I
don't see any reason for why this could not be accepted into PHP. I
would expect such, if implemented by someone, to first be available in
7.1.0, although we could do exceptions like we did for FPM which came
in 5.3.3 or something, although that was before tuning to our RFC
process and such.
Yes, I am rich in ideas, but unfortunately I am not a developer C.
Perhaps this can be done, Antony Dovgal (tony2001), if he would be interested.
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
Tons of things in PHP or in libraries called by PHP are
blocking
Yes, it's not a problem, thread pools for use blocking processes do
not block the main process Nginx.
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.