2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

Merge pull request #679 from codingCoffee/psutil

removed psutil as a requirement
This commit is contained in:
Ameya Shenoy 2018-06-19 15:39:39 +05:30 committed by GitHub
commit 4b6e47feef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 6 deletions

View File

@ -215,7 +215,6 @@ def get_error_pages():
def get_limit_conn_shared_memory():
"""Allocate 2 percent of total virtual memory as shared memory for nginx limit_conn_zone"""
import psutil
total_vm = (psutil.virtual_memory().total) / (1024 * 1024) # in MB
total_vm = (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')) / (1024 * 1024) # in MB
return int(0.02 * total_vm)

View File

@ -67,9 +67,7 @@ def get_redis_version():
return float('{major}.{minor}'.format(major=version.major, minor=version.minor))
def get_max_redis_memory():
import psutil
total_virtual_mem = psutil.virtual_memory().total/(pow(1024, 2))
total_virtual_mem = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')/(pow(1024, 2))
max_memory = int(total_virtual_mem * 0.05) # Max memory for redis is 5% of virtual memory
if max_memory < 50:

View File

@ -3,7 +3,6 @@ jinja2
virtualenv
requests
honcho
psutil
python-crontab
semantic_version
GitPython==0.3.2.1