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:
Yaron Kaikov
2021-05-19 08:47:16 +03:00
committed by Avi Kivity
parent f36f7035c8
commit 76ec7513f1
6 changed files with 4 additions and 25 deletions

View File

@@ -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:

View File

@@ -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)

View File

@@ -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

View File

@@ -0,0 +1,2 @@
# Raise max AIO events
fs.aio-max-nr = 5578536

View File

@@ -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#

View File

@@ -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)