From dc3404160088e46925a40f6a6e66c3c176a0eafc Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Fri, 22 Jan 2021 23:15:08 +0300 Subject: [PATCH] mdbx: alter defaults for `MDBX_opt_rp_augment_limit` and `MDBX_opt_txn_dp_limit` runtime options. Change-Id: I08cdbfb18089a3fed4b32d931ca4423027a9939f --- mdbx.h | 6 ++---- src/core.c | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/mdbx.h b/mdbx.h index 6461ab6d..f9ba3418 100644 --- a/mdbx.h +++ b/mdbx.h @@ -1849,8 +1849,7 @@ 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 1048576, i.e. 2**20. This is sure enough for databases - * up to 4Gb with 4K page size. */ + * process. Default is 262144, it is usually enough for most cases. */ MDBX_opt_rp_augment_limit, /** \brief Controls the in-process limit to grow a list of @@ -1878,8 +1877,7 @@ enum MDBX_option_t { * spill to disk instead. * * The `MDBX_opt_txn_dp_limit` controls described threshold for the current - * process. Default is 1048576, i.e. 2**20. This is sure enough for databases - * up to 4Gb with 4K page size. */ + * process. Default is 65536, it is usually enough for most cases. */ MDBX_opt_txn_dp_limit, /** \brief Controls the in-process initial allocation size for dirty pages diff --git a/src/core.c b/src/core.c index 26704fd4..9bd75c6c 100644 --- a/src/core.c +++ b/src/core.c @@ -9922,8 +9922,8 @@ __cold int mdbx_env_create(MDBX_env **penv) { env->me_stuck_meta = -1; env->me_options.dp_reserve_limit = 1024; - env->me_options.rp_augment_limit = 1024 * 1024; - env->me_options.dp_limit = 1024 * 1024; + env->me_options.rp_augment_limit = 256 * 1024; + env->me_options.dp_limit = 64 * 1024; if (env->me_options.dp_limit > MAX_PAGENO - NUM_METAS) env->me_options.dp_limit = MAX_PAGENO - NUM_METAS; env->me_options.dp_initial = MDBX_PNL_INITIAL;