This commit is contained in:
Zsolt Ero
2023-12-15 03:47:46 +01:00
parent 578f81d320
commit 71d7d7fe95
16 changed files with 135 additions and 40 deletions

36
ssh_lib/benchmark.py Normal file
View File

@@ -0,0 +1,36 @@
from ssh_lib.config import scripts
from ssh_lib.utils import apt_get_install, apt_get_update, put, put_str, sudo_cmd
def k6(c):
sudo_cmd(
c,
'curl https://dl.k6.io/key.gpg '
'| gpg --dearmor '
'| tee /usr/share/keyrings/k6-archive-keyring.gpg >/dev/null',
)
put_str(
c,
'/e' 'tc/apt/sources.list.d/k6.list',
'deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main',
)
apt_get_update(c)
apt_get_install(c, 'k6')
def c1000k(c):
c.run('wget https://github.com/ideawu/c1000k/archive/master.zip -O tmp.zip')
c.run('unzip -o tmp.zip')
c.run('rm tmp.zip')
c.run('cd c1000k-master && make')
# usage
# ./server 7000
# ./client 127.0.0.1 7000
# make sure it runs till 1 million
def benchmark(c):
apt_get_install(c, 'wrk')
c.sudo('mkdir -p /data/ofm/benchmark')
put(c, f'{scripts}/benchmark/wrk_custom_list.lua', '/data/ofm/benchmark')

View File

@@ -3,7 +3,8 @@ from ssh_lib.utils import apt_get_install, apt_get_purge, put, put_str
def setup_kernel_settings(c):
put(c, f'{config}/sysctl/60-optim.conf', '/etc/sysctl.d/')
put(c, f'{config}/sysctl/60-ofm.conf', '/etc/sysctl.d/')
put(c, f'{config}/limits/limits-ofm.conf', '/etc/security/limits.d/')
def set_cpu_governor(c):

View File

@@ -64,19 +64,3 @@ def certbot(c):
apt_get_purge(c, 'certbot')
c.sudo('snap install --classic certbot', warn=True)
def k6(c):
sudo_cmd(
c,
'curl https://dl.k6.io/key.gpg '
'| gpg --dearmor '
'| tee /usr/share/keyrings/k6-archive-keyring.gpg >/dev/null',
)
put_str(
c,
'/etc/apt/sources.list.d/k6.list',
'deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main',
)
apt_get_update(c)
apt_get_install(c, 'k6')

View File

@@ -39,6 +39,8 @@ def pkg_base(c):
'lsb-release',
'wget',
'git',
'build-essential',
'unzip',
#
'gnupg2',
'gnupg-agent',