summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-11-06 18:59:55 +0100
committerChristian Poessinger <christian@poessinger.com>2020-11-06 18:59:55 +0100
commitcb8edaf195060df2795a5aa1e6a883341b5af747 (patch)
treef69439ec4719f650c3fb91800fda15e9eb54216c /src
parent10a23cd803c0784cbdd80daff6750f02c982df4f (diff)
downloadvyos-1x-cb8edaf195060df2795a5aa1e6a883341b5af747.tar.gz
vyos-1x-cb8edaf195060df2795a5aa1e6a883341b5af747.zip
system: T3048: add dynamic performance tuning daemon
Add new CLI command "set system options performance <latency | throughput>"
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/system-options.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/conf_mode/system-options.py b/src/conf_mode/system-options.py
index 6ac35a4ab..188f5020c 100755
--- a/src/conf_mode/system-options.py
+++ b/src/conf_mode/system-options.py
@@ -21,7 +21,7 @@ from sys import exit
from vyos.config import Config
from vyos.template import render
-from vyos.util import call
+from vyos.util import cmd
from vyos.validate import is_addr_assigned
from vyos import ConfigError
from vyos import airbag
@@ -71,9 +71,9 @@ def generate(options):
def apply(options):
# Beep action
if 'beep_if_fully_booted' in options.keys():
- call('systemctl enable vyos-beep.service')
+ cmd('systemctl enable vyos-beep.service')
else:
- call('systemctl disable vyos-beep.service')
+ cmd('systemctl disable vyos-beep.service')
# Ctrl-Alt-Delete action
if os.path.exists(systemd_action_file):
@@ -100,6 +100,13 @@ def apply(options):
else:
f.write('0')
+ # tuned - performance tuning
+ if 'performance' in options:
+ cmd('systemctl enable vyos-beep.service')
+ cmd('tuned-adm profile network-{performance}'.format(**options))
+ else:
+ cmd('systemctl disable vyos-beep.service')
+
if __name__ == '__main__':
try:
c = get_config()