Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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

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.

share|improve this question

migrated from Aug 28 '11 at 19:45

This question came from our site for professional and enthusiast programmers.

What's the servers load? What about disk i/o? – hakre Aug 28 '11 at 18:42

I am slowly ramping the number of concurrent requests/connection from 50-200. Thats the load on the server.

I used iotop to measure disk io. there is nothing significant showing up there. 3-5k/sec in the peak process.

Well if its Disk IO, I have very little room to play as its a hosted VPS.

I just tried to load a plain html file cached from the php output to rule out any delays on the php front. The bottleneck is not php. The graph is the same.

It should be a concurrency issue!

share|improve this answer
I forgot to disable access log. Its working better now and is hitting memory bottle neck. thanks all. – Praveen Aug 28 '11 at 23:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.