Skip to content
This repository

Log spam on shared dictionary eviction #163

Closed
jimpurbrick opened this Issue October 11, 2012 · 2 comments

3 participants

Jim Purbrick Yichun Zhang Brian Akins
Jim Purbrick

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

Brian Akins
Collaborator

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.

Yichun Zhang
Collaborator

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

Yichun Zhang agentzh closed this October 15, 2012
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.