Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

| Views: 1221
Recently I was asked to investigate how long our web service requests were taking to process at the level of the application server. We had logging inside the web services for total elapsed time serving a request, but we wanted to see if there was any overhead within the app server. Our app server is 10gAS with Apache 1.3 as the web tier.

When I first started looking into this, I thought the task will be quite straight forward and all I would have to do was edit the httpd.conf file CustomLog line for the common log, which is used for access logging. I was wrong on this one. After editing this file and restarting, the access log output didn't change.

The thing that I forgot to take into account was that all our services run over SSL, which meant that the access log configuration in httpd.conf is not used! So with this in mind, I opened up the ssl.conf file and found my VirtualHost configuration.

The config file is in: $ORACLE_HOME/Apache/Apache/conf/ssl.conf

In the "General setup for the virtual host", I found a TransferLog line, which I changed to the LogFormat and CustomLog lines instead as per below. The %D parameter logs the time to serve the request.
 $ Apache/conf/ssl.conf
<VirtualHost _default_:9999>
...
#TransferLog "|/u01/product/10.1.3.1/OracleAS_1/Apache/Apache/bin/rotatelogs /u01/product/10.1.3.1/OracleAS_1/Apache/Apache/logs/access_log 43200"
LogFormat "%h %l %u %t "%r" %>s %b Bytes: %B Time: %D" common
CustomLog "|/u01/product/10.1.3.1/OracleAS_1/Apache/Apache/bin/rotatelogs /u01/product/10.1.3.1/OracleAS_1/Apache/Apache/logs/access_log 43200" common
...
</VirtualHost>


After a restart, the access log started showing me the request times as expected.

The only catch here is that the request times are in whole seconds, there is no sub-second precision. Apache 2.x has an option to output the microseconds elapsed, sadly this was not available in 1.3.



-i

Have comments or feedback on what I wrote? Please share them below! Found this useful? Consider sending me a small tip.
comments powered by Disqus
Other posts you may like...