cch1 / http.async.client

Async Http Client - Clojure
http://cch1.github.com/http.async.client
267 stars 40 forks source link

Client connection pool #50

Closed thiagotnunes closed 9 years ago

thiagotnunes commented 11 years ago

It was mentioned before that it is not very efficient to create a client per request, do you have any idea of a best approach for this? Maybe a connection pool?

neotyk commented 11 years ago

My advice is to have one global client and use it wherever you have to call HTTP. Connections are kept alive in a pool by default, please see documentation for :max-conns-per-host and :max-conns-total of http.async.client/create-client.

Hope it helps, Hubert.

cch1 commented 9 years ago

The advice offered by @neotyk above is accurate. In fact, there is a thread on the AsyncHttpClient mailing list supporting this position.