2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-16 10:05:21 +00:00

perf: Remove multiprocessing from the import tree

This commit is contained in:
Aditya Hase 2021-02-21 10:02:41 +05:30
parent 104efd349b
commit 8527b106c3
No known key found for this signature in database
GPG Key ID: 0A55F0FCA0234972

View File

@ -1,7 +1,6 @@
# imports - standard imports # imports - standard imports
import getpass import getpass
import json import json
import multiprocessing
import os import os
# imports - third party imports # imports - third party imports
@ -54,6 +53,8 @@ def get_config_path(bench_path):
def get_gunicorn_workers(): def get_gunicorn_workers():
'''This function will return the maximum workers that can be started depending upon '''This function will return the maximum workers that can be started depending upon
number of cpu's present on the machine''' number of cpu's present on the machine'''
import multiprocessing
return { return {
"gunicorn_workers": multiprocessing.cpu_count() * 2 + 1 "gunicorn_workers": multiprocessing.cpu_count() * 2 + 1
} }