Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Parse php-fpm slow log
## 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
@RDelorier

This comment has been minimized.

Copy link

@RDelorier RDelorier commented Aug 8, 2017

Thank you sir 👍

@gabrielef

This comment has been minimized.

Copy link

@gabrielef gabrielef commented Mar 7, 2018

Thank you!

@vlad88sv

This comment has been minimized.

Copy link

@vlad88sv vlad88sv commented Jul 24, 2018

Very useful, thank you

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