Limit number of php5-cgi processes run on low mem VPS?

Hello folks! I’ve almost got my first Virtualmin/Centos 6.2 768MB RAM VPS rig up and running, but there is one thing still bothering me.

In short, is it normal for FCGID to run 12+ php5-cgi processes if I hammer the server with an ab like this:

ab -n 1000 -c 100 myserver.com/

Unless I’m missing something, I thought FCGID was supposed to keep the process count low.

I have heard about the “PHP_FCGI_CHILDREN” option, but from what I understood, it’s recommended that we don’t set it.

My FCGI wrapper script is the default:

#!/bin/bash
PHPRC=$PWD/…/etc/php5
export PHPRC
umask 022
export PHP_FCGI_CHILDREN #<—Should this be set to something???
PHP_FCGI_MAX_REQUESTS=99999
export PHP_FCGI_MAX_REQUESTS
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php-cgi

Try adding: DefaultMaxClassProcessCount # (the number of processes you would like) to /usr/local/apache/conf/php.conf and restart apache.


www.ryanelders.com

Yup that did it! Thanks very much ryan!