Skip to content

Commit 88c9357

Browse files
committed
Merge pull request #760 from helgi/detect_os_cpu
ref(gunicorn): use os.cpu_count instead of multiprocessing for simplification
2 parents 2a87f08 + 30193c5 commit 88c9357

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

rootfs/deis/gunicorn/config.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
if workers < 1:
1111
raise ValueError()
1212
except (NameError, ValueError):
13-
import multiprocessing
14-
try:
15-
workers = multiprocessing.cpu_count() * 2 + 1
16-
except NotImplementedError:
17-
workers = 8
13+
workers = (os.cpu_count() or 4) * 2 + 1
1814

1915
pythonpath = dirname(dirname(dirname(realpath(__file__))))
2016
timeout = 1200

0 commit comments

Comments
 (0)