Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Log spam on shared dictionary eviction #163

Closed
jimpurbrick opened this Issue · 2 comments

3 participants

@jimpurbrick

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.

Thanks,

Jim

@bakins

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
    cats:flush_expired()
end    

And it will flush the expired entries. This use case was the reason I suggested flush_expired.

@agentzh
Owner

I'd copy what Brian Akins has said. Consider it resolved.

@agentzh agentzh closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.