Skip to content

Instantly share code, notes, and snippets.

@zeuxisoo
Created October 7, 2013 09:40
Show Gist options
  • Save zeuxisoo/6865212 to your computer and use it in GitHub Desktop.
Save zeuxisoo/6865212 to your computer and use it in GitHub Desktop.
Auto Restart PHP-FPM when Loading Average over 100
#/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