This commit is contained in:
Zsolt Ero
2023-12-29 20:43:31 +01:00
parent 35f0d85b60
commit b0ab33893e
5 changed files with 24 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ from fabric import Config, Connection
from ssh_lib import CONFIG_DIR, HTTP_HOST_BIN, OFM_DIR, REMOTE_CONFIG, SCRIPTS_DIR, TILE_GEN_BIN from ssh_lib import CONFIG_DIR, HTTP_HOST_BIN, OFM_DIR, REMOTE_CONFIG, SCRIPTS_DIR, TILE_GEN_BIN
from ssh_lib.benchmark import c1000k from ssh_lib.benchmark import c1000k
from ssh_lib.kernel import setup_kernel_settings from ssh_lib.kernel import kernel_tweaks_ofm
from ssh_lib.nginx import certbot, nginx from ssh_lib.nginx import certbot, nginx
from ssh_lib.pkg_base import pkg_base, pkg_upgrade from ssh_lib.pkg_base import pkg_base, pkg_upgrade
from ssh_lib.planetiler import install_planetiler from ssh_lib.planetiler import install_planetiler
@@ -23,7 +23,7 @@ def prepare_shared(c):
pkg_upgrade(c) pkg_upgrade(c)
pkg_base(c) pkg_base(c)
setup_kernel_settings(c) kernel_tweaks_ofm(c)
c.sudo(f'mkdir -p {REMOTE_CONFIG}') c.sudo(f'mkdir -p {REMOTE_CONFIG}')
c.sudo('chown ofm:ofm /data/ofm/config') c.sudo('chown ofm:ofm /data/ofm/config')

View File

@@ -1 +0,0 @@
net.core.somaxconn = 65535

View File

@@ -1,4 +0,0 @@
* soft nofile 1048576
* hard nofile 1048576
root soft nofile 1048576
root hard nofile 1048576

View File

@@ -1,7 +1,24 @@
from ssh_lib import ASSETS_DIR from ssh_lib import ASSETS_DIR
from ssh_lib.utils import put from ssh_lib.utils import put, put_str
def setup_kernel_settings(c): def kernel_somaxconn65k(c):
put(c, f'{ASSETS_DIR}/kernel/60-ofm.conf', '/etc/sysctl.d/') put_str(c, '/etc/sysctl.d/60-somaxconn65k.conf', 'net.core.somaxconn = 65535')
put(c, f'{ASSETS_DIR}/kernel/limits-ofm.conf', '/etc/security/limits.d/')
def kernel_limits1m(c):
put_str(
c,
'/etc/security/limits.d/limits1m.conf',
"""
* soft nofile 1048576
* hard nofile 1048576
root soft nofile 1048576
root hard nofile 1048576
""",
)
def kernel_tweaks_ofm(c):
kernel_somaxconn65k(c)
kernel_limits1m(c)

View File

@@ -54,6 +54,7 @@ def nginx(c):
def mime_types(c): def mime_types(c):
# TODO
pass pass