agentzh/lua-rds-parser — Issue #2: possible memory leak
Author: bearnard
Created: 2011-11-06 10:24:33+00:00
State: open

access_by_lua '
local host = string.match(ngx.var.vhost, "[%a.]*")
local resp = ngx.location.capture("/drizzlelookup", { method = ngx.HTTP_GET, args = {host = host} })

if resp.status ~= ngx.HTTP_OK or not resp.body then
error("failed to query mysql")
end

local parser = require "rds.parser"
local res, err = parser.parse(resp.body)
if res == nil then
error("failed to parse Json: " .. err)
end
';

This simple snippet in a location after many hours of load will end up with nginx worker processes eating up mang gigs or ram.