Note that there are some explanatory texts on larger screens.

plurals
  1. POApache KeepAlive on API Server
    text
    copied!<p>I have a LAMP server (Quad Core Debian with 4GB RAM, Apache 2.2 and PHP 5.3) with Rackspace which is used as an API Server. I would like to know what is the best KeepAlive option for Apache given our setup.</p> <ul> <li>The API server hosts a single PHP file which responds with plain JSON. This is a fairly hefty file which performs some MySql reads/writes and quite a few Memcache lookups. </li> <li>We have about 90 clients that are logged into the system at any one time. </li> <li>Roughly 1/3rd of clients would be idle.</li> <li>Of the active clients (roughly 60) they send a request to the API every 3 seconds. </li> <li>Clients switch from active to idle and vice versa every 15 or 20 minutes or so.</li> </ul> <p>With KeepAlive On, the server goes nuts and memory peaks at close to 4GB (swap is engaged etc). With KeepAlive Off, the memory sits at 3GB however I notice that Apache is constantly killing and creating new processes to handle each connection. </p> <p>So, my three options are:</p> <ol> <li><strong>KeepAlive On and KeepAliveTimeout Default</strong> - In this case I guess I will just need to get more RAM.</li> <li><p><strong>KeepAlive On and KeepAliveTimeout Low (perhaps 10 seconds?)</strong> If KeepAliveTimeout is set at 10 seconds, will a client maintain a constant connection to that one process by accessing the resource at regular 3 second intervals? When that client becomes idle for longer than 10 seconds will the process then be killed? If so I guess option 2 looks like the best one to go for?</p></li> <li><p><strong>KeepAlive Off</strong> This is clearly best for RAM, but will it have an impact on the response times due to the work involved in setting up a new process for each request?</p></li> </ol> <p>Which option is best?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload