Need way to quickly garbage-collect

My node chews through a lot of data, we never pin anything. The .ipfs directory keeps getting bigger, I started trying to run the gc at around 125GB and now it’s around 450, bumping up against my partition size so I’m running out of time. gc doesn’t seem to work, so is there a safe alternative way, like manually deleting the database that ideally doesn’t require restarting the ipfs daemon? If I have to I will, but would prefer to avoid it.

I would appreciate any specific steps people have taken for this problem, from the github issues it seems like this is a known problem.

Are you running badger or flatfs ?

Are you actually running with gc (by default gc isn’t runned as it pause the node for a while you need to do, ipfs repo gc or start with ipfs daemon --enable-gc in order to have GC (also note that the second one will trigger at intervals in your config, so for example each hour that mean between thoses GC your node might still overreach the limit))

whatever is the default, I installedd the linux version from the website.

I have gc enabled in my system unit file. it doesn’t appear to ever gc though because the data partition just keeps growing. I have tried calling gc manually from the command line, it doesn’t seem to pause anything.

I just upgraded to 0.10.0, all issues were on the previous version.

to clear it out right now I just deleted everything and ran init again, but this time with a zfs mount and a snapshot of when it is empty.

Whats system unit file ? systemd (ipfs.system) ?

it doesn’t appear to ever gc

Yes by default GC is disabled, unless you changed something it’s not gonna run.

This is my line:

ExecStart=/var/lib/ipfs/go-ipfs/ipfs daemon --enable-namesys-pubsub --enable-pubsub-experiment --enable-gc

@SaulMoonves If you’re desperate you can always run ipfs repo gc as a cronjob

Something doesn’t add up:

  • If you are using defaults it should be using flatfs (please check your config)
  • If you are not pinning anything it should be obliterating all the data from disk

Do you put anything on MFS?

1 Like