All entries for Monday 26 September 2005

September 26, 2005

Logging request durations in jboss/tomcat

Step 1: Find the tomcat config file. For tomcat 4 this is in


for tomcat 5 it's


Step 2: change this

<Valve className="org.apache.catalina.valves.AccessLogValve"
                        prefix="localhost_access" suffix=".log"

to this

<Valve className="org.apache.catalina.valves.AccessLogValve"
                        prefix="localhost_access" suffix=".log"
                        pattern='%h %l %u %t %D "%r" %s %b"' directory="${jboss.server.home.dir}/log"/>

n.b. in jboss 3.2.7 you'll need to uncomment the valve as it's disabled by default.

Easy. A few lines of {insert scripting langauge of choice} can then give you a 'maximum resource consumer' type report.


So, first day of term. I won't be getting too much coding done today. Instead, I'll be spending the day with one eye stuck to the green-screen (our application performance monitor) and the other on ganglia (the server monitor), to see how the uni web server stands up to the first day of term. This is the first time we've served the home pages from Sitebuilder, so there's a lot of extra load compared to previous years.
So far, not too bad. request times are a bit slower than usual for logged in users, but we're handling about 1200 page impressions (about 3500 hits ) per minute at the moment, and it seems to be OK.
By about wednesday, if past experience is anything to go by, I'll have regained my faith in the server enough to concentrate on other stuff for more than 15 minutes at a time (assuming it doesn't break in the meantime) …

Most recent entries


Search this blog

on twitter...


    Not signed in
    Sign in

    Powered by BlogBuilder
    © MMXXI