perf分析unixbench性能
  ©著作权归作者所有:来自51CTO博客作者梧桐0928的原创作品,如需转载,请注明出处,否则将追究法律责任
https://blog.51cto.com/songhl/2531799
本文讲述使用unixbench压测试file copy压测性能分析
- 安装unixbench软件
 
wget https://codeload.github.com/kdlucas/byte-unixbench/tar.gz/v5.1.3 
tar zxvf v5.1.3
 1
2
2
- 安装perf命令
 
-   Cent OS/RHEL:yum install perf
-   Fedora:dnf install perf
-   SUSE:zypper install perf
-   Ubuntu:apt install linux-tools-common
 1
2
3
4
2
3
4
3.使用perf记录unixbench性能热点函数  
`perf -F 99 -a -g ./Run -c 8 fsdisk`  
perf说明:  
\-F 为监控频率为1秒钟监控99次  
\-a 分析整个系统的性能  
\-g 记录函数简的调用关系  
unixbench说明:  
\-c 使用8 core进行压测.  
fsdisk 只压测file copy模式.  
压测结果:  

使用perf查看检测报告分析热点函数
perf report -n

生产火焰图
FlameGrph地址: https://github.com/brendangregg/FlameGraph (opens new window)
下载软件:wget https://github.com/brendangregg/FlameGraph/archive/master.zip unzip master.zip export PATH=$PATH:./FlameGraph-master1
2
3perf script -i perf.data > unixbench.perf stackcollapse-perf.pl unixbench.perf >unixbench.folded flamegraph.pl unixbench.folded >unixbench.svg1
2将unixbench.svg下载windows后, 浏览器打开即可
查看最后效果.

上次更新: 2023/10/10, 14:48:21