Centos服务器使用Apache测试压力工具
Centos服务器测试压力我们可以使用Apache自带的压力测试的工具ab(ApacheBench),做一些简单的压力测试。
centos服务器安装ab工具。
1 |
yum install httpd-tools |
执行压力测试命令:
1 |
ab -n 1000 -c 100 http://xx |
-n 后面的1000代表总共发出1000个请求;-c后面的100表示采用100个并发(模拟100个人同时访问),后面的网址表示测试的目标URL。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
[root@Tomcat ab]# ab -c 1000 -n 4000 http://192.168.0.222/docs/manager-howto.html This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright 2006 The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.0.222 (be patient) Completed 400 requests Completed 800 requests Completed 1200 requests Completed 1600 requests Completed 2000 requests Completed 2400 requests Completed 2800 requests Completed 3200 requests Completed 3600 requests Finished 4000 requests Server Software: nginx/1.4.3 Server Hostname: 192.168.0.222 Server Port: 80 Document Path: /docs/manager-howto.html Document Length: 73924 bytes Concurrency Level: 1000 Time taken for tests: 0.875928 seconds Complete requests: 4000 Failed requests: 0 Write errors: 0 Total transferred: 296732000 bytes HTML transferred: 295696000 bytes Requests per second: 4566.59 [#/sec] (mean) #最重要的指标之一,相当于LR中的每秒事务数,后面括号中的mean表示这是一个平均值,越大抗压越强 Time per request: 218.982 [ms] (mean) #最重要的指标之二,相当于LR中的平均事务响应时间,后面括号中的mean表示这是一个平均值 Time per request: 0.219 [ms] (mean, across all concurrent requests) Transfer rate: 330822.86 [Kbytes/sec] received #平均每秒网络上的流量,吞吐量,越大抗压越强 Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 4.5 0 29 Processing: 1 17 14.5 17 653 Waiting: 0 17 14.5 17 653 Total: 15 18 15.2 17 674 Percentage of the requests served within a certain time (ms) 50% 17 66% 18 75% 18 80% 18 90% 20 95% 22 98% 37 99% 40 100% 674 (longest request) |
1. 带 [亲测] 说明源码已经被站长亲测过!
2. 下载后的源码请在24小时内删除,仅供学习用途!
3. 分享目的仅供大家学习和交流,请不要用于商业用途!
4. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
5. 本站所有资源来源于站长上传和网络,如有侵权请邮件联系站长!
6. 没带 [亲测] 代表站长时间紧促,站长会保持每天更新 [亲测] 源码 !
7. 盗版用户购买ripro美化无担保,若设置不成功/不生效我们不支持退款!
8. 本站提供的源码、模板、插件等其他资源,不包含技术服务请大家谅解!
9. 如果你也有好源码或者教程,可以发布本站,分享有金币奖励和额外收入!
©️创享网络科技工作室- 您的云上资源网;优质源码+优质服务=成功!
创科资源平台 » Centos服务器使用Apache测试压力工具
2. 下载后的源码请在24小时内删除,仅供学习用途!
3. 分享目的仅供大家学习和交流,请不要用于商业用途!
4. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
5. 本站所有资源来源于站长上传和网络,如有侵权请邮件联系站长!
6. 没带 [亲测] 代表站长时间紧促,站长会保持每天更新 [亲测] 源码 !
7. 盗版用户购买ripro美化无担保,若设置不成功/不生效我们不支持退款!
8. 本站提供的源码、模板、插件等其他资源,不包含技术服务请大家谅解!
9. 如果你也有好源码或者教程,可以发布本站,分享有金币奖励和额外收入!
©️创享网络科技工作室- 您的云上资源网;优质源码+优质服务=成功!
创科资源平台 » Centos服务器使用Apache测试压力工具