Created
March 13, 2017 12:25
-
-
Save hn-support/66daf5aef6dfae0724c9b69b87d0b170 to your computer and use it in GitHub Desktop.
Monitor I/O heavy SQL queries and PHP requests on Hypernode
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 | |
# monitors iops per 30 sec interval, and prints current http and sql transactions if iops avg > 100 | |
while true; do | |
iops=$(iostat xvdf -d 30 2 | tail -2 | head -1 | awk '{print $2}' | cut -d. -f1) | |
if [[ "$iops" -gt 100 ]]; then | |
echo "-------------------------------------------------------------------" | |
echo "IOPS: $iops" | |
echo | |
echo | |
echo 'show full processlist' | mysql --skip-column-names | |
hypernode-fpm-status | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment