|
| 1 | +[uwsgi] |
| 2 | +http-websockets = true |
| 3 | +module = app.main:web_app |
| 4 | +master = true |
| 5 | +gevent = 1000 |
| 6 | + |
| 7 | +need-app = true ; Start fails if app not loaded |
| 8 | +strict = true ; Enable strict mode to fully respect config |
| 9 | +enable-threads = true ; Multithreading |
| 10 | +vacuum = true ; Delete sockets during shutdown |
| 11 | +single-interpreter = true ; Enable single-interpreter mode |
| 12 | +die-on-term = true ; Shutdown when receiving SIGTERM (default is respawn) |
| 13 | +no-orphans = true ; automatically kill workers if master dies |
| 14 | + |
| 15 | +;disable-logging = true ; Disable built-in logging |
| 16 | +;log-4xx = true ; but log 4xx's anyway |
| 17 | +;log-5xx = true ; and 5xx's |
| 18 | +;harakiri = 60 ; forcefully kill workers after ... seconds |
| 19 | +; py-callos-afterfork = true ; allow workers to trap signals |
| 20 | + |
| 21 | + |
| 22 | +; workers = 8 ; Number of workers (syn is processes) to spawn |
| 23 | +; cheaper-algo = spare |
| 24 | +; cheaper = 2 ; Minimum number of workers allowed |
| 25 | +; cheaper-initial = 2 ; Workers created at startup |
| 26 | +; cheaper-step = 2 ; How many workers to spawn at a time |
| 27 | +; cheaper-overload = 30 ; Length of a cycle in seconds |
| 28 | +; worker-reload-mercy = 60 ; How long to wait before forcefully killing workers in seconds |
| 29 | + |
| 30 | +; max-requests = 1000 ; Restart workers after this many requests |
| 31 | +; max-worker-lifetime = 3600 ; Restart workers after this many seconds |
| 32 | +; reload-on-rss = 2048 ; Restart workers after this much resident memory |
| 33 | + |
| 34 | +## Setting memory limits |
| 35 | +# soft limit will prevent cheaper from spawning new workers |
| 36 | +# if workers total rss memory is equal or higher |
| 37 | +# we use 128MB soft limit below (values are in bytes) |
| 38 | +;cheaper-rss-limit-soft = 134217728 |
| 39 | + |
| 40 | +# Optional: hard limit will force cheaper to cheap single worker |
| 41 | +# if workers total rss memory is equal or higher |
| 42 | +# we use 160MB hard limit below (values are in bytes) |
| 43 | +;;cheaper-rss-limit-hard = 167772160 |
| 44 | + |
| 45 | +[prod] |
| 46 | +ini = :uwsgi |
| 47 | +http-socket = :5000 |
| 48 | +logto = %d/uwsgi.log |
| 49 | +disable-logging = true ; Disable built-in logging |
| 50 | +log-4xx = true ; but log 4xx's anyway |
| 51 | +log-5xx = true ; and 5xx's |
| 52 | + |
| 53 | +[dev] |
| 54 | +ini = :prod |
| 55 | +http-socket = :5001 |
| 56 | +logto = %d/uwsgi.dev.log |
| 57 | +;DEBUG |
| 58 | +disable-logging = false |
| 59 | +memory-report = true |
| 60 | +stats = :9000 ; Stats server |
| 61 | +stats-http = true |
0 commit comments