Skip to content

Latest commit

 

History

History
40 lines (19 loc) · 723 Bytes

排查问题常用命令.md

File metadata and controls

40 lines (19 loc) · 723 Bytes

排查线上问题常用命令脚本


1. 查看进程pid

ps -ef |grep 'bbs-service' | grep -v grep |grep -v 'python' | awk '{print $2}'

2. 查看线程信息

jstack 27676| grep Druid-ConnectionPool- | wc -l

jstack 27676| grep Xmemcached-Reactor-

jstack 27676| grep java.lang.Thread.State

jstack 27676| grep DubboServerHandler-

jstack 27676| grep DubboClientHandler-

top -H -b -n 1 -p 27676 | sed '1,/^$/d' | sed '1d;/^$/d' | grep -v 27676 | sort -nrk9 | head -3

注:27676 为进程pid

3. 系统

已建立的连接数:

netstat -ant |grep ESTABLISHED |wc -l

处于等待状态的连接数:

netstat -ant |grep TIME_WAIT |wc -l

各个cpu的资源使用情况:

mpstat -P ALL