ngx.shared_dict.get_keys usage

Suraj Kumar suraj.kumar at inmobi.com
Wed Aug 6 06:44:10 UTC 2014


Hi,

I'm trying to use the lua module in combination with ngx.shared.DICT
feature to record some statistics for nginx (and upstreams') health
monitoring.

When I do dict.get_keys(100), I see the following error in nginx error.log:

2014/08/06 06:27:55 [error] 13446#0: *1 lua entry thread aborted: runtime
error: /opt/inmobi/nginx/customlua/logging.lua:56: bad argument #1 to
'get_keys' (userdata expected, got number)
stack traceback:
coroutine 0:
        [C]: in function 'get_keys'
        /opt/inmobi/nginx/customlua/logging.lua:56: in function
'get_all_plots'
        [string "content_by_lua"]:3: in function <[string
"content_by_lua"]:1>, client: 127.0.0.1, server: , request: "GET /stat2
HTTP/1.1", host: "localhost"

I'm using ngx_openresty version: ngx_openresty/1.2.4.11

Could someone please guide me how to use the get_keys method of the shared
dict in nginx/lua?

Cheers,

  -Suraj

[1] Much in the spirit of
http://blog.cloudflare.com/pushing-nginx-to-its-limit-with-lua

-- 
An Onion is the Onion skin and the Onion under the skin until the Onion
Skin without any Onion underneath.

-- 
_____________________________________________________________
The information contained in this communication is intended solely for the 
use of the individual or entity to whom it is addressed and others 
authorized to receive it. It may contain confidential or legally privileged 
information. If you are not the intended recipient you are hereby notified 
that any disclosure, copying, distribution or taking any action in reliance 
on the contents of this information is strictly prohibited and may be 
unlawful. If you have received this communication in error, please notify 
us immediately by responding to this email and then delete it from your 
system. The firm is neither liable for the proper and complete transmission 
of the information contained in this communication nor for any delay in its 
receipt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140806/eabbbf98/attachment-0001.html>


More information about the nginx mailing list