0

My client sends out eblasts at 8am monday/wed/friday. Between 8:15-8:45 the site becomes extremely slow and many users sessions timeout.

My setup: Mediatemple VE 2gb dedicated ram (3 burst) Ubuntu 9.10 Apache2-mpm-worker PHP5.3-fcgi MySQL 5

I recently tried to remedy the problem by switching from apache2-mpm-prefork to mpm-worker, but am still having the same issues.

My apache settings are:

Timeout 100
KeepAlive On
MaxKeepAliveRequests 100
<IfModule mpm_worker_module>
    StartServers         12
    MinSpareThreads      25
    MaxSpareThreads      96
    ThreadLimit          96
    ThreadsPerChild      25
    MaxClients          225
    MaxRequestsPerChild   0
</IfModule>

The site is only getting ~10,000 page views during the 8am-9am hour, which I dont think should be stressing the server too badly. Maybe it is an error with the PHP settings, or bandwidth per unit time, or the site outgrew the server?

Any suggestions would be very helpful - as you can see i've given it a good go before looking for help (installed mpm-worker).

Also, can anyone suggest to me some free load testing software, or a tutorial on mod_status?

Thank you

Shauno
  • 165
  • 2
  • 6

1 Answers1

0

It very much depends on the application as well as the traffic / usage patterns. I'd recommend logging onto the server at the time ( if at all possible ) to collect some vital statistics :

  • Amount of Apache processes running
  • Average memory used per Apache process
  • Total memory used by applications / non-cached.
  • CPU usage / load averages
  • Amount of open files on disk
  • Amount of (insert database here) connections open.

And then I'd also have a look through the logs to see if there are any error messages being displayed.

Depending on how your services are configured it could be just about anything ranging from memory exhaustion, to cpu overload, to mysql connection pool exceeded, to apache connection pool exceeded.

You could also use such tools as iotop, mytop, top, and ntop to see in realtime what's going on or you could use apache's 'ab' to do some minor load testing. Ultimately though I think you might need something more intelligent and programmable to more closely replicate your client's usage patterns. Doesn't have to be fancy really, a few shell+curl scripts to access various parts of your site.

jonathanserafini
  • 1,768
  • 14
  • 20
  • I took your advise and installed mod_status, mytop, and have done some testing with AB. I have found that the site maxes out the 3gb of available memory with ~300 concurrent connections... and that the majority of the ram is being used by php5-cgi. This makes me think that the fcgi-wrapper may not be working? but the phpinfo says it is running on FCGI. I followed this setup detailed here: http://ivan.gudangbaca.com/installing_apache2_and_php5_using_mod_fcgid I have read some other posts about setting PHP_FCGI_CHILDREN, but I can not find a php5.fcgi file to configure. – Shauno Jul 09 '10 at 09:17
  • Also - i have no directories php5-fcgi, and do not see any reference to fcgi aside from the apache mod. – Shauno Jul 09 '10 at 09:19