You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ertio Lew <er...@gmail.com> on 2013/09/07 06:18:28 UTC

FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

I was just trying out some profiling experiments with my JSF project using
Netbeans based Profiler. However I found a very surprising results. I found
JSF's *FacesServlet.service()* method to be consuming most of the time
while requests were being served. I do serve content from databases into my
JSF pages but still I found major time lag was due to *high self time* of *
service()* method.

Here is the snapshot of the profiling results:- [image: See the high
self-time of FacesServlet service() method]

Why is this happening, what's happening so expensive within this method
that causes such high self time ?

*I am running Myfaces 2.1.12 in Production mode on Tomcat 7.0.42.*

*This question was also posted at StackOverflow
here<http://stackoverflow.com/questions/18643335/facesservlet-service-method-eating-too-much-time-while-serving-requests-high>
.*

Re: FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
On Sat, Sep 7, 2013 at 2:53 PM, Ertio Lew <er...@gmail.com> wrote:

> On Sat, Sep 7, 2013 at 11:54 AM, Anton Gavazuk <an...@gmail.com>
>  wrote:
> >
> >
> > So this method is actually wrapping up all underlying processing: jsf
> > actions, business services, interaction with db - thus its time is always
> > the biggest
> >
>
> Nope the *self time* of this method that I am talking about, refers to
>  just the time spent inside this method, excluding time taken for
> subsequent method calls from within it. So it *does not* cover the time for
> database interaction or any business logic processing & it eats up 75% time
> while serving requests which IMHO is way too much & looks unacceptable for
> any public facing web application.
>

welcome to the world of /faces servlet 'service'/. why don't you remove 50%
of the code that is listed 'under' faces servlet service(), and see if you
time cuts in half...50%. :)

and report here with your test results...if it even shows up in Java Visual
VM.

Re: FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

Posted by Ertio Lew <er...@gmail.com>.
On Sat, Sep 7, 2013 at 11:54 AM, Anton Gavazuk <an...@gmail.com>
 wrote:
>
>
> So this method is actually wrapping up all underlying processing: jsf
> actions, business services, interaction with db - thus its time is always
> the biggest
>

Nope the *self time* of this method that I am talking about, refers to
 just the time spent inside this method, excluding time taken for
subsequent method calls from within it. So it *does not* cover the time for
database interaction or any business logic processing & it eats up 75% time
while serving requests which IMHO is way too much & looks unacceptable for
any public facing web application.

Re: FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
On Sat, Sep 7, 2013 at 2:24 AM, Anton Gavazuk <an...@gmail.com>wrote:

> Process an incoming request, and create the corresponding response, by
> executing the request processing lifecycle.
>
> If the request and response arguments to this method are not instances of
> HttpServletRequest and HttpServletResponse, respectively, the results of
> invoking this method are undefined.
>
> This method must respond to requests that start with the following strings
> by invoking the sendError method on the response argument (cast to
> HttpServletResponse), passing the code HttpServletResponse.SC_NOT_FOUND as
> the argument.
>
> So this method is actually wrapping up all underlying processing: jsf
> actions, business services, interaction with db - thus its time is always
> the biggest
>
>
In response to OP and to demonstrate what Anton stated above, I answered
the question on stackoverflow[1] with plenty of screen captures. :)


[1] http://stackoverflow.com/a/18677667/933054

Re: FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

Posted by Ertio Lew <er...@gmail.com>.
On Sat, Sep 7, 2013 at 11:54 AM, Anton Gavazuk <an...@gmail.com>
 wrote:
>
>
> So this method is actually wrapping up all underlying processing: jsf
> actions, business services, interaction with db - thus its time is always
> the biggest
>

Nope the *self time* of this method that I am talking about, refers to
 just the time spent inside this method, excluding time taken for
subsequent method calls from within it. So it *does not* cover the time for
database interaction or any business logic processing & it eats up 75% time
while serving requests which IMHO is way too much & looks unacceptable for
any public facing web application.

Re: FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

Posted by Anton Gavazuk <an...@gmail.com>.
Process an incoming request, and create the corresponding response, by
executing the request processing lifecycle.

If the request and response arguments to this method are not instances of
HttpServletRequest and HttpServletResponse, respectively, the results of
invoking this method are undefined.

This method must respond to requests that start with the following strings
by invoking the sendError method on the response argument (cast to
HttpServletResponse), passing the code HttpServletResponse.SC_NOT_FOUND as
the argument.

So this method is actually wrapping up all underlying processing: jsf
actions, business services, interaction with db - thus its time is always
the biggest

Thanks,
Anton

On Sep 7, 2013, at 6:19, Ertio Lew <er...@gmail.com> wrote:

I was just trying out some profiling experiments with my JSF project using
Netbeans based Profiler. However I found a very surprising results. I found
JSF's *FacesServlet.service()* method to be consuming most of the time
while requests were being served. I do serve content from databases into my
JSF pages but still I found major time lag was due to *high self time* of *
service()* method.

Here is the snapshot of the profiling results:- [image: See the high
self-time of FacesServlet service() method]

Why is this happening, what's happening so expensive within this method
that causes such high self time ?

*I am running Myfaces 2.1.12 in Production mode on Tomcat 7.0.42.*

*This question was also posted at StackOverflow
here<
http://stackoverflow.com/questions/18643335/facesservlet-service-method-eating-too-much-time-while-serving-requests-high
>
.*

Re: FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

Posted by Mike Kienenberger <mk...@gmail.com>.
43% seems too high a result for a method that only calls other methods and
does nothing itself.
Something is still being misrepresented in your results.  Finding what that
is will likely clear up your question.


On Mon, Sep 9, 2013 at 3:38 PM, Ertio Lew <er...@gmail.com> wrote:

> As pointed out by @mkienenb in his answer at StackOverflow[here
> http://stackoverflow.com/a/18700523/530153], during the above profiling
> test I excluded the org.apache.myfaces methods, so I did a fresh
> profiling test & I'm posting below the new result snapshot.
>
> [image: enter image description here]
>
> But you can still see that a lot of time overhead is caused due to Self
> times of Myfaces/JSF methods. I'm sure that my code isn't being included
> in these self times because while profiling I filtered out only the core
> Java classes, so all my methods are included & also I can see them in the
> snapshot. For e.g. px10.channelController.init() is the method that
> retrieves from database & process all data to be shown for page.
>
>
> On Tue, Sep 10, 2013 at 12:26 AM, Mike Kienenberger <mk...@gmail.com>wrote:
>
>> And by "here" I am suggesting the myfaces mailing lists in case it wasn't
>> clear.
>>
>> On Mon, Sep 9, 2013 at 2:47 PM, Mike Kienenberger <mk...@gmail.com>
>> wrote:
>> > Trying to have a discussion on StackOverflow using comments isn't the
>> > best approach.   Go ahead and make your comments on here if you would
>> > like to continue discussing the situation.
>>
>
>

Re: FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

Posted by Mike Kienenberger <mk...@gmail.com>.
43% seems too high a result for a method that only calls other methods and
does nothing itself.
Something is still being misrepresented in your results.  Finding what that
is will likely clear up your question.


On Mon, Sep 9, 2013 at 3:38 PM, Ertio Lew <er...@gmail.com> wrote:

> As pointed out by @mkienenb in his answer at StackOverflow[here
> http://stackoverflow.com/a/18700523/530153], during the above profiling
> test I excluded the org.apache.myfaces methods, so I did a fresh
> profiling test & I'm posting below the new result snapshot.
>
> [image: enter image description here]
>
> But you can still see that a lot of time overhead is caused due to Self
> times of Myfaces/JSF methods. I'm sure that my code isn't being included
> in these self times because while profiling I filtered out only the core
> Java classes, so all my methods are included & also I can see them in the
> snapshot. For e.g. px10.channelController.init() is the method that
> retrieves from database & process all data to be shown for page.
>
>
> On Tue, Sep 10, 2013 at 12:26 AM, Mike Kienenberger <mk...@gmail.com>wrote:
>
>> And by "here" I am suggesting the myfaces mailing lists in case it wasn't
>> clear.
>>
>> On Mon, Sep 9, 2013 at 2:47 PM, Mike Kienenberger <mk...@gmail.com>
>> wrote:
>> > Trying to have a discussion on StackOverflow using comments isn't the
>> > best approach.   Go ahead and make your comments on here if you would
>> > like to continue discussing the situation.
>>
>
>

Re: FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

Posted by Ertio Lew <er...@gmail.com>.
As pointed out by @mkienenb in his answer at StackOverflow[here
http://stackoverflow.com/a/18700523/530153], during the above profiling
test I excluded the org.apache.myfaces methods, so I did a fresh profiling
test & I'm posting below the new result snapshot.

[image: enter image description here]

But you can still see that a lot of time overhead is caused due to Self
times of Myfaces/JSF methods. I'm sure that my code isn't being included in
these self times because while profiling I filtered out only the core Java
classes, so all my methods are included & also I can see them in the
snapshot. For e.g. px10.channelController.init() is the method that
retrieves from database & process all data to be shown for page.


On Tue, Sep 10, 2013 at 12:26 AM, Mike Kienenberger <mk...@gmail.com>wrote:

> And by "here" I am suggesting the myfaces mailing lists in case it wasn't
> clear.
>
> On Mon, Sep 9, 2013 at 2:47 PM, Mike Kienenberger <mk...@gmail.com>
> wrote:
> > Trying to have a discussion on StackOverflow using comments isn't the
> > best approach.   Go ahead and make your comments on here if you would
> > like to continue discussing the situation.
>

Re: FacesServlet.service() method eating too much time while serving requests (high self-time) ?!

Posted by Ertio Lew <er...@gmail.com>.
As pointed out by @mkienenb in his answer at StackOverflow[here
http://stackoverflow.com/a/18700523/530153], during the above profiling
test I excluded the org.apache.myfaces methods, so I did a fresh profiling
test & I'm posting below the new result snapshot.

[image: enter image description here]

But you can still see that a lot of time overhead is caused due to Self
times of Myfaces/JSF methods. I'm sure that my code isn't being included in
these self times because while profiling I filtered out only the core Java
classes, so all my methods are included & also I can see them in the
snapshot. For e.g. px10.channelController.init() is the method that
retrieves from database & process all data to be shown for page.


On Tue, Sep 10, 2013 at 12:26 AM, Mike Kienenberger <mk...@gmail.com>wrote:

> And by "here" I am suggesting the myfaces mailing lists in case it wasn't
> clear.
>
> On Mon, Sep 9, 2013 at 2:47 PM, Mike Kienenberger <mk...@gmail.com>
> wrote:
> > Trying to have a discussion on StackOverflow using comments isn't the
> > best approach.   Go ahead and make your comments on here if you would
> > like to continue discussing the situation.
>