【发布时间】:2015-03-21 04:32:00
【问题描述】:
如何使用 python cProfile 在 gunicorn 上运行时配置 Django 应用程序。
我可以在开发模式下进行分析:
python -m cProfile -o sample.profile manage.py runserver
但是当它使用 gunicorn 在生产服务器中运行时我该怎么办?
【问题讨论】:
-
认为
web: args在工头中工作,但猜猜I'm not...! -
我认为没有什么好的方法可以使用 cProfile 来分析在 gunicorn 下运行的 django 应用程序。你需要弄清楚什么?我发现使用日志系统来跟踪我的视图执行所需的时间是最有用的。
-
你可以看看这个用于 Django 的分析器:github.com/django-silk/silk 它在内部使用 cProfile。
标签: python django profiler gunicorn cprofile