Skip to content

Adding file to repo with many files is slow #3545

Closed as not planned
Closed as not planned
@vertis

Description

@vertis

Version information:

go-ipfs version: 0.4.4-
Repo version: 4
System version: amd64/linux
Golang version: go1.7

Type: Bug

Priority: P1

Description:

Adding a file to an existing repo after many files have been imported is very slow.

  • This is local, without the daemon running (though that doesn't seem to matter).
# existing repo
root@localhost ~# ipfs repo stat
NumObjects 	 189555
RepoSize 	 43563229872
RepoPath 	 /data/ipfs
Version 	 fs-repo@4
root@localhost ~# dd if=/dev/random of=test.bin count=1024
0+1024 records in
113+1 records out
58024 bytes (58 kB) copied, 0.0343963 s, 1.7 MB/s
root@localhost ~# time -p ipfs add test.bin
added QmZikmEEAK923N6n1gpADRjWn7gSn3AyUGdSJXXqJmhk8W test.bin
real 11.49
user 0.16
sys 0.16

# new repo
root@localhost ~# ipfs repo stat
NumObjects 	 83
RepoSize 	 14358417
RepoPath 	 /data/ipfs2
Version 	 fs-repo@4
root@localhost ~# time -p ipfs add test.bin
added QmZikmEEAK923N6n1gpADRjWn7gSn3AyUGdSJXXqJmhk8W test.bin
real 0.26
user 0.01
sys 0.01

I had originally though it might just be the time writing the file out, however this doesn't appear to be the case. Even a tiny file incurs the ~10 second penalty.

Is this expected behaviour? because it sort of rules out using it for anything large like rubygems (which is what I was trying to import).

This isn't on a particularly beefy machine, however it doesn't seem to be CPU bound or IO bound (I'm not a massive expert on the later, however zpool iostat isn't showing high values).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions