On Fri, 2025-01-10 at 09:04 +0100, joan.balagu...@ventusproxy.com wrote: > Hi Oleg, > > We are going to try 5.4.1 with java24 and check the virtual threads > performance. Just a couple of questions: > > 1. To make use of VT, do we need to enable some flag (like we do in > tomcat with "useVirtualThreads=true" in the http connector)? Or > simply using the classic (blocking) connection management APIs is > enough to automatically make use of VT if we are in a java version >= > 21? >
Hi Joan The classic (blocking) HttpClient does not maintain its own pool of execution threads at all and async HttpClient runs a very small pool of i/o dispatch threads (one per CPU core). Thread creation and management is entirely up to you. This is of course different from the server side message processing that usually involves a dedicated pool of worker threads. > 2. If I'm not wrong, I remember the classic pool has a global lock to > control the max connections in use. I think you created the LAX mode > to mitigate some contention on this pool due to this global lock. Due > to our internal implementation, we will need to control the number of > requests sent to the backend by ourselves with a semaphore or an > atomic counter or whatever ... If we want to completely remove the > use of this lock, is it enough by setting the maxConnections to 0 (no > matter if we are using the strict or lax mode)? > I suppose setting maxConnections to 0 would render the pool non- functional. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org