Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Tweaks gunicorn to preload the app and use shared memory for temporary fs

Trenton Holmes5ffb25b71d72
diff --git a/gunicorn.conf.py b/gunicorn.conf.py
index daebd4bea..a3ada7a64 100644
--- a/gunicorn.conf.py
+++ b/gunicorn.conf.py
@@ -1,9 +1,17 @@
import os
+# See https://docs.gunicorn.org/en/stable/settings.html for
+# explanations of settings
+
bind = f'{os.getenv("PAPERLESS_BIND_ADDR", "[::]")}:{os.getenv("PAPERLESS_PORT", 8000)}'
+
workers = int(os.getenv("PAPERLESS_WEBSERVER_WORKERS", 1))
worker_class = "paperless.workers.ConfigurableWorker"
timeout = 120
+preload_app = True
+
+# https://docs.gunicorn.org/en/stable/faq.html#blocking-os-fchmod
+worker_tmp_dir = "/dev/shm"
def pre_fork(server, worker):