0

I have a use-case where I need to make thousands of HTTP Get requests in Fire and Forget mode.

I am using aync-http-client < https://github.com/AsyncHttpClient/async-http-client > to achieve this.

async-http-client: 2.5.4

Java 11

I am using below config for DefaultAsyncHttpClientConfig.Builder:

  1. setMaxConnections(10000)
  2. setIoThread(6)
  3. setKeepAlive(true)

HTTP Get response time: p99 = 500ms

I am getting 20k rps (outgoing) with above config and http get response time.

I have not explicitly added any timeouts.

Now I want to understand whether adding a readTimeOut of 100ms will result in increase of rps numbers. Assumption being after 100ms of timeout, async-http-client will release the connection to the pool for others to use.

Is there any other recommended way for achieving Fire and Forget using async-http-client ?

Thanks.

Community
  • 1
  • 1

1 Answers1

0

The Default Read Timeout is 60000 ms. You are thinking in the right direction reducing the value of property Read Timeout will release the connection.

For More Details Look into ReadTimeoutTimerTask class at https://github.com/AsyncHttpClient/async-http-client/blob/master/client/src/main/java/org/asynchttpclient/netty/timeout/ReadTimeoutTimerTask.java

Rohit Yadav
  • 2,252
  • 16
  • 18