From 52471a2e9bdd0e01988cbe59ead2e898f95a2ea9 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Fri, 22 Nov 2024 21:42:47 +0800 Subject: [PATCH] feat(db): restore default db page size --- kong/db/strategies/connector.lua | 4 ++-- kong/db/strategies/init.lua | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kong/db/strategies/connector.lua b/kong/db/strategies/connector.lua index 719ef8078ca5..3f03cddc11f7 100644 --- a/kong/db/strategies/connector.lua +++ b/kong/db/strategies/connector.lua @@ -5,8 +5,8 @@ local fmt = string.format local Connector = { defaults = { pagination = { - page_size = 512, -- work with lmdb - max_page_size = 512, -- work with lmdb + page_size = 1000, + max_page_size = 50000, }, }, } diff --git a/kong/db/strategies/init.lua b/kong/db/strategies/init.lua index 90f7968a1ec7..99a5588d07d8 100644 --- a/kong/db/strategies/init.lua +++ b/kong/db/strategies/init.lua @@ -33,6 +33,12 @@ function _M.new(kong_config, database, schemas, errors) do local base_connector = require "kong.db.strategies.connector" + + -- lmdb will not support huge page size + if database == "off" then + base_connector.defaults.pagination.max_page_size = 2048 + end + local mt = getmetatable(connector) setmetatable(mt, { __index = function(t, k)