Skip to content

memc upstream statistics #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kayrus opened this issue Apr 23, 2013 · 5 comments
Open

memc upstream statistics #9

kayrus opened this issue Apr 23, 2013 · 5 comments

Comments

@kayrus
Copy link

kayrus commented Apr 23, 2013

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;
    }
@agentzh
Copy link
Member

agentzh commented Apr 23, 2013

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

@kayrus
Copy link
Author

kayrus commented Apr 24, 2013

Unfortunately it doesn't work.

@agentzh
Copy link
Member

agentzh commented Apr 24, 2013

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

@agentzh
Copy link
Member

agentzh commented Apr 24, 2013

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.

@kayrus
Copy link
Author

kayrus commented Apr 24, 2013

My bad =) Thanks! It works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants