• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Performance Analysis/Tuning  RSS feed

 
Ryan Lowe
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for perfomance analysis tools (preferably free) for servlets running on Tomcat. Anybody know of any good resources out there?
onlyOOD
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the performance forum.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right now I am working on a specialized load tester for certain servlet applications. I found the HttpClient library at the Jakarta Apache Commons project. to be helpful in simulating client requests but it still takes a bit of work to do what I need.
There is also
the HttpUnit library for unit-testing of server applications.
To start with I resorted to System.currentTimeMillis() to get the time for creation of a page from inside the doPost method. Unfortunately the system time resolution is pretty rough so I get alot of nominal 0 times. I wrote a really simple histogram style data collector for those times.
Bill
 
Ryan Lowe
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I would ultimately like to do is run my servlets with the -verbosegc option to see what's going on with the Garbage collector, but I am not sure if I can do that with Tomcat. I also usually test with -Xrunhprof, but again... Tomcat.
Are there any similar switches that I can put on servlets for similar information?
onlyOOD
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<<To start with I resorted to System.currentTimeMillis() to get the time for creation of a page from inside the doPost method. Unfortunately the system time resolution is pretty rough so I get alot of nominal 0 times. I wrote a really simple histogram style data collector for those times.>>
Check out JAMon at http://www.jamonapi.com for something similar, but it also keeps track of average time, min time, max time, hit count, first accessed time, last accessed time, and currently executing requests, average executing requests and max executing requests. It also correlates load to performance allowing you to see how your code scales. It comes with a sortable html report that displays the data. All this and more is dicussed at the web site. You can download the 90k jar from this site too.
JAMon can be used to measure performance of servlets, ejb's and other java code such as JDBC calls.
I've found that on a computer that has a 10 ms. timer over time the average time comes out to be about the right number, but one individual time won't.
For example say we measure some event that takes about 2 ms. 10 times then we may get individual measurements such as 10,0,0,0,0,0,0,10,0,0 which averages to 2 ms.
JAMon has been mentioned in 2 different O'Reilly java books including "J2EE Best practices"
steve - http://www.jamonapi.com
 
Ryan Lowe
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve,
Thanks a ton for the tip. That tool has helped me increase performance by almost 1000%.
onlyOOD
 
Scott Farquhar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may also be interested in a profiling tool that I wrote a while ago.
Whilst not as many longer-term reporting options as JAMon, it has some other interesting parts that may interest you.
http://opensource.atlassian.com/profiling/example.html
I had no idea about JAMon until just then. I'll have to investigate whether I can get them to interoperate.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!