mirror of
https://github.com/matrix-construct/construct
synced 2024-11-12 04:51:08 +01:00
ircd::db: Improve fd limit range in db opts.
This commit is contained in:
parent
5c2ce1f20c
commit
ec6c3bbc0f
1 changed files with 5 additions and 3 deletions
|
@ -1091,9 +1091,11 @@ try
|
|||
// MUST be 0 or std::threads are spawned in rocksdb.
|
||||
opts->max_file_opening_threads = 0;
|
||||
|
||||
// TODO: We should hint rocksdb with a harder value so it doesn't
|
||||
// potentially eat up all our fd's.
|
||||
opts->max_open_files = ircd::info::rlimit_nofile / 2;
|
||||
// limit maxfdto prevent too many small files degrading read perf; too low is
|
||||
// bad for write perf.
|
||||
opts->max_open_files = ircd::info::rlimit_nofile?
|
||||
std::min(ircd::info::rlimit_nofile, 256UL): // limit when rlimit supported
|
||||
256UL; // default when rlimit not supported.
|
||||
|
||||
// TODO: Check if these values can be increased; RocksDB may keep
|
||||
// thread_local state preventing values > 1.
|
||||
|
|
Loading…
Reference in a new issue