NGINX + PHP-FPM + APC = Awesome
interfacelab.com
NGINX + PHP-FPM + APC = Awesome
1–10 of 19 posts
Re: NGINX + PHP-FPM + APC = Awesome
#2Re: NGINX + PHP-FPM + APC = Awesome
#3Some commenters recommended Nginx to me a while back. It freaking rocks. It was such a breeze to setup and the memory usage is incredibly low and stable. Thanks for the tips then, and thanks for continuing to post articles to spread the word!
I'm hoping people learn more about PHP-FPM too. It's a deadly combo with nginx.
Re: NGINX + PHP-FPM + APC = Awesome
#4Some commenters recommended Nginx to me a while back. It freaking rocks. It was such a breeze to setup and the memory usage is incredibly low and stable. Thanks for the tips then, and thanks for continuing to post articles to spread the word!
Thanks. I'm hoping people learn more about PHP-FPM too. It's a deadly combo with nginx.
Re: NGINX + PHP-FPM + APC = Awesome
#5Couple of comments:
* Make sure that your init script is actually working. The init script you posted a link to places the pid file in a different location than the default for a source compiled nginx.
* There's an Ubuntu package for php+fpm somewhere on Launchpad. https://launchpad.net/~tarkus/+archive/ppa
* gzip support on older IE versions is iffy. See http://bit.ly/A0CRd for a config that ignores those browsers.
Re: NGINX + PHP-FPM + APC = Awesome
#6Seriously, that process might well outlive me.
Re: NGINX + PHP-FPM + APC = Awesome
#7"For starters, with mod_php, each request that Apache handles loads PHP - and all of it’s libraries."
No, it doesn't. In fact, that's a distinct advantage of mod_php. Everything is loaded and in memory when the request comes in. Throw APC on top of that and your code is also already compiled.
The only way that would not be true is if you've got MaxRequestsPerChild tuned really low and are restarted Apache children constantly. Some restarting is OK and helps keep memory leaks under control, but it shouldn't be so low that nothing stays cached. It's going to be slow with or without PHP running as a FastCGI.
Of course, I don't know how NGINX handles things, but for Apache he's got it all wrong.
Re: NGINX + PHP-FPM + APC = Awesome
#8I was on board until I read this: "For starters, with mod_php, each request that Apache handles loads PHP - and all of it’s libraries." No, it doesn't. In fact, that's a distinct advantage of mod_php. Everything is loaded and in memory when the request comes in. Throw APC on top of that and your code is also already compiled. The only way that would not be true is if you've got MaxRequestsPerChild tuned really low an…
Actually, thats not right, even with APC. A large set of operations run at the start of every request. For example, the class- and function-tables are filled and copied. Each extension (library) also has a per-request callback.
I don't know anything about NGINX either. But he's not wrong about the "epic shit ton of overhead".
Re: NGINX + PHP-FPM + APC = Awesome
#9I was on board until I read this: "For starters, with mod_php, each request that Apache handles loads PHP - and all of it’s libraries." No, it doesn't. In fact, that's a distinct advantage of mod_php. Everything is loaded and in memory when the request comes in. Throw APC on top of that and your code is also already compiled. The only way that would not be true is if you've got MaxRequestsPerChild tuned really low an…
I would love it if someone cleared a very basic doubt of mine : If php is compiled, then what is the advantage of other programming languages? Wouldn't it be the same as anything else (except maybe considering the size of the language)? Is it just the optimization of the compiler then? And if so, would PHP compare the same to other loosely typed languages?