diff --git a/include/ircd/fs/support.h b/include/ircd/fs/support.h index 98b158a5d..a285dc476 100644 --- a/include/ircd/fs/support.h +++ b/include/ircd/fs/support.h @@ -33,6 +33,9 @@ namespace ircd::fs::support // Test if fallocate() is supported at target path bool fallocate(const string_view &path, const write_opts &wopts = write_opts_default); + // Get the limit for number of opened files + size_t rlimit_nofile(); + // Dump information to infolog void dump_info(); } diff --git a/ircd/db.cc b/ircd/db.cc index 476319f5a..fdd03f86d 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -1182,9 +1182,7 @@ try // 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. + opts->max_open_files = fs::support::rlimit_nofile(); // TODO: Check if these values can be increased; RocksDB may keep // thread_local state preventing values > 1. diff --git a/ircd/fs.cc b/ircd/fs.cc index 305d030f4..9d8bc2915 100644 --- a/ircd/fs.cc +++ b/ircd/fs.cc @@ -12,6 +12,7 @@ #include #include