diff --git a/mdbx.h b/mdbx.h index abaa303f..15122715 100644 --- a/mdbx.h +++ b/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 diff --git a/src/core.c b/src/core.c index 474bec75..7cf33456 100644 --- a/src/core.c +++ b/src/core.c @@ -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));