You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Mariano Ortega <mg...@gmail.com> on 2010/08/09 15:47:21 UTC
Slow response time only on the first request
Hi,
I'm working on a project where we have decided to start given access to our
core functionality thru Web Services. After some research we choosen Apache
CXF.
During my analysis, everything works fine. I was deploying the test services
on a Jetty without Spring Support (CXFNonSpringServlet).
Now, the problem arouse when I deployed the same code on a Weblogic server.
The issue is that the FIRST coming request takes lot of time (~7 seconds)
and the subsequent ones take times <70 msec.
I was some kinda confused about this behaviour, it would make sense a small
increase in the first request 4 times at most but not some kinda this
magnitude (100 times).
I've changed the log level to FINEST and I'm seeing that this is happening
the First time the Interceptor Chain is called (invoke to handleMessage on
each input and output interceptors) -- see lines 892 to 1069 of the attached
zipped log file. When the next request is served -- see lines 1121 to 1274
-- this work pretty smooth.
Just in case, reducing the log level does not make things better (first
request takes 6,5 seconds and next ones 30 msec)
Do you have any ideas of what could be happening and how can I fix it?
Thanks in advance,
Mariano Ortega
RE: Slow response time only on the first request
Posted by "KARR, DAVID (ATTSI)" <dk...@att.com>.
> -----Original Message-----
> From: Mariano Ortega [mailto:mgo1977@gmail.com]
> Sent: Friday, August 13, 2010 9:37 PM
> To: users@cxf.apache.org
> Subject: Re: Slow response time only on the first request
>
> I posted this issue 5 days ago and did not receive any comments so
> far...
>
> Did anyone face this issue?
>
> Any idea/suggestion about it?
>
> regards,
> Mariano
I expect this is normal behavior. The first run of any test case will
have to load classes, which is relatively expensive. A real performance
measurement test will run the CUT first to make sure all the associated
classes are loaded.
> On Mon, Aug 9, 2010 at 10:47, Mariano Ortega <mg...@gmail.com>
wrote:
>
> > Hi,
> >
> > I'm working on a project where we have decided to start given access
> to our
> > core functionality thru Web Services. After some research we choosen
> Apache
> > CXF.
> > During my analysis, everything works fine. I was deploying the test
> > services on a Jetty without Spring Support (CXFNonSpringServlet).
> >
> > Now, the problem arouse when I deployed the same code on a Weblogic
> server.
> > The issue is that the FIRST coming request takes lot of time (~7
> seconds)
> > and the subsequent ones take times <70 msec.
> >
> > I was some kinda confused about this behaviour, it would make sense
a
> small
> > increase in the first request 4 times at most but not some kinda
this
> > magnitude (100 times).
> >
> > I've changed the log level to FINEST and I'm seeing that this is
> happening
> > the First time the Interceptor Chain is called (invoke to
> handleMessage on
> > each input and output interceptors) -- see lines 892 to 1069 of the
> attached
> > zipped log file. When the next request is served -- see lines 1121
to
> 1274
> > -- this work pretty smooth.
> >
> > Just in case, reducing the log level does not make things better
> (first
> > request takes 6,5 seconds and next ones 30 msec)
> >
> > Do you have any ideas of what could be happening and how can I fix
> it?
> >
> > Thanks in advance,
> > Mariano Ortega
> >
Re: Slow response time only on the first request
Posted by Mariano Ortega <mg...@gmail.com>.
I posted this issue 5 days ago and did not receive any comments so far...
Did anyone face this issue?
Any idea/suggestion about it?
regards,
Mariano
On Mon, Aug 9, 2010 at 10:47, Mariano Ortega <mg...@gmail.com> wrote:
> Hi,
>
> I'm working on a project where we have decided to start given access to our
> core functionality thru Web Services. After some research we choosen Apache
> CXF.
> During my analysis, everything works fine. I was deploying the test
> services on a Jetty without Spring Support (CXFNonSpringServlet).
>
> Now, the problem arouse when I deployed the same code on a Weblogic server.
> The issue is that the FIRST coming request takes lot of time (~7 seconds)
> and the subsequent ones take times <70 msec.
>
> I was some kinda confused about this behaviour, it would make sense a small
> increase in the first request 4 times at most but not some kinda this
> magnitude (100 times).
>
> I've changed the log level to FINEST and I'm seeing that this is happening
> the First time the Interceptor Chain is called (invoke to handleMessage on
> each input and output interceptors) -- see lines 892 to 1069 of the attached
> zipped log file. When the next request is served -- see lines 1121 to 1274
> -- this work pretty smooth.
>
> Just in case, reducing the log level does not make things better (first
> request takes 6,5 seconds and next ones 30 msec)
>
> Do you have any ideas of what could be happening and how can I fix it?
>
> Thanks in advance,
> Mariano Ortega
>
Re: Slow response time only on the first request
Posted by Gagan <ga...@gmail.com>.
Is there a way to initialize them at application start up?
--
View this message in context: http://cxf.547215.n5.nabble.com/Slow-response-time-only-on-the-first-request-tp2268844p4265040.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Slow response time only on the first request
Posted by Daniel Kulp <dk...@apache.org>.
As David said, I expect this is "normal". Along with general classloading
slowdowns (and the class validation/verification that entails) that he
mentioned, there are a bunch of other things that would be part of this:
1) Phase chain - CXF calculates the chain on the first request and caches it.
On subsequent requests, if nothing has changed (no-one added an interceptor
programatically anywhere), it just clones it.
2) Wrapper helpers and such - the first time a wrapper object is used, we use
some reflection and ASM and such to create a helper object for dealing with
the wrapper object. Those are cached for later.
3) Likewise, JAXB does a BUNCH of things to inject special setter/getter
methods and such into the classes it hits to speed up it's operations.
4) JIT - this is also a big one. As things go along, things may hit a
threshold where the JIT will start compiling things. In the first request,
nothing (or very little) may hit that threshold but in subsequent requests, it
might. For example, a call to "getElementName()" on the XMLStreamReader
classes may not hit the magic in the first (or even second) request and then
get sped up later.
There's definitely a lot of other things like that that go on.
Dan
On Monday 09 August 2010 9:47:21 am Mariano Ortega wrote:
> Hi,
>
> I'm working on a project where we have decided to start given access to our
> core functionality thru Web Services. After some research we choosen Apache
> CXF.
> During my analysis, everything works fine. I was deploying the test
> services on a Jetty without Spring Support (CXFNonSpringServlet).
>
> Now, the problem arouse when I deployed the same code on a Weblogic server.
> The issue is that the FIRST coming request takes lot of time (~7 seconds)
> and the subsequent ones take times <70 msec.
>
> I was some kinda confused about this behaviour, it would make sense a small
> increase in the first request 4 times at most but not some kinda this
> magnitude (100 times).
>
> I've changed the log level to FINEST and I'm seeing that this is happening
> the First time the Interceptor Chain is called (invoke to handleMessage on
> each input and output interceptors) -- see lines 892 to 1069 of the
> attached zipped log file. When the next request is served -- see lines
> 1121 to 1274 -- this work pretty smooth.
>
> Just in case, reducing the log level does not make things better (first
> request takes 6,5 seconds and next ones 30 msec)
>
> Do you have any ideas of what could be happening and how can I fix it?
>
> Thanks in advance,
> Mariano Ortega
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog