简体   繁体   English

我们如何分析每个 Celery 任务的 memory 使用情况?

[英]How can we profile memory usage of each Celery task?

I run tests using pytest which in turn runs a couple of celery tasks.我使用 pytest 运行测试,然后运行几个 celery 任务。 But, when I use但是,当我使用

mprof run --include-children py.test test.py

I am not able to track the memory consumed by each celery task that is running inside a celery worker.我无法跟踪在 celery 工作人员内部运行的每个 celery 任务消耗的 memory。 All I could see 50 MB of RAM being consumed by the py.test process (which I am able see in the mprof plot) whereas the celery worker consumes around 600-700 MB of RAM which does not get reflected in the mprof plot.我只能看到 py.test 进程消耗了 50 MB 的 RAM(我可以在 mprof 图中看到),而 celery 工作人员消耗了大约 600-700 MB 的 RAM,这没有反映在 mprof plot 中。 How can I plot the memory consumption of each Celery task triggered by the py.test?我怎样才能plot memory消耗每个Celery任务由py.test触发?

PS I use memory profiler package to profile the memory consumption of a python script. PS 我使用 memory 分析器 package 来分析 memory 对 Z23EEEB4347BDD756BFCDDZ 脚本的消耗。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM