async-http-client TCP connection flush

I’m getting response time spikes every minute on the 99% line (even though max response times are fairly evenly distributed!!!).

I remember reading that async-http-client creates a new connection pool every minute, by default.

Is there a way to alleviate this in some way to prove that this is in fact the issue?


Does your test case involves virtual users who stay idle for a long time, like one minute?

HI Stéphane,

Here's the sim:
(only BBC staff and Stephane can see this)

And virtual users are not idle for > 1 minute .

Anyway, I set the "-Dgatling.http.ahc.pooledConnectionIdleTimeout=30000" and still peaks every minute, so it is not the async-http-client

Does the connection pool only get renewed if it is idle for > 1 minute?



I’ll investigate later this week.
Thanks for reporting.

Prior to AHC 2.0.11, connection pool was only scanned every minutes for idle connections.
If you have tons of idle connections, typically because you spawn tons of virtual users that stay idle (and server doesn’t close the idle connections on its side, which is wrong IMO), Gatling would end up closing a huge bunch of connections periodically and sending tons of FIN TCP frames, causing some hiccups.

This has been fixed in AHC 2.0.11 which is already shipped in Gatling snapshots.

As you use a shared connection pool and no pauses, your use case isn’t affected.