Merge pull request #3064 from quay/joseph.schorr/QUAY-928/fix-worker-count

Fix worker count to  use CPU affinity correctly and be properly bounded
This commit is contained in:
josephschorr 2018-05-07 20:45:26 +03:00 committed by GitHub
commit 7722721396
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 115 additions and 10 deletions

View file

@ -2,16 +2,16 @@ import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import multiprocessing
import logging
from Crypto import Random
from util.log import logfile_path
from util.workers import get_worker_count
logconfig = logfile_path(debug=True)
bind = '0.0.0.0:5000'
workers = max(int(os.getenv("WORKER_COUNT_LOCAL", multiprocessing.cpu_count())), 2)
workers = get_worker_count('local', 2, minimum=2, maximum=8)
worker_class = 'gevent'
daemon = False
pythonpath = '.'

View file

@ -2,16 +2,16 @@ import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import multiprocessing
import logging
from Crypto import Random
from util.log import logfile_path
from util.workers import get_worker_count
logconfig = logfile_path(debug=False)
bind = 'unix:/tmp/gunicorn_registry.sock'
workers = max(int(os.getenv("WORKER_COUNT_REGISTRY", multiprocessing.cpu_count() * 4)), 8)
workers = get_worker_count('registry', 4, minimum=8, maximum=64)
worker_class = 'gevent'
pythonpath = '.'
preload_app = True

View file

@ -2,16 +2,16 @@ import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import multiprocessing
import logging
from Crypto import Random
from util.log import logfile_path
from util.workers import get_worker_count
logconfig = logfile_path(debug=False)
bind = 'unix:/tmp/gunicorn_secscan.sock'
workers = max(int(os.getenv("WORKER_COUNT_SECSCAN", multiprocessing.cpu_count())), 2)
workers = get_worker_count('secscan', 2, minimum=2, maximum=4)
worker_class = 'gevent'
pythonpath = '.'
preload_app = True

View file

@ -2,16 +2,16 @@ import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import multiprocessing
import logging
from Crypto import Random
from util.log import logfile_path
from util.workers import get_worker_count
logconfig = logfile_path(debug=False)
bind = 'unix:/tmp/gunicorn_verbs.sock'
workers = max(int(os.getenv("WORKER_COUNT_VERBS", multiprocessing.cpu_count())), 2)
workers = get_worker_count('verbs', 2, minimum=2, maximum=32)
pythonpath = '.'
preload_app = True
timeout = 2000 # Because sync workers

View file

@ -2,17 +2,17 @@ import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import multiprocessing
import logging
from Crypto import Random
from util.log import logfile_path
from util.workers import get_worker_count
logconfig = logfile_path(debug=False)
bind = 'unix:/tmp/gunicorn_web.sock'
workers = max(int(os.getenv("WORKER_COUNT_WEB", multiprocessing.cpu_count())), 2)
workers = get_worker_count('web', 2, minimum=2, maximum=32)
worker_class = 'gevent'
pythonpath = '.'
preload_app = True