Marc
Marc

Reputation: 7022

How to get end to end performance analysis tomcat

I have a web app that performs great and then suddenly a page request will freeze up and time out and then everything will be dandy again for a little bit and the same thing happens.

I'm having hard time getting to the bottom of this because there are so many variables that can be analyzed.

Is there any way: a tool or step plan that can help me get to the bottom of this and basically analyze this whole thing from page request to database call and identify the potential problems? I use New Relic and MAT and I just started using Javamelody but to be honest: where to focus? And usually when a page freezes / times out it's not clear where the bottleneck was. What are thresholds / red flags to look out for?

Kind regards, Marc

Upvotes: 0

Views: 1010

Answers (2)

Marc
Marc

Reputation: 7022

Based on the tips here and elsewhere I found a few things that seems to have affected things although we'll have to see how it works out in the long term. Now, it seems to be better although it's hard to point my finger to exactly what made the biggest difference. Things I did: * Made Spring datasource lazy so that requests that can be served from the cache don't create a needless transaction * Changed mySQL thread_cache_size to 50. It was 8 before. * Changed from c3p0 to BoneCP

For now, it looks like the intermittent pauses don't occur anymore.

Upvotes: 0

mprivat
mprivat

Reputation: 21902

For the server side, I found that jstack is usually a much better tool than profilers. Mostly because it's quick, command line and already installed with your server's JDK.

A typical cause for an intermittent web app slow down is a thread waiting on some lock to release.

Run jstack when the web app appears stuck and look through the threads to see which ones are stuck on a lock and what the lock is. Here's a quick tutorial because it can sound daunting at first but it's really simple.

Upvotes: 1

Related Questions