Apache Tuning Part 2

December 30th, 2008 Category: Apache

Let’s assume your web server has high disc IO. Every access to a .PHP, .HTML, .JPG, .GIF, etc wil cause a log entry which will be stored on hard disc. In such a case it helps to disable all apache loggings.

You can check the opened log file from apache using the command:

lsof |grep apache|grep log

Oh yes, if you serve lot’s of domains on your server this list will be quite long. To disable logging just uncomment the corresponding lines e.g. in your virtual host definition:

#ErrorLog /var/log/apachd2/mydonain.de-error_log

#CustomLog /var/log/apache2/mydomain.de-access_log combined

Afterwards check your apace configuration for errors:

apache2ctl -t

In case of syntax OK just restart your apache server:

apache2ctl -k graceful

This command is qute because it does a “graceful” restart without anoying users accesing your server right now.

Hint

How to check if my disc IO is high?

Use the command “vmstat 1″ and check the section “IO” (what else…). You will see bi and bo which means blocks received and blocks sent. In case the numbers are high, you will have high disc IO.

procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
0  0 659476  41604   8732 347304    3    3    37    41   20   14 19  7 58 16
3  0 659476  41604   8732 347336    0    0     0     0  410  314  7  0 93  0
0  0 659476  41464   8740 347328    0    0     0   424  522  321 11  1 86  2
Share and Enjoy:
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Webnews
  • MisterWong
  • Y!GG
  • Facebook
  • Furl
  • Google Bookmarks
  • Live-MSN
  • Readster
  • YahooMyWeb

Related posts:

  1. Apache Tuning Part 1
  2. Apache Tuning Part 3
  3. Howto Restart Apache Graceful
  4. Happy Birthday Apache!
  5. Windows 7 Performance Tuning
This entry was posted on Tuesday, December 30th, 2008 and is filed under Apache. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply