hybinet wrote:
Guspaz wrote:
Properly configured, with mpm_worker and fastcgi, a huge load spike will not consume more RAM than is available, leading to a slow but accessible website.
Just out of curiosity, what are the default settings like for mpm_worker and fastcgi? Are they more reasonable than the default settings for mpm_prefork and mod_php? Are they just as prone to OOM if used on a Linode 512? Or does the setup require so much manual tweaking that it's pointless to talk about the defaults anyway?
It's not pointless to talk about defaults, because most people don't change them. Out of the box, Apache will explode under load on anything but an enterprise-grade server (and a high-end one at that). Out of the box, the default settings for lighttpd/php will work perfectly fine with 512MB of RAM under heavy load.
My point is that the same thing can be achieved with Apache, but not without manual tweaking. Apache's defaults are not sane.
To answer your other question, mpm_worker defaults to 16 processes with up to 25 threads each. Decoupled from PHP, the memory requirement here is pretty low.
As for the default php fcgi settings, I couldn't tell you for Apache, as I've not set that up. For lighttpd, it's 2 parent processes with 4 children each. I'll admit that the theoretical memory usage there is probably about 1200MB, but that's an order of magnitude lower than Apache. PHP memory load is determined by what you run, not how much of it you run, so typical memory usage for PHP is going to fit inside that 512MB.
Tweaking either Apache or lighttpd can reduce memory usage farther, obviously.