<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>Az's Link Spam   </title>
    <link>http://www.underhanded.org/blog</link>
    <description>I'm Bored</description>
    <language>en</language>

  <item>
    <title>Apache Memory Usage</title>
    <link>http://www.underhanded.org/blog/2008/07/18#apachemem</link>
    <description>
After a day of trying to figure out why one of my web servers was locking up, I found that it was using a bit too much memory.  But I had no idea how much, and Linux memory reporting is a bit arcane at best.  Especially with something like apache + PHP using shared memory pools.  So after some analysis, I came up with the following script:
&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;/apachemem.pl.txt&quot;&gt;apachemem.pl&lt;/a&gt;
&lt;br&gt;&lt;br&gt;
It had the following output:
&lt;br&gt;&lt;br&gt;
&lt;pre&gt;
Total memory available: 3.21G
Total used by apache2 (451 instances): 3.80G
Total used by other processes: 0.12G

Average memory used per apache2 process: 8.63M
Recommended number of processes based on Average: 381
Needed memory for 500 processes based on Average: 4.21G

Max memory used for apache2 process: 17.61M
Recommended number of processes based on Max: 186
Needed memory for 500 processes based on Max: 8.60G

Mean plus two Standard Deviations (bulk of usage under max): 11.28M
Recommended number of processes based on Mean + 2*Stdev: 291
Needed memory for 500 processes based on Mean + 2*Stdev: 5.51G
&lt;/pre&gt;

At the time I ran it, I had 450 instances out of a configured max of 700 active.  Come to find out I only had the ram to support about 380 of those at best. :(
&lt;br&gt;&lt;br&gt;
Hopefully some other people find this useful, as it's pretty hard to get a straight answer on &quot;How many processes can I support?&quot;  Now if only php and the standard modules
would officially work with the worker MPM.</description>
  </item>
  <item>
    <title>Apache Keepalive</title>
    <link>http://www.underhanded.org/blog/2008/04/30#keepalive</link>
    <description>
So, for the web servers at work, we had disabled Apache's &lt;a href=&quot;http://www.underhanded.org/blog?redirectURL=http%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.2%2Fmod%2Fcore.html%23keepalive&quot; onMouseOver=&quot;window.status='http://httpd.apache.org/docs/2.2/mod/core.html#keepalive'; return true;&quot; onMouseOut=&quot;window.status=''; return true;&quot; target=&quot;_BLANK&quot;&gt;KeepAlive&lt;/a&gt; settings due to possible denial of service.  As part of some performance tuning I had turned it back on with a low timeout (4 seconds) to see how it held up.  Here's the results:
&lt;br&gt;&lt;br&gt;
&lt;center&gt;&lt;img src=&quot;/pics/concurrent.png&quot; alt=&quot;Concurrent Connections&quot; /&gt;&lt;/center&gt;
&lt;br&gt;&lt;br&gt;
The drop on the right is where KeepAlive was turned on.  We did need to increase our MaxServers a bit for when load got high, but overall it's resulted in a huge speedup for the servers and less thrashing in general.</description>
  </item>
  </channel>
</rss>