3

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.

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

1 Answer 1

1

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!

1
  • I forgot to disable access log. Its working better now and is hitting memory bottle neck. thanks all.
    – Praveen
    Aug 28, 2011 at 23:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .