nginx+php-fpm question
| From: | J Ravi Menon | Date: | Wed, 15 Sep 2010 17:57:34 +0000 |
| Subject: | nginx+php-fpm question | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-49671@lists.php.net to get a copy of this message | ||
Hi,
[Note: I am new to this list and I don't actively work on php
internals. I have been occasionally glancing at some php internals
here n there for interest and better understanding.]
I raised this question on php-general and was recommended to try out
the internals list:
(tried to search the archives but couldn't do so)
http://news.php.net/php.general/308097
My specific doubts are:
1) In the fast-cgi setup with php-fpm, it seems the app developer is
responsible for resource mgmt? Currently we use apache+mod_php (apache
2.2, php 5.2.x series on linux 2.6), and we rely on mod_php cleaning
up various resources (non-persistent socket connections to memcached,
mysqld, and other services via curl).
So my guess is, if we do php-fpm approach, we have to do all these
cleanups manually? Or are there simpler solutions or hook-ups that
does it automatically at the end of the request cycle?
2) My other concern is the extra ipc overhead between
nginx<---->php-fpm servers even on unix sockets. To me in theory
apache+mod_php ( + apc with stat off) should be as efficient as you
can get. Granted nginx might be more efficient in its socket mgmt
(non-blocking event-driven i/o), but can it really outperform the
apache approach given the issues in (1) are resolved?
I hope to run some tests myself with our typical (and non-trivial) php
app, but any insights you already have would be beneficial.
thx,
Ravi