Erlang13A出来后,有人就做了
新旧版本的性能测试。作者自己写了小小的Web服务器进行测试,测试工具是apaceh的
ab,这是个命令行工具
参考
ab工具可以将测试结果输出到方便gnuplot处理的文本文件中。
方法是使用-g参数其结果可以输出到指定文件
$ab -g result.txt -n 1000 -c 100 http://www.hao123.com/
$ head result.txt
starttime seconds ctime dtime ttime wait
Thu Mar 19 00:58:35 2009 1237395515 3 5 8 4
Thu Mar 19 00:58:34 2009 1237395514 3 5 8 4
Thu Mar 19 00:58:29 2009 1237395509 3 5 8 4
Thu Mar 19 00:58:34 2009 1237395514 3 5 8 4
Thu Mar 19 00:58:34 2009 1237395514 3 5 8 4
Thu Mar 19 00:58:29 2009 1237395509 3 5 8 4
Thu Mar 19 00:58:34 2009 1237395514 3 5 8 4
Thu Mar 19 00:58:35 2009 1237395515 3 5 8 4
Thu Mar 19 00:58:34 2009 1237395514 3 5 8 4
每一行代表一个请求,被空格划分成10个column,我们关心的是第7、8、9、10行的数据,分别代表:
ctime:connection time
dtime: processing time
ttime: total time, = connection time + processing time
wait:wait time
$ gnuplot
set terminal png
set output "http_benchmark.png"
set xlabel "request"
set ylabel "ms"
plot "http_benchmark.txt" using 7 with lines title "ctime", \
"http_benchmark.txt" using 8 with lines title "dtime", \
"http_benchmark.txt" using 9 with lines title "ttime", \
"http_benchmark.txt" using 10 with lines title "wait"
Lies, Damned Lies, and Benchmarks中的数据不是直接来自-g参数生成的文件,每次ab执行完后会打印此次测试的概要:
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8889
Document Path: /
Document Length: 1 bytes
Concurrency Level: 10
Time taken for tests: 14.004 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 390000 bytes
HTML transferred: 10000 bytes
Requests per second: 714.09 [#/sec] (mean)[color=red][/color]
Time per request: 14.004 [ms] (mean)
Time per request: 1.400 [ms] (mean, across all concurrent requests)
Transfer rate: 27.20 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 11 347.8 0 11005
Processing: 0 3 11.5 2 443
Waiting: 0 2 11.5 2 443
Total: 0 14 348.0 2 11012
Percentage of the requests served within a certain time (ms)
50% 2
66% 3
75% 3
80% 3
90% 4
95% 7
98% 12
99% 13
100% 11012 (longest request)
每次在不同并发请求下测试每秒能处理的请求数,在不同并发请求情况下多次测试取平均值。
在一张图中表现两条完全不同尺度的曲线的例子:
例如,曲线1的y值范围在1~2间,曲线2的y值范围在0~3000之间
数据例子如下
1701 1076.20 1.277
1751 1111.68 1.280
1801 1145.26 1.283
1851 1170.67 1.279
1901 1213.69 1.292
1951 1236.83 1.282
2001 1273.59 1.284
2051 1309.72 1.283
gnuplot命令如下:
set y2tics 0, 250
set ytics nomirror
plot 'data.txt' using 1:3 with lines,\
'data.txt' using 1:2 axes x1y2 with lines
更多更详细的例子
参考文档:
http://iceskysl.1sters.com/?action=show&id=386
http://www.ibm.com/developerworks/cn/linux/l-gnuplot/index.html
http://www.lotto-kim.net/eng/blog/using_gnuplot_to_show_results_from_ab
分享到:
相关推荐
gp424win32.zip gp424win32.zip gnuplot for windows gnuplot for windows gnuplot for windows gnuplot for windows
gnuplot 4.0 for windows
例如,如果您正在运行一系列的实验,需要每次运行后都查看结果图表;或者当您在图表最初生成很久以后需要返回图表修改某些内容时,批处理模式能力会特别有用。当在 WYSIWIG 编辑器中很难捕获用于修饰图表的鼠标单击...
用于gnuplot的安装调试
gnuplot5.0
gnuplot 函数绘图工具!
性能测试积累整理:1.关于监控脚本;2.关于Gnuplot绘图工具的说明;3.Linux监控命令的积累
在linux下需要对数据进行统计画图的时候,常常用到gnuplot工具。比如做NS2仿真的时候,最经常使用。本资源通过自己的学习心得,整理了gnuplot作图常用的基本命令。希望对大家有所帮助。
gnuplot 使用技巧 画图 仿真 NS
Gnuplot is a portable command-line driven graphing utility for linux, OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don't have ...
主要介绍了编写Bash Shell通过gnuplot绘制系统性能数据图的方法,做到可视化数据收集,需要的朋友可以参考下
Linux下gnuplot的安装包下载,其安装步骤见我的博客:gnuplot压缩包以及Linux系统中gnuplot安装详解
Gnuplot是一款适用于Linux,OS / 2,MS Windows,OSX,VMS和许多其他平台的便携式命令行驱动图形工具。源代码受版权保护,但免费分发(即,您不必为此付费)。它最初创建的目的是让科学家和学生能够交互式地将数学...
gnuplot 英文文档gnuplot 英文文档gnuplot 英文文档
gnuplot 4.6 win 版. 一个命令行的交互式绘图工具
gnuplot5.2 的官方文档,详细描述了gnuplot的使用方法,各种参数说明。 画图必备
用gnuplot画图
gnuplot 5.3英文手册 gnuplot 5.3英文手册 gnuplot 5.3英文手册 gnuplot 5.3英文手册
gnuplot绘图工具(转)gnuplot绘图工具(转)