Welcome! Log In Create A New Profile

Advanced

ngx.shared_dict.get_keys usage

Suraj Kumar
August 06, 2014 02:46AM
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.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

ngx.shared_dict.get_keys usage

Suraj Kumar August 06, 2014 02:46AM

Re: ngx.shared_dict.get_keys usage

Suraj Kumar August 06, 2014 02:58AM

Re: ngx.shared_dict.get_keys usage

smallfish August 06, 2014 03:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 220
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready