My web application architecture is: Apache 2 (as load balancer) + JBoss 3.2.3 + MySQL 5..19.

I wish to: appraise the request processing time (for each individual request) allocated to the JBoss server only (i.e., excluding time allocated to Web and database servers.

I have been researching concerning how to log request processing time with an application tier only. I discovered *mod_JK logging*, *Apache's mod_log_config* and Tomcat AccessLogValve as two possible techniques.

Using *mod_JK logging*: my understand mod_jk logging provides request processing time for every request and calculate as time distinction between time whenever a request leaves the Apache server and time once the corresponding response received through the Apache server. Please correct me if the not accurate/correct.

Using Apache's mod_log_config model ( with the addition of "%n" within the LogFormat (the JKLogFile construct) construct (begin to see the above link). The "JK_REQUEST_DURATION" capture overall Tomcat processing time from Apache perspective.

The occasions (within the above cases) includes Tomcat/JBoss + MySQL processing time. It will not assist in my situation because it includes MySQL processing time- I wish to record request processing time on JBoss only. Any suggestions/ideas are appreciated?

Using AccessLogValve: it may log "time come to process request, in millis" by setting %D within the pattern attribute from the AccessLogValve XML construct. It's not so obvious if the

  • Time if this time around it's time needed by tomcat/JBoss for everyone a request (e.g., allocate thread worker to deal with it)
  • Time come to process a request and send it towards the database server (overall time on Tomcat/JBoss server)
  • Time come to process a request by Tomcat/JBoss and send an answer to an internet server/client

Any idea/clue?

This really is my experience/research I wish to share. It might be appreciated if anybody has similar problem/know a method to get it done to talk about their experience/pointers/ideas in which a better solution are available.

searching forward for the ideas/suggestions

Why would you like to exclude the database time? Time allocated to the database 's time the application delays, exactly as it may be awaiting other assets e.g lucene indexing to complete, an online http request to accomplish etc.

If you want to exclude the db access time you have to instrument the application with timer start/stop instructions. This can definitelly will need to go within your application (either "cleanly" via AOP or by hand via start/stop claims in critical points within the application) and can't just be a configuration in the outdoors world (e.g an apache module).

So, you will need to start the timer whenever you receive your request within the very start of processing chain (a filter is effective here) and prevent any time you send a question. Then begin anew exactly following the query. This obviously can't be 100% complete mainly in the situation you utilize a transparent ORM for example hibernate. Like sometimes you may be performing queries not directly, i.e when crossing an assortment or perhaps an association via plain Java.