比如說要查看所有的sql查詢陳述句,資料庫的埠是3306
tcpdump -i any port 3306 -l -s 0 -w -|strings|grep -A 5 select
要查看所有的呼叫mc資源,埠是50028
tcpdump -i any port 50028 -l -s 0 -w -|strings
如果要查看fpm的行程資源讀取的檔案,連接的網路可以先把fpm的worker行程數調整為一個,行程是15816
strace -e open -p 15816
-e是可以進行過濾 后面那個就是跟著系統呼叫的函式名就行了,還有以下系統呼叫的函式名
open() : 用于打開或創建一個檔案,
read() : 用于讀取一個檔案,
write() : 寫檔案,
connect() : 建立網路連接,
sendto() : 發送網路資料,
recvfrom() : 接收網路資料,
futex() : 鎖相關操作,
查看多個子行程的,比如php-fpm
strace $(pidof "php-fpm" | sed 's/\([0-9]*\)/-p \1/g')
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/91786.html
標籤:PHP
