memc-nginx-module
memc-nginx-module copied to clipboard
memc upstream statistics
Is it possible to collect upstream statistics for memc_pass?
I've created the following location for upstream, but nginx doesn't collect any statistics:
log_format main '$host $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" upstream $upstream_response_time TIME: $request_time';
location /memc {
internal;
access_log main;
set $memc_key $arg_key;
set $memc_cmd $arg_cmd;
set $memc_value $arg_val;
set $memc_flags $arg_flags;
set $memc_exptime $arg_exptime;
memc_cmds_allowed get set;
memc_pass memc;
}
I think you need to turn on the log_subrequest directive in your nginx.conf. See
http://wiki.nginx.org/HttpCoreModule#log_subrequest
Best regards, -agentzh
Unfortunately it doesn't work.
Hello!
On Tue, Apr 23, 2013 at 10:13 PM, kayrus [email protected] wrote:
Unfortunately it doesn't work.
It should work as long as you put the "log_subrequest on;" line at the right position. To be safe, you can just put it in the server {} block directly.
-agentzh
BTW, you're using the "access_log" directive in the wrong way. See the documentation for its usage:
http://wiki.nginx.org/HttpLogModule#access_log
That is, instead of writing
access_log main;
You should really write
access_log logs/access.log main;
Otherwise nginx will just log into the file named "main" in the current working directory, with the default "combined" format.
My bad =) Thanks! It works now.