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. tihs 关键字

    //this关键词 /*调用类中的属性 调用类中的方法或构造方法 调用当前对象,调用自己的方法,可以省略. */ //http://blog.sina.com.cn/s/blog_71f6c19801 ...

  2. 读书笔记——spring cloud 中 HystrixCommand的四种执行方式简述

    读了<Spring Cloud 微服务实战>第151-154页, 总结如下: Hystrix存在两种Command,一种是HystrixCommand,另一种是HystrixObserva ...

  3. 【php正则】php正则匹配UTF-8格式的中文汉字 和 【,】【,】【。】等符号

    1.php正则匹配UTF-8格式的中文汉字 和 [,][,][.]等符号 if (preg_match_all("/([\x{4e00}-\x{9fa5}]+((,)?)+((,)?)+(( ...

  4. Swift3 CADisplayLink简单用法

    1.定义属性 var displayLinkTimer:CADisplayLink? = nil 2.init displayLinkTimer = CADisplayLink(target: sel ...

  5. wordpress搭建博客上传begin主题The themes is locked to another domain

    如题, 在使用wordpress搭建个人博客过程中, 上传begin主题, 出现如下弹框的错误, 而且样式有误. 环境: Los Angeles CentOS 7 x64 nginx+mysql 解决 ...

  6. Spring4+Hibernate4事务小记

    学习Spring+Hibernate,非常强大的框架,为了追新,就直接从最高版本开始学习了,这要冒很大的风险,因为网上可查到的资料大多是针对旧版本的,比如Spring3,Hibernate3. 根据我 ...

  7. Lua协程学习

    按照书上码了下,但运行有问题,暂时不知道原因: function send (x) coroutine.yield(x) end function producer() return coroutin ...

  8. 在Hadoop1.2.1上运行第一个Hadoop程序FileSystemCat

  9. k8s官方安装版本

    一.概述 官方安装链接:https://kubernetes.io/docs/getting-started-guides/kubeadm/ 之前使用是yum直接安装组件,现由kubeadm来自动安装 ...

  10. java多线程学习--java.util.concurrent (转载)

    题记:util和concurrent 包是后续重点先看的和学习的模块 原文地址:http://www.cnblogs.com/sunhan/p/3817806.html CountDownLatch, ...