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静态资源的性能测试的更多相关文章

  1. 压力测试工具ab及centos下单独安装方法

    压力测试工具Ab简介 Apache安装包中自带的压力测试工具 Apache Benchmark(简称ab) 简单易用,这里就采用 ab作为压力测试工具了. 1.独立安装 ab运行需要依赖apr-uti ...

  2. Apache中压力测试工具ab的操作说明

    1.压力测试工具ab(ApacheBench)的简单说明 1)     网站性能压力测试是性能调优过程中必不可少的一环.只有让服务器处在高压情况下才能真正体现出各种设置所暴露的问题.Apache中有个 ...

  3. Apache自带压力测试工具ab用法简介

    ab命令原理 ab命令会创建很多的并发访问线程,模拟多个访问者同时对某一URL进行访问.它的测试目标是基于URL的,因此,既可以用来测试Apache的负载压力,也可以测试nginx.lighthttp ...

  4. apache自带压力测试工具ab的使用及解析

    当你搭建了apache服务器并在上面部署了web网站,在网站运行前,为了使apache服务器的性能得到更好的应用,我们可以先对其进行压力测试.进行压力测试其实非常简单,我们也不用再额外下载安装什么测试 ...

  5. httpd的压力测试工具-ab工具使用案例

    httpd的压力测试工具-ab工具使用案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.   一.httpd自带的工具程序 事实上,在我们安装完Apache之后,它默认就会给我们安 ...

  6. linux下web压力测试工具ab使用及详解

    APACHE自带的测试工具AB(apache benchmark).在APACHE的bin目录下.格式: ./ab [options] [http://]hostname[:port]/path参数: ...

  7. Mac下的Web性能压力测试工具:ab(ApacheBench)

    Web开发,少不了的就是压力测试,它是评估一个产品是否合格上线的基本标准. ab是一种用于测试Apache超文本传输协议(HTTP)服务器的工具.apache自带ab工具,可以测试Apache.IIS ...

  8. web 压力测试工具ab压力测试详解

    Web性能压力测试工具之ApacheBench(ab)详解 原文:http://www.ha97.com/4617.html PS:网站性能压力测试是性能调优过程中必不可少的一环.只有让服务器处在高压 ...

  9. 压力测试工具ab使用

    ab全名是apache bench,是apache自带的一款压力测试工具.它通过创建多个线程来模拟并发,测试目标是基于URL的,因此不论是什么web服务器都可以支持. 使用ab非常简单,进入apach ...

随机推荐

  1. OpenCV学习代码记录——canny边缘检测

    很久之前学习过一段时间的OpenCV,当时没有做什么笔记,但是代码都还在,这里把它贴出来做个记录. 代码放在码云上,地址在这里https://gitee.com/solym/OpenCVTest/tr ...

  2. Struts2+JSON数据

    待整理 参考 http://yshjava.iteye.com/blog/1333104 http://kingxss.iteye.com/blog/1622455 JSON中,java.lang.N ...

  3. RHEL7体验KVM虚拟机

    KVM是基于内核2.6+的虚拟化,前提是硬件须支持虚拟化! Red Hat Enterprise Virtualization-Management,即RHEV-M(管理多个RHEV-H系统) 虚拟化 ...

  4. 转:CMake快速入门教程-实战

    CMake快速入门教程:实战 收藏人:londonKu     2012-05-07 | 阅:10128  转:34    |   来源   |  分享               0. 前言一个多月 ...

  5. Linux下的二进制兼容性的检测

    都知道Linux的二进制兼容与windows相比简直是天差地别,windows的二进制兼容做得特别好,很老的游戏都能在windows 10上跑,写的好的程序,在XP上也不是不可以.但是Linux就不一 ...

  6. CSS3 flex的使用方法

    display:flex; align-items://水平对齐方式 justify-content://垂直对齐方式 flex://盒子所占大小(如果你盒子里面只有两个div,那么你设置其中之一个f ...

  7. db_table--Spring Security3.1 最新配置实例

    2011-04-28 这几天学习了一下Spring Security3.1,从官网下载了Spring Security3.1版本进行练习,经过多次尝试才摸清了其中的一些原理.本人不才,希望能帮助大家. ...

  8. IPsec ISAKMP(转)

    IPsec ISAKMP 2010-08-10 11:47:01 标签:IPsec 职场 休闲 ISAKMP Interne 安全连接和密钥管理协议(ISAKMP)是 IPsec 体系结构中的一种主要 ...

  9. TensorFlow实战

    TensorFlow实战:Chapter-1(TensorFlow介绍) TensorFlow实战:Chapter-2(TensorFlow入门) TensorFlow实战:Chapter-3(CNN ...

  10. mysql FullText全文索引的问题

    今天有同学问题,搜索ip的时候怎样能把 select ip from tabelx where ip like '%192.168.0.1%' 这种句子的性能优化. 的确,使用 like %x 的方式 ...