-
-
Save djvdorp/530a7022ab23534e4400f4b77472b88b to your computer and use it in GitHub Desktop.
Auto Restart PHP-FPM when LoadAvg15 under 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# the load average for the last 1, 5, and 15 minutes. we get the third one: | |
LOAD=$(awk '{print $3}' /proc/loadavg) | |
if [ $(echo "$LOAD < 1" | bc) = 1 ]; then | |
/usr/bin/systemctl restart php-fpm | |
else | |
echo "All seems well, moving on" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment