diff --git a/src/ngx_lua_resty_lmdb_module.c b/src/ngx_lua_resty_lmdb_module.c index b4dc584..5daa4cb 100644 --- a/src/ngx_lua_resty_lmdb_module.c +++ b/src/ngx_lua_resty_lmdb_module.c @@ -235,6 +235,7 @@ ngx_lua_resty_lmdb_open_file(ngx_cycle_t *cycle, /* Set max readers depending on the number of worker processes */ ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); readers = (size_t) ccf->worker_processes + NGX_LUA_RESTY_LMDB_MAX_READERS_REDUNDANCY; + if (readers < NGX_LUA_RESTY_LMDB_DEFAULT_READERS) { readers = NGX_LUA_RESTY_LMDB_DEFAULT_READERS; }