Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPFS not respecting StorageMax #6242

Open
koalalorenzo opened this issue Apr 21, 2019 · 3 comments
Open

IPFS not respecting StorageMax #6242

koalalorenzo opened this issue Apr 21, 2019 · 3 comments
Labels
kind/bug A bug in existing code (including security flaws) status/duplicate This issue or pull request already exists

Comments

@koalalorenzo
Copy link
Member

koalalorenzo commented Apr 21, 2019

Version information:

go-ipfs version: 0.4.20-
Repo version: 7
System version: amd64/linux
Golang version: go1.12.4

Type: Bug

Description:

After a while or running 0.4.20 in production and serving content, the system seems to not respect the StorageMax rule in the configuration.

I currently have these settings in the configuration:

[...]
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "8GB"
  },
[...]

But the size of the ipfs directory is 15GB

user@eu-helsinki1:/opt/ipfs# du -h --max-depth=1
15G	./blocks
4.0K	./keystore
61M	./datastore
15G	.
user@eu-helsinki1:/opt/ipfs# ipfs repo stat
NumObjects: 72290
RepoSize:   15456415465
StorageMax: 8000000000
RepoPath:   /opt/ipfs/
Version:    fs-repo@7

The GC is enabled when starting the daemon (using the args). Is there any way to enforce the GC via the configuration? That might be an issue.

@Stebalien
Copy link
Member

So, we currently run GC when (a) it's enabled and (b) we surpass the storage max. This is likely a duplicate of #5140 but I'll keep this open until we can confirm that.

@Stebalien Stebalien added kind/bug A bug in existing code (including security flaws) status/duplicate This issue or pull request already exists labels Apr 22, 2019
@koalalorenzo
Copy link
Member Author

The issue is that the IPFS gateway is running with an actual option to enable gc.

Screenshot 2019-04-26 at 19 59 24

I run manually the gc to solve the issue, but often it fills up the disk.

A good long-term solution would be to use some more "standard" way to configure IPFS from both CLI as well as the configuration file. @Stebalien as a short solution, is there anything I can help to debug this?

@momack2 momack2 added this to Inbox in ipfs/go-ipfs May 9, 2019
@Stebalien
Copy link
Member

I wonder if the daemon is restarting before it tries to GC? If you'd like to debug this, you'll probably need to dig into the code (and shorten the GC timeouts to see where this is going wrong).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) status/duplicate This issue or pull request already exists
Projects
No open projects
Development

No branches or pull requests

2 participants