I am using VPS based hosting for a website and found that default apache2 + prefork + mod_php is too resource intensive for my VPS to achieve acceptable concurrency. (Eating RAM)
So I recently switched to apache2 + mpm_worker + mod_fcgid + php5
Below is my configuration for relevant modules.
<IfModule mpm_worker_module>
StartServers 4
MinSpareThreads 10
MaxSpareThreads 200
ThreadLimit 200
ThreadsPerChild 25
MaxClients 200
MaxRequestsPerChild 1000
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi .php
# Where to look for the php.ini file?
DefaultInitEnv PHPRC "/etc/php5/apache2"
# Maximum requests a process handles before it is terminated
MaxRequestsPerProcess 1000
# Maximum number of PHP processes
MaxProcessCount 10
# Number of seconds of idle time before a process is terminated
IPCCommTimeout 240
IdleTimeout 240
#Or use this if you use the file above
FCGIWrapper /usr/bin/php5-cgi-wrapper .php
</IfModule>
Problem is that while load testing my website, I am not able to saturate my server CPU. Plenty of network bandwidth is also available. Memory utilization is below 20% of my 1GB VPS. But still the load times are increasing.
I don't know what I am doing wrong.