IBM Support

IBM HTTP Server performance measurements

Question & Answer


Question

How do you measure the response time it takes for the IBM HTTP Server to handle a request?

Answer

Response times can be logged, in microseconds or seconds, in the access log file identified by either the TransferLog or CustomLog directives defined in the IBM HTTP Server's httpd.conf file as long as the LogFormat directive is modified to include either the %D or %T format parameters. In addition to these two parameters, the LogFormat should be updated with a constant string (e.g. TIME:) that can be used to easily identify the response times in the access log. The %D parameter will report the time taken to serve the request, in microseconds, while the %T will report the time taken to serve the request in seconds.

The following example shows how to modify the default common LogFormat found in the httpd.conf file to report the time in microseconds.

Original definition:

LogFormat "%h %l %u %t \"%r\" %>s %b" common


CustomLog logs/access.log common

Which will produce output similar to the following:

127.0.0.1 - - [04/Nov/2011:21:06:05 -0400] "GET / HTTP/1.1" 200 3325


Change to:

LogFormat "%h %l %u %t TIME: %D \"%r\" %>s %b" common


CustomLog logs/access.log common

Example output found in the access.log will look like the following:

127.0.0.1 - - [04/Nov/2011:21:06:05 -0400] "GET / HTTP/1.1" 200 TIME: 904731 3325

The text in bold shows the response time in microseconds.

With this information, you can now parse the access log looking for requests that meet specific response time criteria. For example, you can use the Microsoft Windows FindStr command to parse the access log looking for response times that are greater than 1 second by using the following command in a DOS command window:

findstr /R /C:"TIME: [0-9][0-9][0-9][0-9][0-9][0-9][0-9]" access.log

Note: The parameters passed on the FindStr command includes regular expressions searching for 7 digits following the string "TIME: ". If the response time in microseconds contains 7 or more digits, then it's greater than or equal to 1 second. If you want to locate just entries that are greater than 10 seconds, you could add another regular expression [0-9] to the constant string.

Related Information

[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTJ","label":"IBM HTTP Server"},"ARM Category":[{"code":"a8m50000000CdCpAAK","label":"IBM HTTP Server\/WebSphere Plugin-All Platforms-\u003EIHS-\u003EIHS.Logs\/Rotatelogs"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5.0;9.0.0;9.0.5"}]

Document Information

Modified date:
31 July 2024

UID

swg21570830