Prevent multiple instances of "ipfs bitswap reprovide" running at the same time #10513
Open
3 tasks done
Labels
effort/hours
Estimated to take one or several hours
exp/intermediate
Prior experience is likely helpful
kind/bug
A bug in existing code (including security flaws)
P2
Medium: Good to have, but can wait until someone steps up
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.
The text was updated successfully, but these errors were encountered: