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.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
Praveen
  • 191
  • 1
  • 5

1 Answers1

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!

Praveen
  • 11
  • 2
  • 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