mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-13 02:25:38 +00:00
.github
InvenTree
ci
deploy
docker
Dockerfile
dev-config.env
docker-compose.dev.yml
docker-compose.sqlite.yml
docker-compose.yml
gunicorn.conf.py
init.sh
nginx.conf
nginx.dev.conf
prod-config.env
requirements.txt
sqlite-config.env
images
.eslintrc.yml
.gitattributes
.gitignore
.gitpod.yml
CONTRIBUTING.md
LICENSE
README.md
RELEASE.md
crowdin.yml
package-lock.json
package.json
requirements.txt
setup.cfg
tasks.py
23 lines
445 B
Python
23 lines
445 B
Python
import multiprocessing
|
|
import os
|
|
import logging
|
|
|
|
|
|
logger = logging.getLogger('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
|