mirror of
https://github.com/matrix-construct/construct
synced 2024-09-30 12:48:54 +02:00
ircd::db: request pool conf item set callback.
This commit is contained in:
parent
6cdb1bba63
commit
b753637385
2 changed files with 24 additions and 10 deletions
32
ircd/db.cc
32
ircd/db.cc
|
@ -74,6 +74,25 @@ ircd::db::rog
|
||||||
"rdb", 'R'
|
"rdb", 'R'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ircd::conf::item<size_t>
|
||||||
|
ircd::db::request_pool_stack_size
|
||||||
|
{
|
||||||
|
{ "name", "ircd.db.request_pool.stack_size" },
|
||||||
|
{ "default", long(128_KiB) },
|
||||||
|
};
|
||||||
|
|
||||||
|
ircd::conf::item<size_t>
|
||||||
|
ircd::db::request_pool_size
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{ "name", "ircd.db.request_pool.size" },
|
||||||
|
{ "default", 32L },
|
||||||
|
}, []
|
||||||
|
{
|
||||||
|
request.set(size_t(request_pool_size));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/// Concurrent request pool. Requests to seek may be executed on this
|
/// Concurrent request pool. Requests to seek may be executed on this
|
||||||
/// pool in cases where a single context would find it advantageous.
|
/// pool in cases where a single context would find it advantageous.
|
||||||
/// Some examples are a db::row seek, or asynchronous prefetching.
|
/// Some examples are a db::row seek, or asynchronous prefetching.
|
||||||
|
@ -85,15 +104,8 @@ decltype(ircd::db::request)
|
||||||
ircd::db::request
|
ircd::db::request
|
||||||
{
|
{
|
||||||
"db req",
|
"db req",
|
||||||
128_KiB, // stack size (must be adequate for transfer to rocksdb)
|
size_t(request_pool_stack_size),
|
||||||
0, // don't prespawn because this is static
|
0, // don't prespawn because this is static
|
||||||
};
|
|
||||||
|
|
||||||
ircd::conf::item<size_t>
|
|
||||||
request_pool_default
|
|
||||||
{
|
|
||||||
{ "name", "ircd.db.request_pool.default" },
|
|
||||||
{ "default", 32L }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -115,7 +127,7 @@ ircd::db::init::init()
|
||||||
{
|
{
|
||||||
init_compressions();
|
init_compressions();
|
||||||
init_directory();
|
init_directory();
|
||||||
request.add(size_t(request_pool_default));
|
request.add(request_pool_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ircd::db::init::~init()
|
ircd::db::init::~init()
|
||||||
|
|
|
@ -39,6 +39,8 @@ namespace ircd::db
|
||||||
const auto DEFAULT_READAHEAD = 4_MiB;
|
const auto DEFAULT_READAHEAD = 4_MiB;
|
||||||
|
|
||||||
extern log::log rog;
|
extern log::log rog;
|
||||||
|
extern conf::item<size_t> request_pool_size;
|
||||||
|
extern conf::item<size_t> request_pool_stack_size;
|
||||||
extern ctx::pool request;
|
extern ctx::pool request;
|
||||||
|
|
||||||
string_view reflect(const rocksdb::Env::Priority &p);
|
string_view reflect(const rocksdb::Env::Priority &p);
|
||||||
|
|
Loading…
Reference in a new issue