您的位置:首页 > 运维架构 > Tomcat

tomcat性能监控命令(一)

2016-06-19 19:15 501 查看
jps命令
jps -- Java Virtual Machine Process Status Tool

jps [ options ] [ hostid ]
选项
-q 仅输出VM标识符,不包括class name,jar name,arguments in main method
-m 输出main method的参数
-l 输出完全的包名,应用主类名,jar的完全路径名
-v 输出jvm参数
-V 输出通过flag文件传递到JVM中的参数(.hotspotrc文件或-XX:Flags=所指定的文件
-Joption 传递参数到vm,例如:-J-Xms48m
jps异常:
Jps有问题, 使用 jps -J-Djps.debug=true -J-Djps.printStackTrace=true 可以获得Jps错误详细信息

注:jps命令有个地方很不好,似乎只能显示当前用户的java进程,要显示其他用户的还是只能用unix/linux的ps命令。
jstack 命令

查看线程状态
jstack -l pid
pid:进程id

"main" daemon prio=5 os_prio=31 tid=0x00007f8ec480a000 nid=0x1703 runnable [0x0000700000218000]
java.lang.Thread.State: RUNNABLE
线程名称: main
* 线程类型:daemon
* prio优先级:10,默认是5
* jvm线程id:jvm内部线程的唯一标识, 0x00007fd388001000
* 对应系统线程id:和top命令查看的pid对应,不过一个是10进制,一个是16进制。0x76e6
* 线程状态:waiting on condition
* 起始栈地址: [0x0000000000000000]

线程状态:
Runnable
_The thread is either running or ready to run when it gets its CPU turn.
Wait on condition
_The thread is either sleeping or waiting to be notified by another thread._
Waiting for Monitor Entry and in Object.wait()
_The thread is waiting to get the lock for an object (some other thread may be holding the lock). This happens if two or more threads try to execute synchronized code. Note that the lock is always for an object and not for individual methods._

jvm可视化工具
参数详解:
jconsole
远程参考 http://www.linuxidc.com/Linux/2015-02/113420.htm 
jvisualvm 命令

 
更多监控工具 http://yhjhappy234.blog.163.com/blog/static/31632832201222691738865/ 
查看原文:http://www.baowenwei.com/archives/896
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: