User login

Bringing a stressed Drupal site back to its feet

Before and after restart:

0 stedile:~# free
total used free shared buffers cached
Mem: 1343636 1309280 34356 0 1856 29692
-/+ buffers/cache: 1277732 65904
Swap: 524280 513244 11036
0 stedile:~# free
total used free shared buffers cached
Mem: 1343636 164676 1178960 0 7264 98000
-/+ buffers/cache: 59412 1284224
Swap: 524280 3992 520288

Then after some operation:

total used free shared buffers cached

Mem: 1343636 622464 721172 0 4372 83516
-/+ buffers/cache: 534576 809060
Swap: 524280 11412 512868

Everything explained?
http://2bits.com/articles/tuning-the-apache-maxclients-parameter.html

As originally pointed to by dkg of OpenFlows, helping on the May First People Link issue queue:

you've got your MaxClients set too high: the same number of concurrent requests could bring stedile to its knees again if the timing is wrong. Better to have apache refuse connections if new ones could cause a failure of the server as a whole than try to service them and bring everything else down.

ps -eFH (thanks dkg!) gives the Apache process sizes, and 15000 is a reasonable average.

So 622,000 / 15,000 = 41.466666666666667

So 40 to 42 Apache process is what I should set MaxClients to.

Now, where is MaxClients?

0 stedile:~# locate httpd.conf
/etc/apache2/httpd.conf
/usr/share/doc/apache2.2-common/examples/apache2/original/httpd.conf.gz

0 stedile:~# vi /etc/apache2/httpd.conf
my apache httpd.conf file is blank

Apache2 doesn't use it anymore, in favor of mod-enabled and sites-anabled and apache2.conf

0 stedile:~# vi /etc/apache2/apache2.conf

Made the changes below, and then did:

0 stedile:~# apache2ctl restart

So what are those important changes?

# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

became

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients           40
    MaxRequestsPerChild   0
</IfModule>

Resolution

Searched words: 
WSF2008 on life support editing httpd.conf recommended httpd.conf file for Drupal performance

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.