tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Hartung" <>
Subject Re: Performance issue
Date Wed, 13 Oct 2004 00:43:16 GMT
> From: "Faisal Abdullah" <>
> Sent: Tuesday, October 12, 2004 7:26 AM

> > So what's your complaint?  That it's GC'ing too much?
> I don't know if its GCing too much or not. I haven't any idea what the
> GC should be like. But thanks for your comments on that.

Based on the GC log, it's GCing ~1% of the time. In anycase, it's not
causing your timeouts.

> >That it's not
> > handling enough concurrent clients?  Those connection reset messages
> > that were in your log?  Do you have defined performance goals are you
> > simply trying to make it "not sluggish" ?
> >
> Those connection resets - I don' t know if they're normal or not.
> Should I be worried about it?
> I guess I'm trying to find the *reason* why this performance issue exists.
> Once I'm able to identify it, hopefully i'll be able to do something about

The connection resets could simply be from Explorer clients, they do that
all the time. The connection TIMEOUTS are a different animal completely.

You need to get some monitoring on your app. To see if you can narrow down
what's taking so long. It could be all sorts of things.

What's your DB Box look like? Is it taking the load OK?

Simply put, if your CPU's aren't pegged, then Tomcat is Waiting For
Something. Either it's waiting on an I/O resource (DB, disk, network), or it
could be fighting itself with some bad synchronizations within your code,
fighting over a "cache" perhaps. Your GC is not worth considering at the
moment, as it's not what's making a page take 2 minutes to load.

You need to get a test machine, get a load tester and start hammering the
app. Then you need to instrument your code (either manually using logging,
or try a profiler -- none of the profilers are usable on a production
machine in my experience, in fact I've not been happy with any of the
commercial profilers.). Profilers will kill your performance, that's why you
can't use them in production (you think it's slow now -- HA!). You also need
to create reproducable tests to see if you're making progress.

Add a simple filter to the front of your Webapp (if practical) that gives
you URLs and how long the whole request takes to see if some pages are worse
than others (historically). Take your worst offenders and run through their
code and see what they may share with other users on the system. Go through
the primary critical path and check each of those systems that it touches.
You can also take Thread Dumps of the Tomcat JVM to show you where things
may be taking their time.

You have to peel the onion. Find one bottleneck, you'll get a new one, and
on and on and on.

No matter what, don't change anything in your system that "looks slow" or
that you "think is slow", unless you actually KNOW it's slow. Until it shows
up in the Top 5 of your profiling, leave it alone. Spending a day fixing
slow code that runs once on startup doesn't gain you anything.


Will Hartung

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message