Skip to content

Instantly share code, notes, and snippets.

@pjv
Last active August 29, 2015 14:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjv/d5012a4a86416c2a9998 to your computer and use it in GitHub Desktop.
Save pjv/d5012a4a86416c2a9998 to your computer and use it in GitHub Desktop.
HHVM memory monitor
#!/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
@pjv
Copy link
Author

pjv commented Dec 5, 2014

updated 12/5/2014 for latest version of ps_mem.py which outputs total in raw bytes instead of human labeled GB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment