mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use fallocate to prevent excessive allocation of sst files and logs
Summary: On some filesystems, pre-allocation can be a considerable amount of space. xfs in our production environment pre-allocates by 1GB, for instance. By using fallocate to inform the kernel of our expected file sizes, we eliminate this wasteage (that isn't recovered until the file is closed which, in the case of LOG files, can be a considerable amount of time). Test Plan: created an xfs loopback filesystem, mounted with allocsize=4M, and ran db_stress. LOG file without this change was 4M, and with it it was 128k then grew to normal size. Reviewers: dhruba Reviewed By: dhruba CC: adsharma, leveldb Differential Revision: https://reviews.facebook.net/D7953
This commit is contained in:
@@ -56,7 +56,9 @@ Options::Options()
|
||||
compaction_filter_args(NULL),
|
||||
CompactionFilter(NULL),
|
||||
disable_auto_compactions(false),
|
||||
WAL_ttl_seconds(0){
|
||||
WAL_ttl_seconds(0),
|
||||
manifest_preallocation_size(4 * 1024 * 1024) {
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@@ -144,8 +146,10 @@ Options::Dump(Logger* log) const
|
||||
CompactionFilter);
|
||||
Log(log," Options.disable_auto_compactions: %d",
|
||||
disable_auto_compactions);
|
||||
Log(log," Options.WAL_ttl_seconds: %ld",
|
||||
Log(log," Options.WAL_ttl_seconds: %ld",
|
||||
WAL_ttl_seconds);
|
||||
Log(log," Options.manifest_preallocation_size: %ld",
|
||||
manifest_preallocation_size);
|
||||
} // Options::Dump
|
||||
|
||||
} // namespace leveldb
|
||||
|
||||
Reference in New Issue
Block a user