Skip to content

Commit

Permalink
Increase number of Python/flask workers (TechEmpower#5824)
Browse files Browse the repository at this point in the history
As per:

    http://calpaterson.com/async-python-is-not-faster.html

The number of gunicorn workers is probably too low for Flask. Cal
recommends overshooting then dialling back (and also that the cost of too
many workers is higher than the cost of too few), so I've upped the number
of workers to a (seemingly crazy) 8.
  • Loading branch information
leontrolski authored Jul 2, 2020
1 parent 850a816 commit ddada64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frameworks/Python/flask/gunicorn_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
_is_pypy = hasattr(sys, 'pypy_version_info')
_is_travis = os.environ.get('TRAVIS') == 'true'

workers = multiprocessing.cpu_count() * 3
workers = multiprocessing.cpu_count() * 8
if _is_travis:
workers = 2

Expand Down

0 comments on commit ddada64

Please sign in to comment.