lua handler aborted: memory allocation error: not enough memory

Yahook nginx-forum at nginx.us
Tue Aug 7 17:00:07 UTC 2012


Hello,

Please help me to solve a problem. I use Lua to get a value from
memcache and then jump into next nginx location and get these errors
from time to time (ofen enaugh).

lua handler aborted: memory allocation error: not enough memory
(lua-atpanic) Lua VM crashed, reason: not enough memory

My Lua code is simple enaugh:
content_by_lua 
'
local memcached = require "resty.memcached";
local memc = memcached:new();

memc:set_timeout(500);

local connection, err = memc:connect("...");
if not connection then
  return ngx.exec("...");
else
  local value, flags, err = memc:get(...);
  local connection, err = memc:close()

  if value   
    return ngx.exec("...");                        
  else
    return ngx.exec("...");
  end
end                
';

My server memory stats:
Mem: 70G Active, 7296M Inact, 11G Wired, 3736M Cache, 9828M Buf, 806M
Free
Swap: 32G Total, 545M Used, 31G Free, 1% Inuse

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,229403,229403#msg-229403



More information about the nginx mailing list