Skip to content

Commit

Permalink
[enh] Configure swappiness
Browse files Browse the repository at this point in the history
  • Loading branch information
zamentur authored May 31, 2024
1 parent 38fc88d commit beff899
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions helpers/helpers.v1.d/hardware
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ ynh_add_swap () {
return
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.
# And set a acceptable size from the request
if [ $usable_space -ge $swap_max_size ]
Expand Down

0 comments on commit beff899

Please sign in to comment.