[uwsgi]
;; setup
master
http-socket = :$(PORT)
uid = nobody
chmod-socket = 666
procname-prefix-spaced = warehouse  ; fancy procname
die-on-term = true                  ; make SIGTERM shut down uwsgi, this won't be needed with uwsgi 2.1

;; application
wsgi = warehouse.wsgi

;; processes
single-interpreter
enable-threads
thunder-lock
threads = 10

;; protection
buffer-size = 32768  ; max size of request headers, no body
harakari = 60        ; timeout before killing the process on a slow request
socket-timeout = 60
listen = 128         ; size of socket listen queue
reload-on-rss = 512  ; max size for each process before we'll gracefully reload it

;; logging
disable-logging = true  ; access logs
log-5xx                 ; logs for 5xx
ignore-sigpipe          ; annoying logs
ignore-write-errors     ; annoying logs

[uwsgi]
;; setup
master
http-socket = :$(PORT)
uid = nobody
chmod-socket = 666
procname-prefix-spaced = warehouse  ; fancy procname
die-on-term = true                  ; make SIGTERM shut down uwsgi, this won't be needed with uwsgi 2.1

;; application
wsgi = warehouse.wsgi

;; This is a little complicated, but essentially uWSGI defaults to a behavior
;; that attempts to reduce the number of mallocs it requires to process a WSGI
;; request by preallocating the request dictionaries and populating it for each
;; each, and then after the request is over, clearing out the environment. This
;; breaks things like pyramid_debugtoolbar where it expects to be able to store
;; the request (and the environ variable) across many individual requests for
;; logging purposes. Instead, we'll switch uWSGI to use the "holy" behavior,
;; which will allocate and deallocate a new dictionary for each request, which
;; allows pyramid_debugtoolbar to work.
wsgi-env-behavior = holy

;; processes
single-interpreter
enable-threads
thunder-lock
threads = 10

;; protection
buffer-size = 32768  ; max size of request headers, no body
harakari = 60        ; timeout before killing the process on a slow request
socket-timeout = 60
listen = 128         ; size of socket listen queue
reload-on-rss = 512  ; max size for each process before we'll gracefully reload it

;; logging
disable-logging = true  ; access logs
log-5xx                 ; logs for 5xx
ignore-sigpipe          ; annoying logs
ignore-write-errors     ; annoying logs

Fix pyramid_debugtoolbar by using the holy wsgi-env-behavior
Fix pyramid_debugtoolbar by using the holy wsgi-env-behavior
