Open LeDechaine opened 2 months ago
The default Reprovider.Interval
is once every 22 hours. Modern Amino DHT servers remember records for 48h (https://github.com/libp2p/go-libp2p-kad-dht/pull/793), old ones remembered for 24h. There should be no reason to provide more often than once a day.
Forcing reprovide every hour via cron is def. not doing you any good, especially if providing your CIDs takes longer than tha this shortened interval. You should just disable it and rely on Reprovider.Interval
.
A more accurate title for this is possibly: Prevent multiple instances of "ipfs bitswap reprovide" running at the same time.
We don't have a global mutex on running ipfs bitswap reprovide
(it is backed by Provider.Reprovide(req.Context)
from boxo which is always forced).
This is a sensible bug to fix as part of the reprovider work we plan to do (cc @gammazero)
Checklist
Installation method
ipfs-update or dist.ipfs.tech
Version
Config
Description
A more accurate title for this is possibly: Prevent multiple instances of "ipfs bitswap reprovide" running at the same time.
This is similar to this, but with "Reprovider.Strategy" not set.
"ipfs bitswap reprovide" apparently "triggers reprovider to announce our data to network" and is a recommended way to make IPFS work better on forums. Having only a 20mb website (about 100 files) on IPFS, I set a cron job on two different servers, to do "ipfs bitswap reprovide" every hour on two different VPS's. Doing the command manually appeared to just hang, no info whatsoever (which is probably a bug already), and I had to "ctrl+C" out of it, but I added it to crontab anyway. TL,DR: Don't.
Here's "journalctl -u ipfs" on server 1 (So yeah I found out my new VPS actually meets the minimum IPFS requirements, this is a quad-core with 8Gb of ram -- "ipfs config show" is from this one)
"journalctl -u ipfs" on server 2 (this is from a single-core with 512mb ram -- Hosting one website and running with "NoFetch" now)
But no restarts since 4 days ago on server2?
"ps aux | grep ipfs" on server2:
...gave me 26 instances of "ipfs bitswap reprovide" running
Long story short: executing "ipfs bitswap reprovide", even for 20mb (about 200 files), is too much, and will systematically crash your ipfs daemon even with a quad core with 8Gb of ram. Big server or not, this is definitely not the intended result(s). IPFS worked fine, stable, no crashes, for multiple months, without "ipfs bitswap reprovide" as a cron job, even on the VPS with 1-core and 512mb ram.
Maybe I was an idiot for setting it to "ipfs bitswap reprovide" every hour, maybe that's why ipfs crashed. If that's the case, at minimum, I recommend preventing reproviding when another "reprovide" job is already ongoing.