strace php-fpm process
Hi,
Today I will share how fast and easy we can track what happens behind a php-fpm process thanks to strace!
We add the following function to our user’s .bashrc file (recommended to be directly on root) or will need to be executed with sudo:
function straceall { strace -t -f -o strace.txt $(pidof "${1}" | sed 's/\([0-9]*\)/-p \1/g') }
We load it in new by source .bashrc
or go out and log on to our server and start tracking the process:
straceall php-fpm7.0
If we want to follow the php7.1-fpm process we write:
straceall php-fpm7.1
for php5-fpm :
straceall php5-fpm
This is a stracy process that writes in a strace.txt file in real time.
Thats it!