We're using Wildfly 10.1.0 and Resteasy 3.1.1. At throughput in the hundreds of rps we see randomly long requests even though the average latency is very low.
We are looking at metrics generated from New Relic on our application. We notice that a small percentage of requests, ~1% get stuck inside "HttpServlet30Dispatcher.service()" which is a Resteasy lib function. For the requests that get stuck there, it looks like HttpServlet30Dispatcher (or some code underneath it) consumes 100% of the time of that request. We see requests that normally take 50ms go up to 20s+.
Does anyone know what could cause this? It feels like Wildfly could be blocking the request waiting for a free thread, and maybe thread starvation happens. Can anyone confirm, or any advice on how to profile this?
Thanks! Matt