Priority treatment of health checks?

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

Priority treatment of health checks?

Benjamin Jaton
Greetings,

I've asked a question on SO a few days back:

---
My Jetty is servicing requests on /myservice/*

My problem is that when the server's queue gets full, the health check requests on /healthcheck start failing.

Is it possible to have a separate queue for my health checks, or is there another way to do this?

(code sample)
----

I'm trying my chance in here, maybe someone has tried to do this before and has thoughts about it?

Thanks
Benjamin

_______________________________________________
jetty-users 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-users
Reply | Threaded
Open this post in threaded view
|

Re: Priority treatment of health checks?

Jesse McConnell

I know some folks set up a separate connector on a different port for health checks like this with its own thread pool.

Jesse

--
jesse mcconnell
[hidden email]


On Thu, May 24, 2018 at 12:23 PM Benjamin Jaton <[hidden email]> wrote:
Greetings,

I've asked a question on SO a few days back:

---
My Jetty is servicing requests on /myservice/*

My problem is that when the server's queue gets full, the health check requests on /healthcheck start failing.

Is it possible to have a separate queue for my health checks, or is there another way to do this?

(code sample)
----

I'm trying my chance in here, maybe someone has tried to do this before and has thoughts about it?

Thanks
Benjamin
_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users
Reply | Threaded
Open this post in threaded view
|

Re: Priority treatment of health checks?

Benjamin Jaton
But isn't the thread pooling configured at the level of the server?

        Server server = new Server(8086);
        QueuedThreadPool qtp = (QueuedThreadPool) server.getThreadPool();
        qtp.setMaxThreads(6);

On Thu, May 24, 2018 at 11:04 AM, Jesse McConnell <[hidden email]> wrote:

I know some folks set up a separate connector on a different port for health checks like this with its own thread pool.

Jesse

--
jesse mcconnell
[hidden email]


On Thu, May 24, 2018 at 12:23 PM Benjamin Jaton <[hidden email]> wrote:
Greetings,

I've asked a question on SO a few days back:

---
My Jetty is servicing requests on /myservice/*

My problem is that when the server's queue gets full, the health check requests on /healthcheck start failing.

Is it possible to have a separate queue for my health checks, or is there another way to do this?

(code sample)
----

I'm trying my chance in here, maybe someone has tried to do this before and has thoughts about it?

Thanks
Benjamin
_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users


_______________________________________________
jetty-users 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-users
Reply | Threaded
Open this post in threaded view
|

Re: Priority treatment of health checks?

Jesse McConnell
Sorry, called Executors now in this context, if you check out the constructors for the ServerConnector you should see some javadoc about how if it is null then it uses the server's executor but you can pass it your own if you like.

Not sure if you can rely on the newer reserved threads mechanism for this or not, I don't think so but one of the others can confirm.  

Might be another way to do it, this was just the older more traditional approach that I remember doing.  QoSFilter might cover this case as well but would require some more knowledge of your app then I have to say definitively.

cheers,
Jesse

--
jesse mcconnell
[hidden email]


On Thu, May 24, 2018 at 1:46 PM Benjamin Jaton <[hidden email]> wrote:
But isn't the thread pooling configured at the level of the server?

        Server server = new Server(8086);
        QueuedThreadPool qtp = (QueuedThreadPool) server.getThreadPool();
        qtp.setMaxThreads(6);

On Thu, May 24, 2018 at 11:04 AM, Jesse McConnell <[hidden email]> wrote:

I know some folks set up a separate connector on a different port for health checks like this with its own thread pool.

Jesse

--
jesse mcconnell
[hidden email]


On Thu, May 24, 2018 at 12:23 PM Benjamin Jaton <[hidden email]> wrote:
Greetings,

I've asked a question on SO a few days back:

---
My Jetty is servicing requests on /myservice/*

My problem is that when the server's queue gets full, the health check requests on /healthcheck start failing.

Is it possible to have a separate queue for my health checks, or is there another way to do this?

(code sample)
----

I'm trying my chance in here, maybe someone has tried to do this before and has thoughts about it?

Thanks
Benjamin
_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users
Reply | Threaded
Open this post in threaded view
|

Re: Priority treatment of health checks?

Joakim Erdfelt-8
There's also the DoSFilter and QoSFilter that could be used to give the healthcheck a higher priority and other requests upper limits of resource usage.


Joakim Erdfelt / [hidden email]

On Thu, May 24, 2018 at 3:51 PM, Jesse McConnell <[hidden email]> wrote:
Sorry, called Executors now in this context, if you check out the constructors for the ServerConnector you should see some javadoc about how if it is null then it uses the server's executor but you can pass it your own if you like.

Not sure if you can rely on the newer reserved threads mechanism for this or not, I don't think so but one of the others can confirm.  

Might be another way to do it, this was just the older more traditional approach that I remember doing.  QoSFilter might cover this case as well but would require some more knowledge of your app then I have to say definitively.

cheers,
Jesse

--
jesse mcconnell
[hidden email]


On Thu, May 24, 2018 at 1:46 PM Benjamin Jaton <[hidden email]> wrote:
But isn't the thread pooling configured at the level of the server?

        Server server = new Server(8086);
        QueuedThreadPool qtp = (QueuedThreadPool) server.getThreadPool();
        qtp.setMaxThreads(6);

On Thu, May 24, 2018 at 11:04 AM, Jesse McConnell <[hidden email]> wrote:

I know some folks set up a separate connector on a different port for health checks like this with its own thread pool.

Jesse

--
jesse mcconnell
[hidden email]


On Thu, May 24, 2018 at 12:23 PM Benjamin Jaton <[hidden email]> wrote:
Greetings,

I've asked a question on SO a few days back:

---
My Jetty is servicing requests on /myservice/*

My problem is that when the server's queue gets full, the health check requests on /healthcheck start failing.

Is it possible to have a separate queue for my health checks, or is there another way to do this?

(code sample)
----

I'm trying my chance in here, maybe someone has tried to do this before and has thoughts about it?

Thanks
Benjamin
_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users


_______________________________________________
jetty-users 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-users
Reply | Threaded
Open this post in threaded view
|

Re: Priority treatment of health checks?

Benjamin Jaton
Thanks Jesse, I created 2 separate servers but your approach is simpler / cleaner.

On the QoSFilter solution I wonder, in theory isn't possible that the acceptor queue gets full and that the health check requests get rejected before reaching the filter?


On Thu, May 24, 2018 at 2:46 PM, Joakim Erdfelt <[hidden email]> wrote:
There's also the DoSFilter and QoSFilter that could be used to give the healthcheck a higher priority and other requests upper limits of resource usage.


Joakim Erdfelt / [hidden email]

On Thu, May 24, 2018 at 3:51 PM, Jesse McConnell <[hidden email]> wrote:
Sorry, called Executors now in this context, if you check out the constructors for the ServerConnector you should see some javadoc about how if it is null then it uses the server's executor but you can pass it your own if you like.

Not sure if you can rely on the newer reserved threads mechanism for this or not, I don't think so but one of the others can confirm.  

Might be another way to do it, this was just the older more traditional approach that I remember doing.  QoSFilter might cover this case as well but would require some more knowledge of your app then I have to say definitively.

cheers,
Jesse

--
jesse mcconnell
[hidden email]


On Thu, May 24, 2018 at 1:46 PM Benjamin Jaton <[hidden email]> wrote:
But isn't the thread pooling configured at the level of the server?

        Server server = new Server(8086);
        QueuedThreadPool qtp = (QueuedThreadPool) server.getThreadPool();
        qtp.setMaxThreads(6);

On Thu, May 24, 2018 at 11:04 AM, Jesse McConnell <[hidden email]> wrote:

I know some folks set up a separate connector on a different port for health checks like this with its own thread pool.

Jesse

--
jesse mcconnell
[hidden email]


On Thu, May 24, 2018 at 12:23 PM Benjamin Jaton <[hidden email]> wrote:
Greetings,

I've asked a question on SO a few days back:

---
My Jetty is servicing requests on /myservice/*

My problem is that when the server's queue gets full, the health check requests on /healthcheck start failing.

Is it possible to have a separate queue for my health checks, or is there another way to do this?

(code sample)
----

I'm trying my chance in here, maybe someone has tried to do this before and has thoughts about it?

Thanks
Benjamin
_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users

_______________________________________________
jetty-users 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-users


_______________________________________________
jetty-users 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-users


_______________________________________________
jetty-users 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-users
Reply | Threaded
Open this post in threaded view
|

Re: Priority treatment of health checks?

Simone Bordet-3
Hi,

On Fri, May 25, 2018 at 12:49 AM, Benjamin Jaton
<[hidden email]> wrote:
> Thanks Jesse, I created 2 separate servers but your approach is simpler /
> cleaner.

The advantage of using a dedicated connector with its own thread pool
(aka executor) is that you can set the thread priority on the
dedicated executor to be higher.

> On the QoSFilter solution I wonder, in theory isn't possible that the
> acceptor queue gets full and that the health check requests get rejected
> before reaching the filter?

It will be rare but it's possible - the second dedicated connector
will solve this as well.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users 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-users
Reply | Threaded
Open this post in threaded view
|

Re: Priority treatment of health checks?

Benjamin Jaton
Got it, thank you all!

On Fri, May 25, 2018 at 1:02 AM, Simone Bordet <[hidden email]> wrote:
Hi,

On Fri, May 25, 2018 at 12:49 AM, Benjamin Jaton
<[hidden email]> wrote:
> Thanks Jesse, I created 2 separate servers but your approach is simpler /
> cleaner.

The advantage of using a dedicated connector with its own thread pool
(aka executor) is that you can set the thread priority on the
dedicated executor to be higher.

> On the QoSFilter solution I wonder, in theory isn't possible that the
> acceptor queue gets full and that the health check requests get rejected
> before reaching the filter?

It will be rare but it's possible - the second dedicated connector
will solve this as well.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users 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-users


_______________________________________________
jetty-users 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-users