mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-30 02:24:14 +08:00
mdbx: новый размер MDBX_opt_rp_augment_limit по умолчанию в 1/3 от текущего кол-ва страниц в БД.
This commit is contained in:
parent
d963f3a971
commit
4a7a2034c0
3
mdbx.h
3
mdbx.h
@ -2119,7 +2119,8 @@ enum MDBX_option_t {
|
||||
* growth, or/and to the inability of put long values.
|
||||
*
|
||||
* The `MDBX_opt_rp_augment_limit` controls described limit for the current
|
||||
* process. Default is 262144, it is usually enough for most cases. */
|
||||
* process. By default this limit adjusted dynamically to 1/3 of current
|
||||
* quantity of DB pages, which is usually enough for most cases. */
|
||||
MDBX_opt_rp_augment_limit,
|
||||
|
||||
/** \brief Controls the in-process limit to grow a cache of dirty
|
||||
|
@ -5979,8 +5979,8 @@ __cold static void munlock_all(const MDBX_env *env) {
|
||||
}
|
||||
|
||||
__cold static unsigned default_rp_augment_limit(const MDBX_env *env) {
|
||||
/* default rp_augment_limit = ceil(npages / gold_ratio) */
|
||||
const size_t augment = (env->me_dbgeo.now >> (env->me_psize2log + 10)) * 633u;
|
||||
/* default rp_augment_limit = npages / 3 */
|
||||
const size_t augment = env->me_dbgeo.now / 3 >> env->me_psize2log;
|
||||
eASSERT(env, augment < MDBX_PGL_LIMIT);
|
||||
return pnl_bytes2size(pnl_size2bytes(
|
||||
(augment > MDBX_PNL_INITIAL) ? augment : MDBX_PNL_INITIAL));
|
||||
|
Loading…
x
Reference in New Issue
Block a user