]> dgit.raspbian.org Git - git-annex.git/commit
implement proxy connection pool
authorJoey Hess <joeyh@joeyh.name>
Fri, 26 Jul 2024 20:34:08 +0000 (16:34 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 26 Jul 2024 21:03:31 +0000 (17:03 -0400)
commitd1faa13d6aa5f7744753ecb68a7871e634823099
tree09243af658e5c7c3a7c9f2976eca8c488f757a9d
parentfb43b7ea3ff874b67751fc8ad60d6e444c355af3
implement proxy connection pool

removeOldestProxyConnectionPool will be innefficient the larger the pool
is. A better data structure could be more efficient. Eg, make each value
in the pool include the timestamp of its oldest element, then the oldest
value can be found and modified, rather than rebuilding the whole Map.

But, for pools of a few hundred items, this should be fine. It's O(n*n log n)
or so.

Also, when more than 1 connection with the same pool key exists,
it's efficient even for larger pools, since removeOldestProxyConnectionPool
is not needed.

The default of 1 idle connection could perhaps be larger.. like the
number of jobs? Otoh, it seems good to ramp up and down the number of
connections, which does happen. With 1, there is at most one stale
connection, which might cause a request to fail.
Command/P2PHttp.hs
P2P/Http/State.hs
P2P/Proxy.hs
doc/git-annex-p2phttp.mdwn
doc/todo/git-annex_proxies.mdwn