Created
October 7, 2013 09:40
-
-
Save zeuxisoo/6865212 to your computer and use it in GitHub Desktop.
Auto Restart PHP-FPM when Loading Average over 100
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 | |
LOAD=$(awk '{print $1}' /proc/loadavg) | |
if [ $(echo "$LOAD > 100" | bc) = 1 ]; then | |
/etc/init.d/php-fpm restart | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment