如何针对Heroku路由器优化uWSGI'代理/缓冲情况?

时间:2014-12-19 18:13:53

标签: python heroku uwsgi

我已经在heroku上使用uWSGI超过一年了,它似乎比Gunicorn处理得更好。随着我们的流量扩大,我试图更好地理解heroku的路由器和uWSGI之间的接口,以便优化和预防问题,但它对我来说仍然非常不透明,我有几个问题。

现在,我使用了相当普通的uwsgi配置:

#heroku setup: see https://github.com/unbit/uwsgi-docs/blob/master/tutorials/heroku_python.rst
http-socket = :$(PORT)
master = true
die-on-term = true
harakiri = 20
harakiri-verbose
reload-mercy = 8
max-requests = 2000
# processes = 5 # set from env var WEB_CONCURRENCY ( see Procfile)
# the below is required by new relic. be sure to monitor your system
# memory since we're enabling threads
# https://newrelic.com/docs/python/python-agent-and-uwsgi
# http://uwsgi-docs.readthedocs.org/en/latest/Options.html
enable-threads = true
single-interpreter = true

# the module
module = publisher.wsgi

阅读Heroku的文档,听起来像heroku代理做了几件有些独特的事情,我想知道我是否需要对uWSGI做一些特殊的事情来优化这个环境。例如

1)Heroku will send 50 requests to the dyno(即uwsgi)在开始排队之前同时进行

2)Heroku的own flavor of request buffering可能影响或不影响uwsgi。

我特别想知道是否应该启用post-buffering,调整buffer-size,或者调整许多uWSGI设置中的任何其他设置以获得更好的性能,或者在Heroku路由器后面运行时防止出现问题。

0 个答案:

没有答案
相关问题