Skip to content

Commit

Permalink
Merge pull request #125 from geoadmin/feat-BGDIINF_SB-2951-guniconr
Browse files Browse the repository at this point in the history
BGDIINF_SB-2951: Added gunicorn worker tmp dir config
  • Loading branch information
ltshb authored Jun 12, 2023
2 parents 7d775dc + e485395 commit f4272d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,4 @@ The service is configured by Environment Variable:
| PRELOAD_RASTER_FILES | `False` | Preload raster files at startup. If not set they will be loaded during first request |
| ALTI_WORKERS | `0` | Number of workers. `0` or negative value means that the number of worker are computed from the number of cpu |
| DFT_CACHE_HEADER | `public, max-age=86400` | Default cache settings for successful GET, HEAD and OPTIONS requests |
| GUNICORN_WORKER_TMP_DIR | `None` | This should be set to an tmpfs file system for better performance. See https://docs.gunicorn.org/en/stable/settings.html#worker-tmp-dir. |
1 change: 1 addition & 0 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
TRAP_HTTP_EXCEPTIONS = True

VALID_SRID = [21781, 2056]
GUNICORN_WORKER_TMP_DIR = os.getenv("GUNICORN_WORKER_TMP_DIR", None)
2 changes: 2 additions & 0 deletions wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from app import app as application
from app.helpers import get_logging_cfg
from app.settings import ALTI_WORKERS
from app.settings import GUNICORN_WORKER_TMP_DIR
from app.settings import HTTP_PORT


Expand Down Expand Up @@ -38,6 +39,7 @@ def load(self):
'workers': ALTI_WORKERS,
'access_log_format': '%(h)s %(l)s %(u)s "%(r)s" %(s)s %(B)s Bytes '
'"%(f)s" "%(a)s" %(L)ss',
'worker_tmp_dir': GUNICORN_WORKER_TMP_DIR,
'timeout': 60,
'logconfig_dict': get_logging_cfg()
}
Expand Down

0 comments on commit f4272d4

Please sign in to comment.