mdbx: новый размер MDBX_opt_rp_augment_limit по умолчанию в 1/3 от текущего кол-ва страниц в БД.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2023-11-28 21:33:57 +03:00
parent d963f3a971
commit 4a7a2034c0
2 changed files with 4 additions and 3 deletions

3
mdbx.h
View File

@ -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

View File

@ -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));