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

Usage within multiprocess environment (like gunicorn) #34

Open
jonathanq opened this issue Oct 8, 2014 · 1 comment
Open

Usage within multiprocess environment (like gunicorn) #34

jonathanq opened this issue Oct 8, 2014 · 1 comment

Comments

@jonathanq
Copy link

Is there any way to use this library within a multiprocess environment, like when run with Gunicorn (with workers > 1).

Currently each process will collect metrics - and if you want to expose them with Flask statsHandler, it will fail to bind due to all using the same port. This can be disabled or fixed by doing your own stats handler.

However the metrics which are gathered would be per-process. If you enable the graphite writer, each process will write out metrics with the same hostname and then clobber the other processes.

Is there a way around this?

Only (quick) idea I have come up with is using PID of each process to uniquely prefix the metrics. But then when a process is restarted, it will cause lots of extra data to be written on Graphite server.

I am looking into using the gunicorn hooks as well - but wanted to check here first if this is something already solved?

@PeterScott
Copy link
Member

There is no built-in support for anything like this, I'm afraid.

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