hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Add total max idle config to Client pool

Open seanmonstar opened this issue 5 years ago • 2 comments

There is a desire to be able to put a limit on the maximum size of the connection pool. There is already a pool_max_idle_per_host, but this proposes a max over all hosts.

This is often done with some sort of LRU cache, but we probably don't need one. The pool usually removes a connection handle from the pool while it isn't idle (HTTP/2 is different), so a doubly-linked list or deque is probably sufficient.

seanmonstar avatar Jun 24 '20 00:06 seanmonstar

Is this still needed/wanted? I was looking for limiting the life of a pooled connection, for example, 1000 requests can be done over a connection and then it's dropped (or could be expressed as a time duration). I don't know hyper internals but would be willing to take a stab at this one.

fbergero avatar Apr 20 '24 21:04 fbergero

@fbergero What you're asking is different than the one posted in the issue.

1000 requests can be done over a connection and then it's dropped (or could be expressed as a time duration).

I think this can be easily done outside of hyper, and it's perhaps more convenient that way.

dswij avatar Apr 22 '24 06:04 dswij