Skip to content
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 · Fixed by #839
Closed

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

alq666 opened this issue Jul 30, 2014 · 3 comments · Fixed by #839

Comments

@alq666
Copy link
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
Copy link
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
Copy link
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
Copy link
Contributor Author

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" [email protected] 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants