arthas初步使用

线上问题排查利器arthas快速入门

1、下载

# github下载
wget https://alibaba.github.io/arthas/arthas-boot.jar
# 或者 Gitee 下载
wget https://arthas.gitee.io/arthas-boot.jar

2、快速使用

(1)需要排查的进程

ps -ef|grep '线程名'

(2)进入arthas界面

java -jar arthas-boot.jar 53739

 

 3、几个比较好用的命令

3.1 看板

dashboard(系统看板):可以查看系统线程、jvm、gc情况,快速查看系统异常情况

 

 

 

 3.2 thread

快速定位系统死循环

thread -n 10:查找系统前10个耗cpu的线程

 

 

 thread:查看所有线程

 

 

thread 线程号:查看线程堆栈

 

 

 thread -b查看线程block情况

3.3 jad反编译

希望查看线上代码是否正确,可以使用jad反编译class,查看java代码

jad aiinterview.AudioSession

 

 

3.4 ognl查看线上实时变量情况

可以替代日志,快速查看问题

比如要查看某个map容器中的情况

 

 3.5 trace查看线上方法耗时情况

 

 3.6 watch直接观测方法的入参出参

 

 

posted on 2020-07-03 17:12  张小泽的小号  阅读(755)  评论(0编辑  收藏  举报

导航