NginX 1.2.0 和 Resin 4.0.29 的性能比较测试

转:http://www.oschina.net/question/12_65400

我们最近对 Resin 4.0.29 和 NginX 1.2.0 进行了一些性能的测试,这个测试的结果显示 Resin Pro 的性能和吞吐量已经和 NginX 差不多,甚至有些地方还超过了 NginX。

 

测试工具

我们使用了下面两个工具进行测试:

httperf

Httperf 是个web 服务器的性能测试工具,来自惠普公司。支持 HTTP/1.1 和 SSL。

AutoBench

autobench 是一款基于httperf的 Perl脚本。它会在一次测试中调用多次httperf来对web服务器进行测试,每次会按照给定的参数增加并发连接数,将 httperf的测试结果保存为CSV格式的文件,该文件可以被Excel直接读取,方便生成测试报告。借助于autobench自带的 bench2graph工具可以生成漂亮的测试结果对比图。

Setup Overview

配置

NginX 配置 worker_processes 值为 8 来提升吞吐量。

硬件

客户端:

  • i7 4 core / 8 HT, 2.8 GHZ, 8Meg Cache, 8 GB RAM.
  • Ubuntu 12 / Linux Kernel 3.2.0-26-generic

服务器:

  • i7 4 core / 8 HT, 2.8 GHZ, 8Meg Cache, 8 GB RAM.
  • Ubuntu 12 / Linux Kernel 3.2.0-26-generic

测试软件:

  • Autobench 2.1.1
  • httperf 0.9.0

待测软件:

  • Resin Pro 4.0.29
  • nginx 1.2.0

0k 测试

命令行参数

0k.sh

1 ./admin.sh 300000 2000 20000 1000 0k

admin.sh

01 autobench_admin
02 --clients xen:4600,lancre:4600
03 --uri1 /file_$5.html
04 --host1 ch_resin --port1 8080
05 --uri2 /file_$5.html
06 --host2 ch_nginx --port2 80
07 --num_conn $1
08 --num_call 10
09 --low_rate $2
10 --high_rate $3
11 --rate_step $4
12 --timeout 3
13 --file out_con$1_start$2_end$3_step$4_$5.tsv

上述脚本用来设置 30 万的连接数,可高达 2 万到 20 万的请求数每秒。每次迭代都从 1 万到 20 万。

所测试的静态页面 file_0k.html

1 <html>
2  <body>
3  <pre></pre>
4  </body>
5 </html>

0K 的完整测试结果:

1K 测试

命令行

1k.sh

1 ./admin.sh 200000 1000 10000 250 1k

admin.sh

01 autobench_admin
02 --clients xen.caucho.com:4600,lancre.caucho.com:4600
03 --uri1 /file_$5.html
04 --host1 ch_resin --port1 8080
05 --uri2 /file_$5.html
06 --host2 ch_nginx --port2 80
07 --num_conn $1
08 --num_call 10
09 --low_rate $2
10 --high_rate $3
11 --rate_step $4
12 --timeout 3
13 --file out_con$1_start$2_end$3_step$4_$5.tsv

1k.html

01 html>
02 <body>
03 <pre>
04 0 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
05 1 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
06 2 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
07 3 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
08 4 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
09 5 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
10 6 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
11 7 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
12 8 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
13 9 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
14 </pre>
15 </body>
16 </html>

1k 完整测试结果

8K 测试

64K 测试

英文原文OSCHINA原创翻译

猜你喜欢

转载自chunguang.iteye.com/blog/1659803
今日推荐