diff --git a/gunicorn.conf.py b/gunicorn.conf.py index 16a591bd..40ae2ebf 100644 --- a/gunicorn.conf.py +++ b/gunicorn.conf.py @@ -1,5 +1,7 @@ +import multiprocessing -workers = 1 +workers = multiprocessing.cpu_count() * 2 + 1 +threads = multiprocessing.cpu_count() * 2 + 1 worker_tmp_dir = '/dev/shm' @@ -7,7 +9,7 @@ bind = '0.0.0.0:5000' umask = 0o007 reload = False -worker_class = 'gevent' +worker_class = 'gthread' #logging accesslog = '-' diff --git a/pyfedi.py b/pyfedi.py index 0d8ce015..1f63adf4 100644 --- a/pyfedi.py +++ b/pyfedi.py @@ -1,11 +1,5 @@ # This file is part of pyfedi, which is licensed under the GNU General Public License (GPL) version 3.0. # You should have received a copy of the GPL along with this program. If not, see . -import os - -if os.environ.get('FLASK_ENV', '') != 'development': - from gevent import monkey - monkey.patch_all() - from datetime import datetime from flask_babel import get_locale