Last active
August 24, 2024 06:55
-
-
Save JCotton1123/7015737 to your computer and use it in GitHub Desktop.
Parse php-fpm slow log
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
## Slow requests grouped by function call | |
cat /var/log/php-fpm/www-slow.log | grep -A 1 script_filename | \ | |
grep -v script_filename | grep -v -e "--" | cut -c 22- | sort | uniq -c | sort -nr | |
## Slow requests grouped by minute | |
cat /var/log/php-fpm/www-slow.log | grep 'pool www' | \ | |
cut -d' ' -f2 | sort | cut -d: -f1,2 | uniq -c | |
## Top 25 1 minute groups of slow requests | |
cat /var/log/php-fpm/www-slow.log | grep 'pool www' | cut -d' ' -f2 | \ | |
sort | cut -d: -f1,2 | uniq -c | sort -nr | head -n 25 |
Thank you!
Very useful, thank you
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you sir 👍