mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
construct: Add program option to disable direct IO.
This commit is contained in:
parent
80d0db9f26
commit
60a0694853
4 changed files with 4 additions and 1 deletions
|
@ -57,6 +57,7 @@ lgetopt opts[] =
|
|||
{ "checkdb", &ircd::checkdb, lgetopt::BOOL, "Perform complete checks of databases when opening" },
|
||||
{ "pitrecdb", &ircd::pitrecdb, lgetopt::BOOL, "Allow Point-In-Time-Recover if DB reports corruption after crash" },
|
||||
{ "nojs", &ircd::nojs, lgetopt::BOOL, "Disable SpiderMonkey JS subsystem from initializing. (noop when not available)." },
|
||||
{ "nodirect", &ircd::nodirect, lgetopt::BOOL, "Disable direct IO (O_DIRECT) for unsupporting filesystems." },
|
||||
{ nullptr, nullptr, lgetopt::STRING, nullptr },
|
||||
};
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace ircd
|
|||
extern bool checkdb; ///< Perform checks on database opens
|
||||
extern bool pitrecdb; ///< Allow Point-In-Time Recovery if DB corrupt.
|
||||
extern bool nojs; ///< Option to not init js subsystem.
|
||||
extern bool nodirect; ///< Option to not use direct IO (O_DIRECT).
|
||||
}
|
||||
|
||||
#include "string_view.h"
|
||||
|
|
|
@ -772,7 +772,7 @@ try
|
|||
opts.allow_concurrent_memtable_write = false;
|
||||
opts.enable_write_thread_adaptive_yield = false;
|
||||
opts.enable_pipelined_write = false;
|
||||
opts.use_direct_reads = true;
|
||||
opts.use_direct_reads = !ircd::nodirect;
|
||||
opts.write_thread_max_yield_usec = 0;
|
||||
opts.write_thread_slow_yield_usec = 0;
|
||||
opts.use_direct_io_for_flush_and_compaction = false;
|
||||
|
|
|
@ -19,6 +19,7 @@ namespace ircd
|
|||
bool checkdb; // check databases when opening
|
||||
bool pitrecdb; // point-in-time recovery for db
|
||||
bool nojs; // no ircd::js system init.
|
||||
bool nodirect; // no use of O_DIRECT.
|
||||
|
||||
std::string _hostname; // user's supplied param
|
||||
boost::asio::io_context *ios; // user's io service
|
||||
|
|
Loading…
Reference in a new issue