]> git.parisson.com Git - teleforma.git/commitdiff
increase production uwsgi performance
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Wed, 11 Jan 2023 13:28:00 +0000 (14:28 +0100)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Wed, 11 Jan 2023 13:28:00 +0000 (14:28 +0100)
app/wsgi.ini

index 55db260024094ba80f966bceecb4c8c9c00fc39b..374f1694b7ad82f25fd625acee509b61f82ceba4 100644 (file)
@@ -17,21 +17,33 @@ single-interpreter = true
 die-on-term = true                   ; Shutdown when receiving SIGTERM (default is respawn)
 need-app = true
 
-disable-logging = true               ; Disable built-in logging 
+# Close fds on fork (don't allow subprocess to mess with parent's fds)
+close-on-exec = true
+close-on-exec2 = true
+
+
+disable-logging = false               ; Disable built-in logging 
 log-4xx = true                       ; but log 4xx's anyway
 log-5xx = true                       ; and 5xx's
+logger = file:/var/log/app/app.log
 
-harakiri = 300                       ; forcefully kill workers after 60 seconds
-#py-callos-afterfork = true           ; allow workers to trap signals
+harakiri = 300                        ; forcefully kill workers after 60 seconds
+#py-callos-afterfork = true            ; allow workers to trap signals
 
 max-requests = 20000                 ; Restart workers after this many requests
 max-worker-lifetime = 18000          ; Restart workers after this many seconds
 reload-on-rss = 4096                 ; Restart workers after this much resident memory
-worker-reload-mercy = 300            ; How long to wait before forcefully killing workers
+worker-reload-mercy = 60             ; How long to wait before forcefully killing workers
+
+# We don't expect abuse so lets have fastest respawn possible
+forkbomb-delay = 0
+
+# Enable an accept mutex for a more balanced worker load
+thunder-lock = true
 
 cheaper-algo = busyness
-processes = 64                       ; Maximum number of workers allowed
-threads = 30
+processes = 128                       ; Maximum number of workers allowed
+#threads = 2
 cheaper = 24                         ; Minimum number of workers allowed
 cheaper-initial = 24                 ; Workers created at startup
 cheaper-overload = 1                 ; Length of a cycle in seconds