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

Do not log the number of workers all the time #834

Closed
alq666 opened this Issue Jul 30, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@alq666
Contributor

alq666 commented Jul 30, 2014

To support statsD instrumentation, manage_workers logs the number of workers, which is unsightly in logs.

While the call will remain to have smoother statsd data, no log line will be generated.

@tilgovi

This comment has been minimized.

Show comment
Hide comment
@tilgovi

tilgovi Jul 30, 2014

Collaborator

The statsd integration via the logging system is really convenient. I wonder if it has any need to respect log level at all, though. After all, it's designed to be really cheap to send metrics and not every log call generates metrics. So maybe we can just ensure that metrics are sent even if the log level is disabled (assuming logging will still bubble it up to the gunicorn handler) and just move the worker count to a debug log level.

Collaborator

tilgovi commented Jul 30, 2014

The statsd integration via the logging system is really convenient. I wonder if it has any need to respect log level at all, though. After all, it's designed to be really cheap to send metrics and not every log call generates metrics. So maybe we can just ensure that metrics are sent even if the log level is disabled (assuming logging will still bubble it up to the gunicorn handler) and just move the worker count to a debug log level.

@benoitc

This comment has been minimized.

Show comment
Hide comment
@benoitc

benoitc Aug 1, 2014

Owner

i concur with @tilgovi can't we log only when the number changes? It can be moved at the end of the spawn_workers function or in the if case after the execution of the function.

Thoughts?

Owner

benoitc commented Aug 1, 2014

i concur with @tilgovi can't we log only when the number changes? It can be moved at the end of the spawn_workers function or in the if case after the execution of the function.

Thoughts?

@alq666

This comment has been minimized.

Show comment
Hide comment
@alq666

alq666 Aug 1, 2014

Contributor

Statsd works better if it is feed gauges regularly. I will remove the
logging entry from any file and simply generate the metric in manage
workers.

I may also generate a spawn rate metric in spawn workers to catch cases
when there is a lot of churn.

Either way I will submit a PR over the weekend to clean up the log rapidly.
On Aug 1, 2014 3:09 AM, "Benoit Chesneau" notifications@github.com wrote:

i concur with @tilgovi https://github.com/tilgovi can't we lof (
https://github.com/benoitc/gunicorn/blob/master/gunicorn/arbiter.py#L485-L488)
only when the number changes? It can be moved at the end of the
spawn_workers
https://github.com/benoitc/gunicorn/blob/master/gunicorn/arbiter.py#L532
function or in the if case
https://github.com/benoitc/gunicorn/blob/master/gunicorn/arbiter.py#L476
after the execution of the function.

Thoughts?


Reply to this email directly or view it on GitHub
#834 (comment).

Contributor

alq666 commented Aug 1, 2014

Statsd works better if it is feed gauges regularly. I will remove the
logging entry from any file and simply generate the metric in manage
workers.

I may also generate a spawn rate metric in spawn workers to catch cases
when there is a lot of churn.

Either way I will submit a PR over the weekend to clean up the log rapidly.
On Aug 1, 2014 3:09 AM, "Benoit Chesneau" notifications@github.com wrote:

i concur with @tilgovi https://github.com/tilgovi can't we lof (
https://github.com/benoitc/gunicorn/blob/master/gunicorn/arbiter.py#L485-L488)
only when the number changes? It can be moved at the end of the
spawn_workers
https://github.com/benoitc/gunicorn/blob/master/gunicorn/arbiter.py#L532
function or in the if case
https://github.com/benoitc/gunicorn/blob/master/gunicorn/arbiter.py#L476
after the execution of the function.

Thoughts?


Reply to this email directly or view it on GitHub
#834 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment