lua-resty-redis icon indicating copy to clipboard operation
lua-resty-redis copied to clipboard

Frosen while operation keys("*")

Open AlexProfi opened this issue 6 years ago • 1 comments
trafficstars

Hello I use this code to get all data from db Count of all is 200k One record contain 10 symbols

local master, err = rc:connect_via_sentinel(params)
local res, err = master:keys("*")
            
            if not res then
                ngx.say("Failed to get fingerprints of certificates: ", err)
                return
            end
            
            if res == ngx.null or table.getn(res) == 0 then
                ngx.say("Fingerprints not found.")
                return
            else
                ngx.say("All fingerprints")
                
                for i, r in pairs(res) do
                    ngx.say(i, ") ", r)
                end
            end

I get master from sentinel and work with it . So I don't include code of getting master It works fine with not more records

AlexProfi avatar Mar 25 '19 10:03 AlexProfi

@AlexProfi I don't understand what your problem is. It's too vague to me. Maybe you are just fetching too much data out of redis at a single time and exhausting your machine's memory (like triggering swapping)?

agentzh avatar Mar 28 '19 21:03 agentzh