[undertow-dev] Worker queue timeout

Stan Rosenberg stan.rosenberg at acm.org
Fri Feb 28 14:17:36 EST 2020


On Thu, Feb 27, 2020 at 4:47 PM James Howe <jmh205 at cam.ac.uk> wrote:

> Under load, when the worker threads are saturated, new requests will be
> queued.
> Is there a way to timeout these requests, so that it doesn't waste time
> serving them later when the client has already given up?
>

If I understand correctly, the same issue was discussed in this thread:
https://lists.jboss.org/pipermail/undertow-dev/2018-July/002231.html
We ended up implementing custom logic based on CAS; here is the snippet in
kotlin: https://gist.github.com/srosenberg/ed8d71d2f68379f909b1c4b8343807aa
Thus, if a request takes longer than requestTimeoutMillis to service, the
exchange is ended with StatusCodes.REQUEST_TIME_OUT
The performance overhead of CAS was negligible.

Best,

stan

P.S. Sorry for the duplicate; first attempt to post was rejected by list
server because I used the wrong reply address.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20200228/57cbbe80/attachment.html 


More information about the undertow-dev mailing list