压力测试工具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 ...
随机推荐
- python之函数用法capitalize()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法capitalize() #capitalize() #说明:将字符串的第一个字母变成 ...
- fnmatch源码阅读
源码下载地址如下: http://web.mit.edu/freebsd/csup/fnmatch.h http://web.mit.edu/freebsd/csup/fnmatch.c 代码整体不错 ...
- android手机导入.cer证书文件的方法
访问很多https协议的网站需要安装证书,手机也可以导入cer文件,你知道么?本文将通过简单的两步告诉你手机安装cer文件的方法. 步骤一:请先将数字证书文件“******.cer”文件复制到SD卡的 ...
- >/dev/null 2>&1 这句话的含义及使用的意义
一般在shell包括dos下都可能会这样使用. null是一个名叫null小桶的东西,将输出重定向到它的好处是不会因为输出的内容过多而导致文件大小不断的增加.其实,你就认为null就是什么都没有,也就 ...
- Shell日期处理
在类Unix系统中,日期被存储成一个整数,其大小为自世界标准时间(UTC)①1970年1月1日0时0分0秒②起所流逝的秒数.这种计时方式称为纪元时或Unix时间.(1) 读取日期:[root@serv ...
- Struts1与Struts2的那些事
一.概述 Struts1以ActionServlet作为核心控制器,由ActionServlet负责拦截用户的全部请求.Struts1框架有3个重要组成部分:Action.ActionForm和Act ...
- ios中 radioButton和DataPIcker,九宫格封装好使用
下载地址 http://pan.baidu.com/share/link?shareid=2894506499&uk=923776187 引用这几个文件 radiobutton.封装好单选按钮 ...
- ios中封装九宫格的使用(二级导航)
效果图 一般用于导航功能 第一步下载http://pan.baidu.com/share/link?shareid=1824940819&uk=923776187 第二步 把下图内容放在你的x ...
- [转载]Ubuntu安装配置 git 服务器和客户端
原文地址:Ubuntu安装配置 git 服务器和客户端作者:ding404 1.配置前准备 服务器:安装ssh server另外还装了gitosis做git的权限管理 sudo apt-get ins ...
- Using 1-Wire device with Intel Galileo
Using 1-Wire device with Intel Galileo 3 Replies Many people have had trouble with getting 1-Wire de ...