mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-30 16:41:35 +00:00
Specify how many workers to use
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
import multiprocessing
|
||||
import os
|
||||
import logging
|
||||
|
||||
workers = multiprocessing.cpu_count() * 2 + 1
|
||||
|
||||
logger = logging.get('inventree')
|
||||
|
||||
workers = os.environ.get('INVENTREE_GUNICORN_WORKERS', None)
|
||||
|
||||
if workers is not None:
|
||||
try:
|
||||
workers = int(workers)
|
||||
except ValueError:
|
||||
workers = None
|
||||
|
||||
if workers is None:
|
||||
workers = multiprocessing.cpu_count() * 2 + 1
|
||||
|
||||
logger.info(f"Starting gunicorn server with {workers} workers")
|
||||
|
||||
max_requests = 1000
|
||||
max_requests_jitter = 50
|
||||
|
Reference in New Issue
Block a user