Last active
August 29, 2015 14:10
-
-
Save pjv/d5012a4a86416c2a9998 to your computer and use it in GitHub Desktop.
HHVM memory monitor
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
#!/usr/bin/env bash | |
# depends on ps_mem : https://github.com/pixelb/ps_mem/ | |
PID=`pidof hhvm` | |
MEM=`/path/to/ps_mem.py -p $PID -t` | |
# restart hhvm daemon if using more than 2650000000 bytes | |
if [[ $MEM > 2650000000 ]] ; then | |
service hhvm restart | |
echo "`date -u` restart hhvm over 2650000000 bytes" >> /path/to/hhvm_restart.log | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated 12/5/2014 for latest version of ps_mem.py which outputs total in raw bytes instead of human labeled GB.