Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was hoping to get some expert advice on the best settings for apache.

Currently our site operates the following way.

  1. User Request the page with low resolution images.
  2. The page loads quickly and then javascript will lazy load.
  3. Ajax is called to perform different functions.

Some pages might have 30 requests for that user.

The servers being used are

  1. Dual Quad core Xeon Proc
  2. 8gb ram
  3. SSD HD
  4. Mysql is used.
  5. Redhat

Current apache settings are

KeepAlive on
MaxKeepAliveRequests 100
KeepAliveTimeout 15


<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit  256
MaxClients   256
MaxRequestsPerChild  4000
</IfModule>

<IfModule worker.c>
StartServers         4
MaxClients         300
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

I am thinking keepalive should be on, but the timeout should be set to 1 second. Any thoughts would be much appreciated.

#
httpd -V
Server version: Apache/2.2.15 (Unix)
Server built:   Feb  7 2012 09:50:11
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Test, test, test and test.

Grab some decent load generators (no, ab is not suited) like siege, jperf, flood or tsung, establish a baseline, then start loading with different combinations of requests and busyness.

It is also evident that you have no clue how apache is currently configured, since only one MPM is used at any time; pre-2.4, this is actually compiled-in and cannot be changed after installation.

So first of all, figure out what the current config actually is; update your post with the results of httpd -V and we can provide further help.

share|improve this answer
    
Hi I have updated my post with the httpd -V. If I understood you correctly. Apache only uses one of those settings blocks I posted. Since the httpd -V revealed "Prefork". That means the settings are used in the Prefork section? –  RichardW11 Apr 24 '12 at 13:04
    
Also on a test server env I ran siege, and found that KeepAlive On, MaxKeepAliveRequests 500, KeepAliveTimeOut 1 worked pretty well. Also used StartServer 250, ServerLimit 600, and MaxClients 500. However, even though these settings showed results. I wasn't comfortable with them. –  RichardW11 Apr 24 '12 at 13:07
    
Prefork is horribly ill-equipped to deal with large numbers of concurrent requests; only if you don't run scripting failware such as PHP can you even START 500 servers on a mere 8GB. –  adaptr Apr 24 '12 at 13:17
    
I agree... When you say Prefork is ill. Should I have this on another setting? The site is PHP. Thanks for your help. –  RichardW11 Apr 24 '12 at 13:20
    
so would you suggest I touch the servers, etc section? or do you think I should just put keepalive on, keepalivetimeout 1, keepalive max request at 200? –  RichardW11 Apr 24 '12 at 14:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.