[jetty-dev] Statistics on

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-dev] Statistics on

Johan Piculell
Hi.
I played around a little with the StatisticsHandler and was hoping to get some stats on requests waiting for a thread to process, i.e. how long time the selector threads have to wait for an idle thread for processing. 
It seems to me like it is not possible to pull these stats, so two questions; 1) am I missing something and/or have there been any plans to introduce such statistics?

Regards
/Johan

_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Statistics on

Simone Bordet-3
Hi,

On Mon, Sep 25, 2017 at 1:53 PM, Johan Piculell <[hidden email]> wrote:
> Hi.
> I played around a little with the StatisticsHandler and was hoping to get
> some stats on requests waiting for a thread to process, i.e. how long time
> the selector threads have to wait for an idle thread for processing.

Jetty, as of 9.4.x, does not have "dedicated" selector threads.
A thread does the NIO selection, Jetty dispatches another thread to
continue with NIO selection, then most of the time the original thread
just continues with socket read, HTTP parsing and eventually invoking
the application.

Therefore "how long a selector thread has to wait for an idle thread
to process the NIO event" is not applicable to current Jetty because
it's the same thread.

> It seems to me like it is not possible to pull these stats, so two
> questions; 1) am I missing something and/or have there been any plans to
> introduce such statistics?

See https://github.com/eclipse/jetty.project/issues/1807.

You have to detail _exactly_ what is it that you are interested in.
If it's the time it takes for a request to be dispatched to an
application, then #1807 will give you that answer.
If you're interested in how long does it take for a generic job to be
executed by a thread, then that's entirely another measure that is not
covered by #1807, but is easily covered by an instrumented thread pool
(and its queue).

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Statistics on

Johan Piculell

Thanks Simone (and sorry for the crappy subject, premature mail sending ;-) ).

Seems like it is #1807 I'm interested in,  description is a bit short in that discussion however but assume I would need to hook into

  • requestBeforeDispatch
  • requestAfterDispatch

and do my calculations to get some max, average, etc timings on the dispatching. Looking forward to a release were I can experiment with this.

Just out of curiosity, would the selector thread timings be possible to get in versions <= v9.3.x?

Regards
/Johan

On 2017-09-25 16:16, Simone Bordet wrote:

Hi,

On Mon, Sep 25, 2017 at 1:53 PM, Johan Piculell [hidden email] wrote:
Hi.
I played around a little with the StatisticsHandler and was hoping to get
some stats on requests waiting for a thread to process, i.e. how long time
the selector threads have to wait for an idle thread for processing.
Jetty, as of 9.4.x, does not have "dedicated" selector threads.
A thread does the NIO selection, Jetty dispatches another thread to
continue with NIO selection, then most of the time the original thread
just continues with socket read, HTTP parsing and eventually invoking
the application.

Therefore "how long a selector thread has to wait for an idle thread
to process the NIO event" is not applicable to current Jetty because
it's the same thread.

It seems to me like it is not possible to pull these stats, so two
questions; 1) am I missing something and/or have there been any plans to
introduce such statistics?
See https://github.com/eclipse/jetty.project/issues/1807.

You have to detail _exactly_ what is it that you are interested in.
If it's the time it takes for a request to be dispatched to an
application, then #1807 will give you that answer.
If you're interested in how long does it take for a generic job to be
executed by a thread, then that's entirely another measure that is not
covered by #1807, but is easily covered by an instrumented thread pool
(and its queue).



_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Statistics on

Simone Bordet-3
Hi,

On Mon, Sep 25, 2017 at 4:44 PM, Johan Piculell <[hidden email]> wrote:

> Thanks Simone (and sorry for the crappy subject, premature mail sending ;-)
> ).
>
> Seems like it is #1807 I'm interested in,  description is a bit short in
> that discussion however but assume I would need to hook into
>
> requestBeforeDispatch
> requestAfterDispatch
>
> and do my calculations to get some max, average, etc timings on the
> dispatching. Looking forward to a release were I can experiment with this.

Note that those events will happen just before and just after the
invocation to HttpServlet.service() (and possibly Servlet Filters).
As such, I'm not sure you get much value out of those that you cannot
get already with a Servlet Filter.

> Just out of curiosity, would the selector thread timings be possible to get
> in versions <= v9.3.x?

Not really. You could measure how long a task submitted to the thread
pool remains in the queue before being executed, but you won't be able
to tell what task (unless doing some heavy RTTI).

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Statistics on

Guillaume Maillard
Hi,

If your goal is optimize your app and have a better look at what really happen,
I would recommand to forget such "simple" statistics
and use Perfino (https://www.ej-technologies.com/products/perfino/overview.html).

Regards,

Guillaume

(I'm not affiliated to this product, it just kick ass)



2017-09-25 17:59 GMT+02:00 Simone Bordet <[hidden email]>:
Hi,

On Mon, Sep 25, 2017 at 4:44 PM, Johan Piculell <[hidden email]> wrote:
> Thanks Simone (and sorry for the crappy subject, premature mail sending ;-)
> ).
>
> Seems like it is #1807 I'm interested in,  description is a bit short in
> that discussion however but assume I would need to hook into
>
> requestBeforeDispatch
> requestAfterDispatch
>
> and do my calculations to get some max, average, etc timings on the
> dispatching. Looking forward to a release were I can experiment with this.

Note that those events will happen just before and just after the
invocation to HttpServlet.service() (and possibly Servlet Filters).
As such, I'm not sure you get much value out of those that you cannot
get already with a Servlet Filter.

> Just out of curiosity, would the selector thread timings be possible to get
> in versions <= v9.3.x?

Not really. You could measure how long a task submitted to the thread
pool remains in the queue before being executed, but you won't be able
to tell what task (unless doing some heavy RTTI).

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev