Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dbwrapper: Bump max file size to 32 MiB
The default max file size for LevelDB is 2 MiB, which results in the LevelDB compaction code generating ~4 disk cache flushes per second when syncing with the Bitcoin network. These disk cache flushes are triggered by fdatasync() syscall issued by the LevelDB compaction code when reaching the max file size. If the database is on a HDD this flush rate brings the whole system to a crawl. It also results in very slow throughput since 2 MiB * 4 flushes per second is about 8 MiB / second max throughput, while even an old HDD can pull 100 - 200 MiB / second streaming throughput. Increase the max file size for LevelDB to 32 MiB instead so the flush rate drops significantly and the system no longer gets so sluggish. The new max file size value chosen is a compromise between the one that works best for HDD and SSD performance, as determined by benchmarks done by various people.
- Loading branch information