clj-http

dgr 2020-07-24T22:10:32.013200Z

Hi, I’m trying to use clj-http to deliver maximum performance in download speed, and I’m not sure that I’ve quite got it yet. Right now, I’m using a custom connection manager created with make-reusable-connection-manager. This is then supplied to the get call with :connection-manager option. The connection manager has :threads set to 20 and :default-per-route set to 10. I’ve compared this performance to Aleph and I seem to be getting less than I should. Specifically, I’m trying to understand if what I’m doing now is resulting in 10 parallel connections that are opened at one time, with one request sent per connection, or whether I have 10 parallel AND PERSISTENT connections set up and I’m pushing all the requests (about 1000 total) down those 10 connections? The docs are a little ambiguous on this. I think I’m doing the former (10 parallel but not persistent connections) as opposed to the latter (10 parallel and persistent). With Aleph, you can specify the :connection-options to connection-pool with :keep-alive? set to true. I’m looking for the same behavior with clj-http, but I’m not quite sure how to do it. Any suggestions?