52

gunicorn のドキュメントには、設定ファイルの編集について書かれていますが、それがどこにあるのかわかりません。

おそらく簡単な答えです:)私はAmazon Linux AMIを使用しています。

4

5 に答える 5

49

答えは、gunicorn のドキュメントにあります。 http://docs.gunicorn.org/en/latest/configure.html

.ini または python スクリプトを使用して構成ファイルを指定できます。

たとえば、django-skel プロジェクトから

"""gunicorn WSGI server configuration."""
from multiprocessing import cpu_count
from os import environ


def max_workers():    
    return cpu_count()


bind = '0.0.0.0:' + environ.get('PORT', '8000')
max_requests = 1000
worker_class = 'gevent'
workers = max_workers()

そして、次を使用してサーバーを実行できます

gunicorn -c gunicorn.py.ini project.wsgi

project.wsgi は wsgi の場所に対応することに注意してください。

于 2012-11-12T09:03:16.690 に答える