[enh] Configure swappiness

This commit is contained in:
ljf (zamentur) 2024-05-31 09:03:01 +02:00 committed by GitHub
parent 38fc88dcbe
commit beff899e5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -130,6 +130,13 @@ ynh_add_swap () {
return return
fi fi
# Configure swappiness
if [ ! -e /etc/sysctl.d/999-ynhswap.conf ]
then
echo "vm.swappiness=10" > /etc/sysctl.d/999-ynhswap.conf
sysctl --quiet --system
fi
# Compare the available space with the size of the swap. # Compare the available space with the size of the swap.
# And set a acceptable size from the request # And set a acceptable size from the request
if [ $usable_space -ge $swap_max_size ] if [ $usable_space -ge $swap_max_size ]