mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
install.sh: Setup aio-max-nr upon installation
This is a follow up change to #8512.
Let's add aio conf file during scylla installation process and make sure
we also remove this file when uninstall Scylla
As per Avi Kivity's suggestion, let's set aio value as static
configuration, and make it large enough to work with 500 cpus.
Closes #8650
Refs: #8713
(cherry picked from commit dd453ffe6a)
This commit is contained in:
1
dist/common/scripts/scylla_io_setup
vendored
1
dist/common/scripts/scylla_io_setup
vendored
@@ -122,7 +122,6 @@ class scylla_cpuinfo:
|
||||
return len(self._cpu_data["system"])
|
||||
|
||||
def run_iotune():
|
||||
configure_aio_slots()
|
||||
if "SCYLLA_CONF" in os.environ:
|
||||
conf_dir = os.environ["SCYLLA_CONF"]
|
||||
else:
|
||||
|
||||
3
dist/common/scripts/scylla_prepare
vendored
3
dist/common/scripts/scylla_prepare
vendored
@@ -114,8 +114,6 @@ if __name__ == '__main__':
|
||||
os.remove('/etc/scylla/ami_disabled')
|
||||
sys.exit(1)
|
||||
|
||||
configure_aio_slots()
|
||||
|
||||
if mode == 'virtio':
|
||||
tap = cfg.get('TAP')
|
||||
user = cfg.get('USER')
|
||||
@@ -145,4 +143,3 @@ if __name__ == '__main__':
|
||||
print(f'Exception occurred while creating perftune.yaml: {e}')
|
||||
print('To fix the error, please re-run scylla_setup.')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
21
dist/common/scripts/scylla_util.py
vendored
21
dist/common/scripts/scylla_util.py
vendored
@@ -92,27 +92,6 @@ def scyllabindir():
|
||||
return str(scyllabindir_p())
|
||||
|
||||
|
||||
def get_required_aio_slots():
|
||||
return cpu_count() * 11026 + 65536
|
||||
|
||||
def configure_aio_slots():
|
||||
aio_conf_file = "/etc/sysctl.d/aio-max-nr.conf"
|
||||
aio_max_nr_value = "fs.aio-max-nr = " + str(get_required_aio_slots())
|
||||
mode = 'w+'
|
||||
if os.path.exists(aio_conf_file):
|
||||
with open(aio_conf_file, 'r') as file:
|
||||
for line in file:
|
||||
aio_conf_value = re.findall(r"[=]?\d*\.\d+|\d+", line)
|
||||
aio_value = int((', '.join(map(str, aio_conf_value))))
|
||||
if aio_value > get_required_aio_slots():
|
||||
with open('/proc/sys/fs/aio-max-nr', mode) as f:
|
||||
f.write(str(aio_value))
|
||||
else:
|
||||
with open(aio_conf_file, mode) as f:
|
||||
f.write(aio_max_nr_value + '\n')
|
||||
with open('/proc/sys/fs/aio-max-nr', mode) as f:
|
||||
f.write(str(get_required_aio_slots()))
|
||||
|
||||
# @param headers dict of k:v
|
||||
def curl(url, headers=None, byte=False, timeout=3, max_retries=5, retry_interval=5):
|
||||
retries = 0
|
||||
|
||||
2
dist/common/sysctl.d/99-scylla-aio.conf
vendored
Normal file
2
dist/common/sysctl.d/99-scylla-aio.conf
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Raise max AIO events
|
||||
fs.aio-max-nr = 5578536
|
||||
@@ -11,6 +11,7 @@ else
|
||||
sysctl -p/usr/lib/sysctl.d/99-scylla-sched.conf || :
|
||||
sysctl -p/usr/lib/sysctl.d/99-scylla-vm.conf || :
|
||||
sysctl -p/usr/lib/sysctl.d/99-scylla-inotify.conf || :
|
||||
sysctl -p/usr/lib/sysctl.d/99-scylla-aio.conf || :
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
1
dist/redhat/scylla.spec
vendored
1
dist/redhat/scylla.spec
vendored
@@ -207,6 +207,7 @@ if Scylla is the main application on your server and you wish to optimize its la
|
||||
/usr/lib/systemd/systemd-sysctl 99-scylla-sched.conf >/dev/null 2>&1 || :
|
||||
/usr/lib/systemd/systemd-sysctl 99-scylla-vm.conf >/dev/null 2>&1 || :
|
||||
/usr/lib/systemd/systemd-sysctl 99-scylla-inotify.conf >/dev/null 2>&1 || :
|
||||
/usr/lib/systemd/systemd-sysctl 99-scylla-aio.conf >/dev/null 2>&1 || :
|
||||
|
||||
%files kernel-conf
|
||||
%defattr(-,root,root)
|
||||
|
||||
Reference in New Issue
Block a user