Managing suEXEC Fcgid Processes with APC

Events happening in the community are now at Drupal community events on www.drupal.org.
Daeluin's picture

First, many thanks for the invaluable tuning discussions/resources here and on 2bits. They've been most helpful.

Lately I've been testing a change from:
mpm_prefork
suEXEC
suPHP
zend Optimizer

to the recommended:
mpm_worker
suEXEC
mod_fcgid (2.3.6)
APC (3.1.7)

I mainly followed the excellent instructions and relative values used here: http://2bits.com/articles/apache-fcgid-acceptable-performance-and-better...

I definitely see a speed increase, but I'm having issues with memory management. I wanted to ensure FcgidMaxProcesses was working, and updated to fcgid 2.3.6, and did confirm that with APC disabled the php processes were limited.

I also updated APC to 3.1.7, as there was a bug in 3.1.6 causing Drupal modules to not get cached.

But when I enable APC, the PHP processes begin to grow and keep growing. I assume this is because my ttl is set to not expire and APC will keep the caches forever, thus keeping the PHP process open. But I haven't read confirmation of this anywhere. Is that what is happening, or is it likely a bug in either Fcgid or APC? Is there a way to work around this through better tuning of fcgid/apc?

My server has 30+ drupal installs, so it looks like with suEXEC, APC will need to store a cache for each account. So I am not expecting the memory savings I would running one or two heavily loaded sites. But should I still be able to control the overall memory usage and still benefit from the cache speed? Or is it pointless if there isn't room for storing the cache of every account on the server in RAM? Perhaps APC ttl's would help, or something else? Is there a more recommended setup for servers running many separate (non-multisite) drupal installs?

Strangely, despite running overnight at nearly max memory the server did not thrash - it felt like something was keeping it just within limits.

The other thing I noticed, with FcgidMaxProcesses effectively limiting PHP processes, "read data timeout" errors started showing up in the apache log. So it seems I need to sync the PHP process limit with the Apache server limits? Are there any resources/guides for how to best set and test these values?

Please let me know if more info is needed, or if I'm on a completely wrong track. Sorry for all the questions. Thanks!

Comments

Hi, Thanks for the tip on the

introfini's picture

Hi,

Thanks for the tip on the 3.1.6 bug! I wasn't understanding the low used cache values.

Regarding the growing PHP processes I had the same problem, and because I couldn't find the cause I give up on that type of configuration. I'll try again and see if I can confirm that the culprit is APC. After reading several topics on forums about APC with mod_fcgid I came to the conclusion that it's more trouble than profit.

If you really want to go that way this tutorial is a good one on that topic http://www.brandonturner.net/blog/2009/07/fastcgi_with_php_opcode_cache/

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: