Zodinet

LINUX common monitor commands & tools

I. Common Commands & Tools

1. PHP Performance debugger

Strace is good tool to debug PHP performance. Firstly, you need to install it via

CentOS

yum install strace

Ubuntu

apt-get install strace

For detect all PHP-FPM we can use following command

 strace -c -f $(pgrep php-fpm | sed 's/\([0-9]*\)/\-p \1/g')

lstat + fstat + stat  is system call into file information

2. IP Monitor

netstat -ant | grep -v LISTEN | awk '{print $5}' | cut -d":" -f1 | sort | uniq -c | sort -rn

3. Disk application I/O monitor

iotop

4. Process monitor tools

htop
atop
top 

II. References

https://blog.sleeplessbeastie.eu/2019/10/14/how-to-strace-php-fpm-processes/
https://blog.vietnix.vn/tip-7-dem-so-luong-ket-noi-cua-moi-ip-den-server.html
https://blog.vietnix.vn/tip-4-xac-dinh-tien-trinh-dang-doc-ghi-o-cung-nhieu-nhat.html
Exit mobile version