You can clone with
I'm using several lua_shared_dicts which work fine as LRU caches, but seem to log "ngx_slab_alloc() failed: no memory in lua_shared_dict" errors to the nginx error.log on eviction. It would be nice if the shared dictionaries didn't cause errors when operating normally as those errors may mask real problems that need investigating.
This problem was seen using simpl-ngx_devel_kit-v0.2.17-0-gbc97eea and chaoslawful-lua-nginx-module-v0.5.0rc28-0-g7a7ac79.
The error is generated in nginx core, so ngx_lua cannot stop it from logging. If you have expire times set then you can do something like this:
local cats = ngx.shared.cats
local succ, err, forcible = cats:set("Marry", "it is a nice cat!")
if forcible then
And it will flush the expired entries. This use case was the reason I suggested flush_expired.
I'd copy what Brian Akins has said. Consider it resolved.