2009/03/03

Apache built-in funtion, server-status

There is mod_status built into Apache web server to get server status from web browser. With this module you can easily find out how well your server is performing.
You can turn in on in httpd.conf file, like below,
<Location /server-status>
    SetHandler server-status
    AuthType Basic
    AuthName "Admin Area"
    AuthUserFile /var/www/passwd/passwords
    Require user admin
    Order deny,allow
    Deny from all
    Allow from 172.16
    Satisfy any
</Location>
All reports are generated in a html format. You can easily find out following type of information:
   1. Total number of worker serving requests
   2. Total number of of idle worker
   3. Find the status of each worker, the number of requests that worker has performed and the total number of bytes served by the worker
   4. Total number byte count served
   5. Other information such as CPU usage, number of requests per second,current hosts and requests being processed etc.
For example, you may see 1&2 like below,
233 requests currently being processed, 13 idle workers
Here, 233 is simultaneously running requests, which cannot access the maximum number you set up. Depend on how busy your server is, you may make this number bigger. The default number is 256.
Usually, you can set this in your http.conf file, like below,
<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      512
MaxClients       512
MaxRequestsPerChild  4000
</IfModule>

No comments:

Post a Comment