-2

how can I optimize the server with following configuration. It takes too much time to load a page.

IBM X3200 M3 Server - 1 Intel Xeon Processor with 4 GB Ram

Below is my current configuration for apache:

Start Servers: 5  (Default)
Minimum Spare Servers: 10
Maximum Spare Servers: 20
Server Limit: 500
Max Clients: 500
Max Requests Per Child: 10000 (Default)
Keep-Alive: On
Keep-Alive Timeout: 5
Max Keep-Alive Requests: 100
Timeout: 200
Antoine Benkemoun
  • 7,314
  • 3
  • 42
  • 60
Prakash
  • 193
  • 1
  • 11
  • under what kind of load? If it takes too long to load a page and no one's accessing your site, it's possible a coding issue. – Derek Downey Jun 23 '11 at 14:03
  • "too much time to load a page" -- well, who says Apache is the bottle neck? You will need to do some basic profiling, looking for where the slowdown is -- is it in transferring many HTTP objects across the Internet, or in your webapp (PHP?) execution speed, or in talking to your (MySQL?) database? –  Jun 23 '11 at 14:23

2 Answers2

2
  1. Read some good books on the subject.
  2. Reconfigure your webserver to capture meaningful metrics.

time to load a page

(Now it really starts to complicated)

  1. instrument your html with appropriate tools for capturing client-side page responses (e.g. Boomerang or Episodes)
  2. collect data
  3. Analyse data
  4. Apply changes to code / configuration
  5. repeat steps 4-7 until performance optimal bearing in mind risk of local minima
  6. repeat steps 1-8 until performance optimal bearing in mind risk of local minima

If you want a more specific suggestion then we'd need to know an awful lot more about what's going on.

BTW its very likely that a keepalive timeout of 5 seconds is not appropriate.

symcbean
  • 21,009
  • 1
  • 31
  • 52
0

Some general tuning tips (looks like prefork):

  • reduce keep-alive to 2, keep it short, 5 is too long
  • if you're having a lot of load, start the servers with more (start servers) and keep more active: (maximium spare servers)
  • You could be swapping if you have a heavy load (apache trying to process too many requests than it has memory for). Get a general feel for how much memory your http processes use and reduce your max clients accordingly. Aka if your http processes average 30MB per process, on a 4GB machine assuming it's dedicated webserver (no ftp, mysql, etc) and you can allocate 3GB to it, you don't want to allow more than 100 clients.
Derek Downey
  • 3,955
  • 4
  • 27
  • 29