In the bitcoind log there are many entries similar to this:
Pre-allocating up to position 0x200000 in rev02037.dat
There are often several messages regarding pre-allocation of the same file. This is concerning because copy-on-write filesystems (such as BTRFS, in my case) have to allocate new extents when files are written in this manner. Such writes cause an increase in filesystem metadata block consumption, which of course eats away at the overall available storage. For example, here are the size and number of extents consumed by two of the files:
# ls -lh *02036.dat -rw------- 1 bitcoin bitcoin 128M Apr 16 16:49 blk02036.dat -rw------- 1 bitcoin bitcoin 17M Apr 16 16:49 rev02036.dat # filefrag *02036.dat blk02036.dat: 87 extents found rev02036.dat: 103 extent found
Both files consume more extents than what they actually need considering their sizes. After defragging them with
btrfs filesystem defrag they were rewritten and now only consume one extent each.
Since the blk and rev files each tend to be roughly the same size, I prefer to have bitcoind perform the allocations such that it's most likely to only need to perform one pre-allocation. Is there such a configuration option available?