Skip to content

Instantly share code, notes, and snippets.

@youhide
Created April 3, 2017 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save youhide/8869d90c0529ae8ca2ece336f90d0480 to your computer and use it in GitHub Desktop.
Save youhide/8869d90c0529ae8ca2ece336f90d0480 to your computer and use it in GitHub Desktop.
Restart something on load > 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