开源项目推荐

Pepper Metrics是我与同事开发的一个开源工具(https://github.com/zrbcool/pepper-metrics),其通过收集jedis/mybatis/httpservlet/dubbo/motan的运行性能统计,并暴露成prometheus等主流时序数据库兼容数据,通过grafana展示趋势。其插件化的架构也非常方便使用者扩展并集成其他开源组件。

请大家给个star,同时欢迎大家成为开发者提交PR一起完善项目。

安装及使用

安装前提软件

centos

yum install perf -y
yum install gcc -y
yum install gcc-c++
yum install cmake -y

ubuntu

apt install linux-tools-generic
apt install linux-tools-common

FlameGraph

# 参考 http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html#Java
export JAVA_HOME=/root/jdk1.8.0_181
export PATH=$JAVA_HOME/bin:$PATH
git clone --depth=1 https://github.com/jrudolph/perf-map-agent
cd perf-map-agent
cmake .
make
bin/create-links-in /usr/bin git clone https://github.com/brendangregg/FlameGraph.git
export FLAMEGRAPH_DIR=/root/git/FlameGraph
# jvm启动参数需要增加
-XX:+PreserveFramePointer perf-java-flames 21322
export PERF_RECORD_SECONDS=45

结果展示

svg格式的图片可以下钻,点击查看:

Docker内怎么办?

https://github.com/jvm-profiling-tools/perf-map-agent/issues/50

https://blog.alicegoldfuss.com/making-flamegraphs-with-containerized-java/

https://github.com/mboussaa/docker-flame-graphs

http://www.batey.info/docker-jvm-flamegraphs.html

容器内如何分析?

请参考笔者的另一篇文章Docker中使用FlameGraph分析JVM应用性能

更多参考

https://www.meiwen.com.cn/subject/xafqkqtx.html
https://bugs.openjdk.java.net/browse/JDK-8068945
https://bugs.openjdk.java.net/browse/JDK-6515172
http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-December/016477.html
https://medium.com/netflix-techblog/java-in-flames-e763b3d32166
https://blog.codecentric.de/en/2017/09/jvm-fire-using-flame-graphs-analyse-performance/
https://github.com/jvm-profiling-tools/honest-profiler/wiki/How-to-Run
https://gperftools.github.io/gperftools/pprof-vsnprintf-big.gif
https://github.com/jvm-profiling-tools/perf-map-agent
http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html#Java
http://www.brendangregg.com/blog/2014-06-12/java-flame-graphs.html
https://github.com/brendangregg/FlameGraph

微信订阅号

最新文章

  1. IOS开发基础知识--碎片34
  2. 学习记录之APPCan
  3. Git使用文档
  4. find命令中参数perm的用法
  5. JSON对象和string的相互转换
  6. 使用Log4Net发送日志邮件 (转载)
  7. Bash从路径中获取文件名
  8. Xcode Build Setting Reference
  9. C#访问修饰符(public,private,protected,internal,sealed,abstract)
  10. BugFix:URL or HTTP headers are too long (IP=127.0.0.1)
  11. Kafka系列2-producer和consumer报错
  12. Linux(CentOS-7) 下载 解压 安装 redis 操作的一些基本命令
  13. java死锁示例及其发现方法
  14. poj2114 树分治(点分治)
  15. Impala shell详解
  16. Java项目的结构
  17. vue操作本地存储
  18. NSUserDefaults设置bool值重启后bool只设置丢失问题
  19. MySQL初始化设置
  20. Week11《java程序设计》作业总结

热门文章

  1. Usaco Training [2.1] The Castle 搜索
  2. Go中的结构体
  3. Vue系列:Vue Router 路由梳理
  4. Sentry错误日志监控你会用了吗?
  5. pythonday04数据类型(二)
  6. Java学习|多线程学习笔记
  7. 如何让textarea placeholder 文字垂直居中
  8. c# 20160721
  9. CentOS 安装 JDK 三种形式详细总结
  10. redis 有没有ACID事务