0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::db: Add descriptor field for level0 compaction trigger.

This commit is contained in:
Jason Volk 2022-07-29 18:55:22 -07:00
parent 3139050e45
commit e38825030f
2 changed files with 10 additions and 5 deletions

View file

@ -131,4 +131,12 @@ struct ircd::db::descriptor
{
8192
};
/// The number of level0 files allowed to buffer before compacting. Too
/// much data at level0 will slow down queries, but too much compaction
/// will increase IOPS for the server with constant reorganization.
size_t compaction_trigger
{
2
};
};

View file

@ -1784,11 +1784,8 @@ ircd::db::database::column::column(database &d,
(this->options.max_write_buffer_number * 6):
48;
this->options.level0_file_num_compaction_trigger = 2;
//TODO: for bulk ingest/bootstrap:
// this->options.compaction_style == rocksdb::kCompactionStyleUniversal?
// (this->options.max_write_buffer_number * 2):
// 4;
//TODO: bulk ingest/bootstrap: (this->options.max_write_buffer_number * 2):
this->options.level0_file_num_compaction_trigger = this->descriptor->compaction_trigger;
// Universal compaction mode options
auto &universal(this->options.compaction_options_universal);