压力测试工具ab及centos下单独安装方法 nginx和tomcat静态资源的性能测试
Apache安装包中自带的压力测试工具Apache Benchmark(简称ab)简单易用,这里采用ab作为压国测试工具.
独立安装:
ab运行需要信赖apr-util包:
# yum install apr-util
安装信赖yum-utils中的yumdownload工具如果没有找到yumdownload
# yum install yum-utils
安装完成执行以下指令
[root@localhost opt]# cd /opt/
[root@localhost opt]# mkdir abtmp
[root@localhost opt]# cd abtmp/
[root@localhost abtmp]# yum install yum-utils.noarch
[root@localhost abtmp]# yumdownloader httpd-tools*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors..com
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
httpd-tools-2.4.-.el7.centos..x8 | kB :
[root@localhost abtmp]# ls
httpd-tools-2.4.-.el7.centos..x86_64.rpm
安装:
[root@localhost abtmp]# rpm -ihv httpd-tools-2.4.-.el7.centos..x86_64.rpm
Preparing... ################################# [%]
Updating / installing...
:httpd-tools-2.4.-.el7.centos. ################################# [%]
下面对NGINX做测试:
# ab -n -c100 123.57.36.227/index.html
This is ApacheBench, Version 2.3 <$Revision: $>
Copyright Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 123.57.36.227 (be patient)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests #处理1000个请求 Server Software: nginx/1.6.
Server Hostname: 123.57.36.227
Server Port: Document Path: /index.html
Document Length: bytes #与Tomcat请求页面的节数大小一致 Concurrency Level:
Time taken for tests: 2.539 seconds
Complete requests:
Failed requests:
Write errors:
Total transferred: bytes
HTML transferred: bytes
Requests per second: 393.82 [#/sec] (mean)#吞吐量:393.82/s
Time per request: 253.920 [ms] (mean)#每个请求的平均处理时间
Time per request: 2.539 [ms] (mean, across all concurrent requests)
Transfer rate: 93.07 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 308.8
Processing: 126.9
Waiting: 126.9
Total: 337.1 Percentage of the requests served within a certain time (ms)
%
%
%
% 213#80%的请求在213ms之内完成
%
%
%
%
% (longest request)#1624ms完成100%的请求
下面对tomcat做测试:
# ab -n 1000 -c100 123.57.36.227:8080/index.jsp
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 123.57.36.227 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests # Server Software: Apache-Coyote/1.1
Server Hostname: 123.57.36.227
Server Port: 8080 Document Path: /index.jsp
Document Length: 13 bytes Concurrency Level: 100
Time taken for tests: 4.101 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 254000 bytes
HTML transferred: 13000 bytes
Requests per second: 243.84 [#/sec] (mean)
Time per request: 410.111 [ms] (mean)
Time per request: 4.101 [ms] (mean, across all concurrent requests)
Transfer rate: 60.48 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 2 46 201.0 4 1007
Processing: 3 266 610.4 68 3232
Waiting: 3 255 609.2 57 3232
Total: 6 312 628.6 83 3238 Percentage of the requests served within a certain time (ms)
50% 83
66% 149
75% 217
80% 295
90% 1010
95% 1449
98% 3164
99% 3191
100% 3238 (longest request)
对比两数值除理1000个请求tomcat所用的时间是nginx的(3238/1624=1.99)2倍时间!
压力测试工具ab及centos下单独安装方法 nginx和tomcat静态资源的性能测试的更多相关文章
- 压力测试工具ab及centos下单独安装方法
压力测试工具Ab简介 Apache安装包中自带的压力测试工具 Apache Benchmark(简称ab) 简单易用,这里就采用 ab作为压力测试工具了. 1.独立安装 ab运行需要依赖apr-uti ...
- Apache中压力测试工具ab的操作说明
1.压力测试工具ab(ApacheBench)的简单说明 1) 网站性能压力测试是性能调优过程中必不可少的一环.只有让服务器处在高压情况下才能真正体现出各种设置所暴露的问题.Apache中有个 ...
- Apache自带压力测试工具ab用法简介
ab命令原理 ab命令会创建很多的并发访问线程,模拟多个访问者同时对某一URL进行访问.它的测试目标是基于URL的,因此,既可以用来测试Apache的负载压力,也可以测试nginx.lighthttp ...
- apache自带压力测试工具ab的使用及解析
当你搭建了apache服务器并在上面部署了web网站,在网站运行前,为了使apache服务器的性能得到更好的应用,我们可以先对其进行压力测试.进行压力测试其实非常简单,我们也不用再额外下载安装什么测试 ...
- httpd的压力测试工具-ab工具使用案例
httpd的压力测试工具-ab工具使用案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.httpd自带的工具程序 事实上,在我们安装完Apache之后,它默认就会给我们安 ...
- linux下web压力测试工具ab使用及详解
APACHE自带的测试工具AB(apache benchmark).在APACHE的bin目录下.格式: ./ab [options] [http://]hostname[:port]/path参数: ...
- Mac下的Web性能压力测试工具:ab(ApacheBench)
Web开发,少不了的就是压力测试,它是评估一个产品是否合格上线的基本标准. ab是一种用于测试Apache超文本传输协议(HTTP)服务器的工具.apache自带ab工具,可以测试Apache.IIS ...
- web 压力测试工具ab压力测试详解
Web性能压力测试工具之ApacheBench(ab)详解 原文:http://www.ha97.com/4617.html PS:网站性能压力测试是性能调优过程中必不可少的一环.只有让服务器处在高压 ...
- 压力测试工具ab使用
ab全名是apache bench,是apache自带的一款压力测试工具.它通过创建多个线程来模拟并发,测试目标是基于URL的,因此不论是什么web服务器都可以支持. 使用ab非常简单,进入apach ...
随机推荐
- 开源通用型渲染工具-SwiftShader--OpenGL的替代者
SwiftShader 是一款用于在 CPU 上进行高性能图形渲染的软件库.Google 已经在很多产品中使用该内容库,包括 Chrome.Android 开发工具和云服务.Swiftshader 从 ...
- Android ListView之选中(撤销选中)Item
在ContactListActivity中,点击未选中的item将其选中,再点击已选中的item撤销其选中 public void onItemClick(AdapterView<?> p ...
- 编程实践笔记{Java 线程 并发处理 Webservice}(转)
http://www.cnblogs.com/mingzi/archive/2009/03/09/1406694.html 1, 保证线程安全的三种方法: a, 不要跨线程访问共享变量 b, 使共享变 ...
- Spring异常解决 java.lang.NullPointerException,配置spring管理hibernate时出错
@Repository public class SysUerCDAO { @Autowired private Hibernate_Credit hibernate_credit; /** * 根据 ...
- memcached全面剖析--3.memcached的删除机制和发展方向
下面是<memcached全面剖析>的第三部分. 发表日:2008/7/16 作者:前坂徹(Toru Maesaka) 原文链接:http://gihyo.jp/dev/feature/0 ...
- C语言stat()函数:获取文件状态
相关函数:fstat, lstat, chmod, chown, readlink, utime 头文件:#include<sys/stat.h> #include<uninstd ...
- 【php】thinkphp以post方式查询时分页失效的解决方法
好久没有写博客了,最近说实话有点忙,各个项目都需要改bug.昨天晚上一直没有解决的php项目中的bug,就在刚才终于搞定,在这里还需要感谢博客园大神给的帮助! 具体问题描述 最近遇到一个非常棘手的问题 ...
- centos yum源
#remi的源 rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm --import /etc/pki/r ...
- Eclipse SQLExplorer插件的安装和使用
from: http://blog.csdn.net/flashlm/archive/2007/06/30/1672836.aspx 插件名称: SQLExplorer 插件分类: SQL Edito ...
- 一步一步掌握java的线程机制(一)----创建线程
现在将1年前写的有关线程的文章再重新看了一遍,发现过去的自己还是照本宣科,毕竟是刚学java的人,就想将java的精髓之一---线程进制掌握到手,还是有点难度.等到自己已经是编程一年级生了,还是无法将 ...