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:
commit
4b6e47feef
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -3,7 +3,6 @@ jinja2
|
||||
virtualenv
|
||||
requests
|
||||
honcho
|
||||
psutil
|
||||
python-crontab
|
||||
semantic_version
|
||||
GitPython==0.3.2.1
|
||||
|
Loading…
Reference in New Issue
Block a user