borntyping / supermann

A process monitor that connects Supervisor and Riemann
https://supermann.readthedocs.org/en/latest/
MIT License
18 stars 5 forks source link

Incorrect metric values for multi processes #15

Open sallyruthstruik opened 6 years ago

sallyruthstruik commented 6 years ago

Looks like metric you send doesn't consider suprocesses. For example, I run gunicorn with 8 workers:

gunicorn wsgi:app -w 8

and write in stderr your rss:absolute metric and sum of children values:

logging.error("{}-{}".format(
        memory_info.rss,
        sum(p.memory_info().rss for p in process.children())
    ))

And I got

20766720-1070051328

So master process take ~20Mb but with children processes it takes about 1Gb of memory.

I think better solution is to allow metrics to take an account of their child processes. But in this way it is unclear how to calculate percentage values.

sallyruthstruik commented 6 years ago

Fix example: https://github.com/borntyping/supermann/pull/14/commits/787a07474fcdee82f38392982da3f36ba06f3f14