Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Monitor I/O heavy SQL queries and PHP requests on Hypernode
#!/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
You can’t perform that action at this time.