summaryrefslogtreecommitdiff
path: root/python/vyos/util.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-18 17:56:19 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-18 17:56:19 +0200
commite9a2c4b96edc52ea114451ece6884845ad18ba6f (patch)
treebbaf2bcaf8d8b081219e720820cca631dd934e2c /python/vyos/util.py
parent03c9155cd012a56c9454b396c5db7785abb80b0a (diff)
downloadvyos-1x-e9a2c4b96edc52ea114451ece6884845ad18ba6f.tar.gz
vyos-1x-e9a2c4b96edc52ea114451ece6884845ad18ba6f.zip
ipoe-server: T2324: remove boilerplate code and adjust to other accel implementations
Diffstat (limited to 'python/vyos/util.py')
-rw-r--r--python/vyos/util.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index eb78c4a26..c70bff091 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -447,3 +447,9 @@ def is_bridge_member(interface):
return False, None
+def get_half_cpus():
+ """ return 1/2 of the numbers of available CPUs """
+ cpu = os.cpu_count()
+ if cpu > 1:
+ cpu /= 2
+ return int(cpu)