Hi,

On Mon, Apr 13, 2020 at 5:34 PM Stefano Bonetti <[email protected]> wrote:
>
> Hello,
> apologies if this is not the right group for such a request.
>
> I have a web app with a /healthcheck path which is used by the infrastructure 
> to detect failing applications. At present when my app is under high load the 
> healthcheck starts failing with 502s, so the infrastructure starts 
> terminating the app instances.

Isn't this exactly what you want?
If the server is overloaded, the health check fails exactly because
the server is overloaded - you don't want to send more requests to an
overloaded server, right?

> I was wondering if there is a way of serving some paths (namely the 
> healthcheck path) on a separate thread pool, so the healthcheck requests are 
> not affected by high load.

It's more complicated than this.

A new request may trigger the opening of a new connection.
The server may be overloaded not because it's running out of threads,
but because it cannot cope with more connections - thread pools are
not exactly in the game here.

You have to carefully control also connection opening to isolate the
health check request.

> Is there any way of doing it?

You can create a new ServerConnector on a different port.
Each ServerConnector can be configured with its own thread pool.
The configuration for this ServerConnector should be minimal (e.g.
acceptors=1, selectors=1, small thread pool).

Send the health check requests to the different port.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users

Reply via email to