-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgunicorn_config.py
More file actions
40 lines (32 loc) · 937 Bytes
/
gunicorn_config.py
File metadata and controls
40 lines (32 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Gunicorn 設定ファイル
# gunicorn_config.py
import multiprocessing
# サーバーソケット
bind = "0.0.0.0:8000"
backlog = 2048
# ワーカープロセス
workers = multiprocessing.cpu_count() * 2 + 1
worker_class = "sync"
worker_connections = 1000
timeout = 30
keepalive = 2
# リソース制限
max_requests = 1000
max_requests_jitter = 50
preload_app = True
# ログ設定
accesslog = "/var/log/kokkosofter/gunicorn_access.log"
errorlog = "/var/log/kokkosofter/gunicorn_error.log"
loglevel = "info"
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
# プロセス管理
# pidfile = "/var/run/kokkosofter/gunicorn.pid" # systemdで管理するので無効化
user = "www-data"
group = "www-data"
daemon = False
# セキュリティ
limit_request_line = 4094
limit_request_fields = 100
limit_request_field_size = 8190
# 作業ディレクトリの設定
chdir = "/var/www/kokkosofter"