| 场景 | 进程假死/hang 住 |
|---|---|
| 组合 | strace -p + -e trace + wchan 对照 |
快速看现场
快速看现场
pid=$(pgrep -f 'app-server' | head -1)
timeout 5 strace -f -p $pid -e trace=network -s 128 2>&1 | tail -30
cat /proc/$pid/wchan; echo # 内核等待点(无 strace 时也能看)分类解读
分类解读
# 停在 epoll_wait/accept → 没流量或事件循环闲
# 停在 read/write/recv → 对端慢或大块 IO
timeout 5 strace -f -p $pid -e trace=read,write,openat 2>&1 | tail -20
# 停在 futex → 锁竞争/死锁嫌疑attach 输出默认到 stderr:管道时记得 2>&1;用 timeout 包住避免忘记退出。