users@jersey.java.net

Re: [Jersey] Monitor Jersey

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 13 Oct 2009 13:05:39 +0200

Hi Ido,

Something like DTrace with its Java integration might be a good
solution for resolving a system-based performance issue like this. But
it will require at least Java 6 (and i think for the best integration
it may require Java 7).

So BTrace might be the thing to use:

   http://kenai.com/projects/btrace

Perhaps one simple thing you could try is to ascertain whether the
pauses correspond with garbage collection work, although 13 to 50
seconds seems way too long for GC work which makes me think it could
be an issue at a lower-level networking layer.

Jersey has basic request/response logging, see:

   https://jersey.dev.java.net/nonav/apidocs/1.1.2-ea/jersey/com/sun/jersey/api/container/filter/LoggingFilter.html

So you could at least determine if the pause is in-between the request
and response, or before the response gets to Jersey etc.

Note that GF v3 will start to have more sophisticated monitoring
features where i hope we make things much easier to determine the
source of such problems. Currently we have limited probes in place for
Jersey but we hope to expand that is we understand better how to
provide probes.

Paul.


On Oct 13, 2009, at 10:31 AM, Ido Ran wrote:

> Hi,
> I have a Jersey RESTful web service which use EJB backend to access
> a database.
> Some GET operation take very long time, 13-50 seconds while most of
> the GET complete in less than 200 milliseconds.
> I'm trying to put my finger on the problem but without success.
>
> How can I monitor each step of the RESTful web service and also
> maybe you can help me how to monitor the calls into the EJB module
> as well?
>
> Thank you,
> Ido.