Skip to content

Commit 78a62cd

Browse files
committed
scripts: Add ensure-aio-max-nr.sh
This is pretty much the only relevant part of run_integration_test.sh left. I'm not sure if its really necessary, but I know that wrong value of this parameter is an often cause of issues, so I left it for now.
1 parent 14bc88a commit 78a62cd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/ensure-aio-max-nr.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
aio_max_nr_recommended_value=1048576
2+
aio_max_nr=$(cat /proc/sys/fs/aio-max-nr)
3+
echo "The current aio-max-nr value is $aio_max_nr"
4+
if (( aio_max_nr != aio_max_nr_recommended_value )); then
5+
sudo sh -c "echo 'fs.aio-max-nr = $aio_max_nr_recommended_value' >> /etc/sysctl.conf"
6+
sudo sysctl -p /etc/sysctl.conf
7+
echo "The aio-max-nr was changed from $aio_max_nr to $(cat /proc/sys/fs/aio-max-nr)"
8+
if (( $(cat /proc/sys/fs/aio-max-nr) != aio_max_nr_recommended_value )); then
9+
echo "The aio-max-nr value was not changed to $aio_max_nr_recommended_value"
10+
exit 1
11+
fi
12+
fi

0 commit comments

Comments
 (0)