Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5982733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:07:45+00:00 2026-05-22T22:07:45+00:00

I have a LAMP server (Quad Core Debian with 4GB RAM, Apache 2.2 and

  • 0

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.

  • 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.
  • We have about 90 clients that are logged into the system at any one time.
  • Roughly 1/3rd of clients would be idle.
  • Of the active clients (roughly 60) they send a request to the API every 3 seconds.
  • Clients switch from active to idle and vice versa every 15 or 20 minutes or so.

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.

So, my three options are:

  1. KeepAlive On and KeepAliveTimeout Default – In this case I guess I will just need to get more RAM.
  2. KeepAlive On and KeepAliveTimeout Low (perhaps 10 seconds?) 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?

  3. KeepAlive Off 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?

Which option is best?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:07:45+00:00Added an answer on May 22, 2026 at 10:07 pm

    Instead of managing the KeepAlive settings, which clearly have no real advantage in your particular situation between the 3 options, you should consider switching the Apache to an event or a thread based MPM where you could easily use KeepAlive On and set the Timeout value high.

    I would go as far as also considering the switch to Apache on Windows. The benefit here is that it’s MPM is completely thread based and takes advantage of Windows preference for threads over processes. You can easily do 512 threads with KeepAlive On and Timeout of 3-10 seconds on 1-2GB of RAM.

    WampDeveloper Pro –
    Xampp –
    WampServer

    Otherwise, your only other options are to switch MPM from Prefork to Worker…
    http://httpd.apache.org/docs/2.2/mod/worker.html

    Or to Event (which also got better with Apache 2.4)…
    http://httpd.apache.org/docs/2.2/mod/event.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a LAMP (PHP) web app which need to interface with programs on
I am setting up a LAMP server and would like to set Apache's umask
I have a LAMP server with 256MB RAM (poor man's server in cloud). I
I have one dedicated server which has the whole Lamp-Stack, SVN and Hudson installed.
I have an Ubuntu Server (with all of LAMP and Subversion installed). I use
I have a standard LAMP server, and currently there is a way to attach/upload
So I have a server set up (LAMP) server, this proxy has access to
I have some basic pageview incrementing code set up on a LAMP server (see
I have a web form on an IIS server (has no PHP). I have
Here's simplified .htaccess file: RewriteEngine On RewriteRule ^index$ index.php On my local lamp server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.