[Tarantool-patches] [PATCH] sql: increase default cache size

Sergey Ostanevich sergos at tarantool.org
Fri Dec 11 17:12:32 MSK 2020


Hi!

Thanks for the patch! Since the memory allocation is done on per-request
basis, there’s no impact on the memory consumption beyond these requests.
Still it gives a real boost, so LGTM.

Create follow-up ticket to provide a user-visible runtime option under
box.cfg

Sergos



> On 11 Dec 2020, at 01:37, Leonid Vasiliev <lvasiliev at tarantool.org> wrote:
> 
> Increase the maximum number of in-memory pages to use
> for temporary tables.
> (https://www.sqlite.org/compile.html#default_cache_size)
> 
> Part of #5609
> ---
> 
> Hi SQL team. It is a simplest part of #5609.
> This patch increases the default SQL cache size by 10 times to 20 MB.
> A similar experiment shows a 10% performance increase for some datasets.
> (https://github.com/tarantool/tarantool/issues/5593#issuecomment-740044007).
> Mons approved these changes. I haven't done any research to determine the
> optimal value. So feel free to throw this patch away.
> 
> https://github.com/tarantool/tarantool/issues/5609
> https://github.com/tarantool/tarantool/tree/lvasiliev/gh-5609-increase-default-sql-sort-cache-size
> 
> src/box/CMakeLists.txt | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/src/box/CMakeLists.txt b/src/box/CMakeLists.txt
> index 19203f7..7372179 100644
> --- a/src/box/CMakeLists.txt
> +++ b/src/box/CMakeLists.txt
> @@ -218,6 +218,10 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
>   add_definitions(-DSQL_DEBUG=1)
> endif()
> add_definitions(-DSQL_TEST=1)
> +# Set the maximum number of in-memory pages to use for temporary tables.
> +# 20000 * 1024 = 20480000 bytes.
> +# (https://www.sqlite.org/compile.html#default_cache_size)
> +add_definitions(-DSQL_DEFAULT_CACHE_SIZE=-20000)
> 
> set(EXT_SRC_DIR ${CMAKE_SOURCE_DIR}/extra)
> set(EXT_BIN_DIR ${CMAKE_BINARY_DIR}/extra)
> -- 
> 2.7.4
> 



More information about the Tarantool-patches mailing list