ipfs-cluster/ipfsconn/ipfshttp
Hector Sanjuan 592d61b228 ipfshttp: rate limit requests when failures happen
When IPFS starts failing or doesn't respond (i.e. during a restart), cluster
is likely to start sending requests at very fast rates. i.e. if there are 100k
items to be pinned, and pins start failing immediately, cluster will consume
the pin queue really fast and it will all be failures. At the same time, ipfs
is hammered non-stop until recover, which may make it harder.

This commits introduces a rate-limit when requests to IPFS fail. After 10
failed requests, requests will be sent at most at 1req/s rate. Once a requests
succeeds, the rate-limit is raised.

This should prevent hammering the IPFS daemon, but also increased CPU in
cluster as it burns through pinning queues when IPFS is offline, making the
situation in machines worse (and emitting way more logs).
2022-09-15 17:37:26 +02:00
..
config_test.go Fix: repo/stat gets hammered on busy cluster peers 2022-02-01 01:34:17 +01:00
config.go Enable spell checking and fix spelling errors (using US locale) 2022-06-16 17:43:30 +02:00
ipfshttp_test.go Migrate from ipfs/ipfs-cluster to ipfs-cluster/ipfs-cluster 2022-06-16 17:43:30 +02:00
ipfshttp.go ipfshttp: rate limit requests when failures happen 2022-09-15 17:37:26 +02:00