is there any way to handle request urls for tomcat instead of completablefuture?

A thread pool is what it states – a pool. So there’s no guarantees in a pool to re-address the same thread to a task nor would it be any helpful. The pool just return the next available thread in the pool. But what does “next” mean? This is depending on the pool implementation – and this should be abstracted from the user. Just because it’s not directly reassigned the next request doesn’t mean it will never be reused. The pool decides how to do this. This depends in the pool’s strategy. So there might be some margin or threshold in time or some queue in the Servlet pool.

You could try if behaviour changes when you reconfigure Tomcat for evaluation purpose:

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="0"/>

But this will not be helpful performance wise and is not suggested. I wouldn’t mess with the Servlet Thread Pool mechanics unless there’s good reasons to do so. A pool is for handing over that control for good reasons.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top