ab测试tomcat并发性能(APR模式)

APR模式下,性能有了明显的提高:


APR模式需要安装才能生效,我是在windows模式下安装APR。一般在Windows下,可以直接下载编译好的二进制版本的dll库文件来使Tomcat启用 APR,下载地址是:http://tomcat.heanet.ie/native/1.1.19/binaries/win32/

我使用tomcat6.0.23 最低版本装1.1.18,下载 tcnative-1.dll之后,拷贝到bin下覆盖原 tcnative-1.dll,安装完成。

启动tomcat,可以看到如下的字样,表示安装成功:


测试arp下的并发情况:

第一次测试:

 100%    680 (longest request)

第二次测试:

C:\Users\kxm>ab -k -n 5000 -c 500 http://localhost:8080/SMS
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/


Benchmarking localhost (be patient)
Completed 500 requests
..........................
Concurrency Level:      500
Time taken for tests:   3.923 seconds
Complete requests:      5000
Failed requests:        0
Write errors:           0
Non-2xx responses:      5000
Keep-Alive requests:    0
Total transferred:      715000 bytes
HTML transferred:       0 bytes
Requests per second:    1274.46 [#/sec] (mean)
Time per request:       392.322 [ms] (mean)
Time per request:       0.785 [ms] (mean, across all concurrent requests)
Transfer rate:          177.98 [Kbytes/sec] received


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.5      0      13
Processing:    37  374  62.4    390     417
Waiting:        3  196 111.6    196     411
Total:         38  375  62.4    390     417


Percentage of the requests served within a certain time (ms)
  50%    390
  66%    395
  75%    399
  80%    403
  90%    408
  95%    414
  98%    415
  99%    416
 100%    417 (longest request)


相对BIO和NIO有了大幅提升。

暂时的结论是APR>BIO≌NIO。ARP优于BIO,BIO略优于NIO。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值