2bluesc Posted May 26, 2013 Report Share Posted May 26, 2013 When my backups ran the night after I started playing with BitTorrent Sync I was shocked to see how large the metacache folder was.The actual disk usage for my metacache directory is:$ du -hs metacache/266M metacache/A closer look reveals a ton of small files, most of which are smaller then my block size on ext4 (dumpe2fs reports "Block size: 4096"). This means a ton of space is likely wasted.I wrote a quick awk script to understand the metacache directory (https://gist.github....lemanna/5653926)$ ./real-size.sh metacache | tail -n2347 occurrences of file size = 19948 occurrences of file size = 48056 occurrences of file size = 36067 occurrences of file size = 38077 occurrences of file size = 34091 occurrences of file size = 320107 occurrences of file size = 300116 occurrences of file size = 280156 occurrences of file size = 260172 occurrences of file size = 240242 occurrences of file size = 220286 occurrences of file size = 200469 occurrences of file size = 179644 occurrences of file size = 159993 occurrences of file size = 1381917 occurrences of file size = 1182598 occurrences of file size = 755211 occurrences of file size = 985222 occurrences of file size = 7812804 occurrences of file size = 76Total filesize: 6717161Total filecount: 66142Total files with size < 4096: 32436 -> 49.0399%Out of 266 MB for the entire metacache directory, only 6.41MB (6717161 bytes) is actually storing usable data. About 49% of the files are under the 4096 block size.If we add in the disk space wasted including directories it grows even more:$ du -bs metacache14605231 metacacheThat's 13.93MB (14605231 bytes) for directory data and file data, all to store 6.41MB of real data.Space wasted (1 - 6.41/266 ) is 97.59%I can only imagine how this will scale as more and more files get added. Are there plans to use a database (sqlite?) of some sort to improve disk utilization as well probably improve performance?I saw mention of a solution a month ago. Any updates on this?Other then this, Bittorrent Sync is a very interesting tool. I look forward to it improving. I wish it was open source though... Quote Link to comment Share on other sites More sharing options...
Disappointed Cat Posted May 26, 2013 Report Share Posted May 26, 2013 My metacache (on linux) is 464MB for 265GB data. That's about 0.17%.Are you using the latest 1.0.134 version? Quote Link to comment Share on other sites More sharing options...
2bluesc Posted May 26, 2013 Author Report Share Posted May 26, 2013 My metacache (on linux) is 464MB for 265GB data. That's about 0.17%.Are you using the latest 1.0.134 version?I think we're looking at different things. I'm comparing how much disk space is actually used by the metacache (266 MB) with the actual data stored in the files (6.41 MB). This is the overhead of my filesystem (ext4 on Linux) inefficiently storing 66142 files.My actual file data that is synced is 11GB and I'm running version 1.0.134. Quote Link to comment Share on other sites More sharing options...
Disappointed Cat Posted May 26, 2013 Report Share Posted May 26, 2013 I see. Then I have nothing to add. BTW 266MB for 11GB is still looking weird compared to 464MB for 265GB, I guess you have a lot more small files. Quote Link to comment Share on other sites More sharing options...
rdebath Posted May 28, 2013 Report Share Posted May 28, 2013 The metacache is exactly what it's name suggests a cache.It's actually a cache of torrent files for each file in your share. If the file is needed and it doesn't exist it'll get regenerated; with a modern machine (and spinning disk) and a small file I would expect it to be faster to regenerate the file than it is to fetch the file from disk.If you have "too many" you can delete them. (I don't know if you should stop BTSync first though).I trust the next version will delete some of the files itself; especially in the case where the torrent file takes up as much disk space as the original file. This will be especially important if the data is moved to a sqlite DB as it'll be more difficult to purge old files manually. Quote Link to comment Share on other sites More sharing options...
kos13 Posted May 28, 2013 Report Share Posted May 28, 2013 Please expect significant improvements in metacache in next builds. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.