Eclipse or SUNrise...

Eclipse or SUNrise...
...JAVA for sure

Monday, January 24, 2011

Analyzing IBM HTTP Server performance

In order to tune the performance of HTTP server (in this case IBM HTTP Server which basically is an Apache) you have to get some informations about its current configuration, update configuration accordingly to the retrieved data and then again recheck if there is any performance gain (and repeat these steps until you'll get what you wanted).

One of possibilities of capturing data in IHS is using the mod_mpmstatus.so plugin. It is very similar to standard mod_status.so of the Apache but it has not the down side of having to call the /server-status page manually or having some automate which would do it and grab the results. The mod_mpmstatus is just appending the results to standard error_log file. Additionally the format in which it does it is very easly modifiable as I'll further present.

To use this plugin, you will have to download the IBM diagnostic pack - the current version of it is ihsdiag V1.4.14 and you can download it freely from here (there multiple versions for different operating systems):



After unpacking it, you'll find the module file in

ihsdiag-1.4.14/2.0/aix/mod_pmpstatus.so

Copy this file to /{IHS_ROOT}/modules/ directory

Now edit httpd.conf (a good practice is to create a backup of this file after editing it) and add two lines


LoadModule mpmstats_module modules/mod_mpmstats.so
ReportInterval 120


The first one will load the new plugin to the IHS runtime configuration - this also mean that you will have to restart the IHS in order to run the plugin logic. The second line configures the period of reporting - how often (in seconds) it will log the current stats on the server (in error_log only).

After restarting you should see a following:


[Mon Jan 24 10:45:09 2011] [notice] mpmstats: rdy 40 bsy 10 rd 0 wr 7 ka 3 log 0 dns 0 cls 0
[Mon Jan 24 10:47:09 2011] [notice] mpmstats: rdy 47 bsy 3 rd 0 wr 1 ka 2 log 0 dns 0 cls 0
[Mon Jan 24 10:49:09 2011] [notice] mpmstats: rdy 46 bsy 4 rd 0 wr 1 ka 3 log 0 dns 0 cls 0
[Mon Jan 24 10:51:09 2011] [notice] mpmstats: rdy 47 bsy 3 rd 0 wr 1 ka 1 log 0 dns 0 cls 1
[Mon Jan 24 10:53:09 2011] [notice] mpmstats: rdy 47 bsy 3 rd 0 wr 0 ka 3 log 0 dns 0 cls 0
[Mon Jan 24 10:55:09 2011] [notice] mpmstats: rdy 45 bsy 5 rd 0 wr 2 ka 3 log 0 dns 0 cls 0
[Mon Jan 24 10:57:09 2011] [notice] mpmstats: rdy 46 bsy 4 rd 0 wr 0 ka 2 log 0 dns 0 cls 2
[Mon Jan 24 10:59:10 2011] [notice] mpmstats: rdy 47 bsy 3 rd 0 wr 1 ka 2 log 0 dns 0 cls 0


Notice that there is a special tag [notice] for each statistic and it is being logged every 2 minutes. The small lag is because the IHS tries to lunch the plugin when there is possibly low utilization on the server.

Each of the short description next to the number means:


  • rdy (ready) the number of web server threads started and ready to process new client connections


  • bsy (busy) the number of web server threads already processing a client connection


  • rd (reading) the number of busy web server threads currently reading the request from the client


  • wr (writing) the number of busy web server threads that have read the request from the client but are either processing the request (e.g., waiting on a response from WebSphere Application Server) or are writing the response back to the client
    ka (keepalive) the number of busy web server threads that are not processing a request but instead are waiting to see if the client will send another request on the same connection; refer to the KeepAliveTimeout directive to decrease the amount of time that a web server thread remains in this state


  • log (logging) the number of busy web server threads that are writing to the access log


  • dns (dns lookup) the number of busy web server threads that are performing a dns lookup


  • cls (closing) the number of busy web server threads that are waiting for the client to acknowledge that the entire response has been received so that the connection can be closed



Now, to create a more readable graph of what is happening you can simply use grep or any other editor. I will use Open Office Spreadsheet to create a nice chart. Here is a sample of what you can produce:



In next articles I'll cover the other part about analyzing these logs and use them to tune the performance of the server.

No comments: