Linux下单独安装apache ab

1.yum install apr-util

2.yum install yum-utils

3.cd /opt

4.mkdir abtmp

5.cd abtmp

6.yum install yum-utils.noarch

7.yumdownloader httpd-tools*

8.rpm2cpio httpd-*.rpm | cpio -idmv

9.ln -s /opt/abtmp/usr/bin/ab /usr/bin/ab

参数详解:

-n requests     Number of requests to perform

//在测试会话中所执行的请求个数。默认时,仅执行一个请求

-c concurrency Number of multiple requests to make

//一次产生的请求个数。默认是一次一个。

-t timelimit    Seconds to max. wait for responses

//
测试所进行的最大秒数。其内部隐含值是
 
-n 50000
。它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。

-p postfile     File containing data to POST

//包含了需要POST 的数据的文件 .

-T content-type Content-type header for POSTing

//POST
数据所使用的
Content-type
头信息。

-v verbosity    How much troubleshooting info to print

//
设置显示信息的详细程度
 
- 4
或更大值会显示头信息,
 
3
或更大值可以显示响应代码
 
(404, 200

), 2
或更大值可以显示警告和其他信息。
 
-V
 
显示版本号并退出。

-w              Print out results in HTML tables

//

HTML
 
表的格式输出结果。默认时,它是白色背景的两列宽度的一张表。

-i              Use HEAD instead of GET

//
 
执行
HEAD
 
请求,而不是
 
GET

-x attributes   String to insert as table attributes

//

-y attributes   String to insert as tr attributes

//

-z attributes   String to insert as td or th attributes

//

-C attribute    Add cookie, eg. ‘Apache=1234. (repeatable)

//-C cookie-name=value 对请求附加一个 Cookie:行。 其典型形式是 name=value的一个参数对。此参数可以重复。

-H attribute    Add Arbitrary header line, eg. ‘Accept-Encoding: gzip‘

Inserted after all normal header lines. (repeatable)

-A attribute    Add Basic WWW Authentication, the attributes

are a colon separated username and password.

-P attribute    Add Basic Proxy Authentication, the attributes

are a colon separated username and password.

//-P proxy-auth-username:password
 
对一个中转代理提供
 
BASIC
认证信任。用户名和密码由一个
 
:
隔开,并以
base64
 
编码形式发送。无论服务器是否需要
 
(

,
 
是否发送了
 
401
认证需求代码
)
,此字符串都会被发送。

-X proxy:port   Proxyserver and port number to use

-V              Print version number and exit

-k              Use HTTP KeepAlive feature

-d              Do not show percentiles served table.

-S              Do not show confidence estimators and warnings.

-g filename     Output collected data to gnuplot format file.

-e filename     Output CSV file with percentages served

结果详解:

Server Software:         Microsoft-IIS/7.0
Server Hostname:        www.newdev.gztest.com
Server Port:            80
Document Path:         
Document Length:        82522 bytes  #请求文档大小

Concurrency Level:      50           #并发数  
Time taken for tests:   92.76140 seconds #全部请 求完成耗时
Complete requests:      10000          #全部请求数
Failed requests:        1974           #失败的请求
  (Connect: 0, Length: 1974, Exceptions: 0)
Write errors:           0
Total transferred:      827019400 bytes   #总传输大小 
HTML transferred:       825219400 bytes //整个场 景中的HTML内容传输量
Requests per second:    108.61 [#/sec] (mean)   #每秒请 求数(平均)//大家最关心的指标之一,相当于 LR 中的每秒事务数,后面括 号中的 mean 表示这是一个平均值
Time per request:       460.381 [ms] (mean)   #每次并发请求时间(所有并发) //大家最关心的指标之二,相当于 LR 中的平均事务响应时间, 后面括号中的 mean 表示这是一个平均值
Time per request:       9.208 [ms] (mean, across all concurrent requests)   #每一请求时间(并发平均)  //每个请求实际运行时间的平均值
Transfer rate:          8771.39 [Kbytes/sec] received    #传输速 率//平 均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题
Percentage of the requests served within a certain time (ms)

50%   2680

66%   2806

75%   2889

80%   2996

90%  11064

95%  20161

98%  21092

99%  21417

100%  21483 (longest request)

//整个场景中所有请求的响应情况。在场景中每个请求都有一个响应时间,其 中50%的用户响应时间小于2680
毫秒,60% 的用户响应时间小于2806
毫秒,最大的响应时间小于21417
毫秒

由于对于并发请求,cpu实际上并不是同时处理的,而是按照每个 请求获得的时间片逐个轮转处理的,所以基本上第一个Time per request时间约等于第二个Time per request时间乘以并发请求数。

时间: 2024-08-02 06:04:06

Linux下单独安装apache ab的相关文章

Linux下编译安装Apache httpd 2.4

Apache是世界使用排名第一的Web服务器软件.它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一.当前Apache版本为2.4,本文主要描述基于CentOS 6.5以源码方式安装Apache httpd. 一.编译安装的优势 源码的编译安装一般由3个步骤组成: 配置(configure),通常依赖gcc编译器,binutils,glibc.配置软件特性,检查编译环境,生成 Makefile文件 编译(make) 安装(make ins

linux下手动安装apache详解

操作系统:ubuntu12.04 前言:    linux下,默认安装软件,在开发过程中会经常不知道到什么路径下找到所需的程序,因此手动安装程序对后续的使用会提供非常大的便利.在此,以安装apache为例. 一,准备    1,安装 apr        下载地址:http://apr.apache.org/download.cgi [[email protected]:/work/soft/apache]# tar jxvf apr-1.5.0.tar.bz2 [[email protecte

Linux下编译安装Apache及模块

Apache是使用非常广泛的web服务器,多平台支持,是时下最流行的Web服务器端软件之一.Apache快速.可靠,并且可通过简单的API扩充,就可以集成PHP/Python等语言解释器.文章这里讲解如何在linux下编译 Apache,以及如何编译Apache模块. linux下编译Apache 下载Apache源代码,编译过程如下: $ wget http://apache.fayea.com//httpd/httpd-2.4.12.tar.gz $ tar -zxf httpd-2.4.1

linux下编译安装apache

在linux(CentOS6.5)上安装Apache,要首先确保以下程序事先安装 apr:The mission of the Apache Portable Runtime (APR) project is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementations.The

linux下如何安装Apache软件

安装步骤如下: 首先查询是否已经安装,用命令rpm    -qa    httpd ,如果已经安装则显示已经安装Apache软件信息,否则不显示: 如果你不是root用户登录的话,那么需要把用户切换到到root,使用命令su - (注意:-不能少,代表root环境变量也传递过来了,就是真正的root); 使用命令 yum install httpd -y,开始安装软件,安装结束后最后一行有complete信息提示; 再次使用 命令rpm    -qa    httpd,如果安装成功了则有Apac

linux下单独安装ab

很多网上介绍的都很旧了,最快的方法: yum install httpd-tools 完成后,就可以直接运行ab

Linux下单独安装Oracle客户端

〇.前言 百度上面搜索的资料,都是垃圾资料,而且例子都是相互复制,确没有何参考价值, 最可烦的是需要安装oracle 远程客户端,他们那些笨蛋都是以本地为主,一般情况下本地如果有安装oracle, 也会安装好客户端,不需要那如群笨蛋发布那些无用的信息,浪费人家的时间.本文参考http://www.cnblogs.com/joeblackzqq/archive/2011/03/19/1988915.html http://wenku.baidu.com/view/bc8a311afad6195f3

linux下单独安装oracle12.1客户端

1.安装oracle-instantclient:(默认安装即可) oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpmoracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpmoracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm2.配置环境变量,修改/etc/profile,文件最后加入以下内容:export ORACLE_HOM

linux下单独配置subversion方法

linux下单独(不附带apache)配置subversion方法: 安装过程: 1.软件下载.我下载的是 subversion-1.6.5.tar.gz 和 subversion-deps-1.6.5.tar.gz ,前者是 svn1.6.5 的源文件,后者是编译时可能需要用到的包.软件下载地址如下 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74 2.解压两个文件进入同