FW 常见的性能测试工具有: loadRunner/netperf/httperf/apache_ab/Apache JMeter

常见的性能测试工具有: loadRunner/netperf/httperf/apache_ab/Apache JMeter ,

其中loadRunner属于付费软件,所以在这里不做介绍

netperf(HP公司维护的开源项目)

主要用来测量大数据量传输的时性能, 这也称作流或者单向流性能。

主要用来度量一个系统接收或者发送的数据有多快, 最简单的命令如下:

/opt/netperf/netperf -H remotehost

此外, tcp_stream_script和tcp_range_script(位于doc/examples目录下)两个脚本设置相关变量并调用

netperf对性能进行测试。

netperf另一个重要功能是对Request/response进行测试. request/response性能也被称作每秒事务数(transactions/s)。

默认命令如下:

/opt/netperf/netperf -H remotehost -t TCP_RR

有一个调用netperf对 request/response性能进行测试脚本是 tcp_rr_script,

httperf(HP公司维护的开源项目)

--server=S

Specifies the IP hostname of the server. By default, the hostname ‘‘localhost’’ is used.

--port=N

This option specifies the port number N on which the web server is listening for HTTP requests.

By default, httperf uses port number 80

--uri=S

Specifies that URI S should be accessed on the server.

-v

--verbose

Puts httperf into verbose mode.

--hog

This option requests to use up as many TCP ports as necessary. Without this option, httperf is

typically limited to using ephemeral ports (in the range from 1024 to 5000).

--max-connections=N

Specifies that at most N connections are opened for each session. This option is meaningful in

conjunction with options --wsess and --wsesslog only.

--num-calls=N

This option is meaningful for request?oriented workloads only. It specifies the total number of

calls to issue on each connection before closing it. If N is greater than 1, the server must support

persistent connections.

--num-conns=N

This option is meaningful for request?oriented workloads only. It specifies the total number of

connections to create. On each connection, calls are issued as specified by options --num-calls

and --burst-length.

--period=[D]T1[,T2]

Specifies the time interval between the creation of connections or sessions. Connections are created

by default, sessions if option --wsess or --wsesslog has been specified. This connection/

session ‘‘interarrival time’’ can alternatively be specified by the ??rate option, although more

flexibility is available with ??period.

--rate=X

Specifies the fixed rate at which connections or sessions are created. Connections are created by

default, sessions if option --wsess or --wsesslog has been specified. In both cases a rate of 0

results in connections or sessions being generated sequentially (a new session/connection is initiated

as soon as the previous one completes). The default value for this option is 0.

--session-cookie

When this option is turned on, cookie managment is enabled on a per?session basis.

--think-timeout=X

Specifies the maximum time that the server may need to initiate sending the reply for a given request.

--timeout=X

Specifies the amount of time X that httperf is willing to wait for a server reaction. The timeout is

specified in seconds and can be a fractional number (e.g., --timeout 3.5).

--close-with-reset

Requests that httperf closes TCP connections by sending a RESET instead of going through the

normal TCP connection shutdown handshake. Turning on this option can have ill effects such as

data corruption, stuck TCP control blocks, or wrong results. For this reason, the option should not

be used unless absolutely necessary and even then it should not be used unless its implications are

fully understood.

--client=I/N

Specifies that the machine httperf is running on is client I out of a total of N clients. I should be

in the range from 0 to R N ?1. Some of the workload generators (e.g., ??wset) use the client

identity as a bias value to ensure that not all clients generate perfectly identical workloads

httperf是一款测量web服务器性能的工具, 它可以采用HTTP/1.0或HTTP/1.1协议, 并能产生各种工作负载。

当运行时, 它记录一些性能指标并在测试运行的终端上将以统计数据的形式打印出来。

httperf最基本的操作是产生固定数目的HTTP GET请求并记录收到多少从服务器返回的应答。

为了获得正确的测试结果, 每台客户机最多只运行一个httperf进程,

并且在客户端和服务器端上最好不要运行后台进程。

EXAMPLES

httperf --hog --server www

This command causes httperf to create a connection to host www, send a request for the root document

(http://www/), receive the reply, close the connection, and then print some performance statistics.

httperf --hog --server www --num-conn 100 --ra 10 --timeout 5

Like above, except that a total of 100 connections are created and that connections are created at a

fixed rate of 10 per second. Note that option ‘‘--rate’’ has been abbreviated to ‘‘--ra’’.

httperf --hog --erver=www --wsess=10,5,2 --rate 1 --timeout 5

Causes httperf to generate a total of 10 sessions at a rate of 1 session per second. Each session

consists of 5 calls that are spaced out by 2 seconds.

httperf --hog --server=www --wsess=10,5,2 --rate=1 --timeout=5 --ssl

Like above, except that httperf contacts server www via SSL at port 443 (the default port for SSL

connections).

apache_ab(Apache Beach)

格式: ./ab [options] [http://]hostname[:port]/path

参数很多,一般我们用 -c 和 -n 参数就可以了. 例如:

./ab -c 100 -n 1000 http://127.0.0.1/index.php

这个表示同时处理100个请求并运行1000次index.php文件.

参数:

-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

-h Display usage information (this message)

// -attributes 设置 属性的字符串. 缺陷程序中有各种静态声明的固定长度的缓冲区。

// 另外,对命令行参数、服务器的响应头和其他外部输入的解析也很简单,这可能会有不良后果。

// 它没有完整地实现 HTTP/1.x; 仅接受某些‘预想‘的响应格式。 strstr(3)的频繁使用可能会带来性能问题,即, 你可能是在测试ab而不是服务器的性能。

// 参数的中文版

-A auth-username:password

向服务器提供基本认证信息。用户名和密码之间由一个":"隔开,并将被以base64编码形式发送。无论服务器是否需要(即是否发送了401认证需求代码),此字符串都会被发送。

-c concurrency

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

-C cookie-name=value

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

-d

不显示"percentage served within XX [ms] table"消息(为以前的版本提供支持)。

-e csv-file

产生一个逗号分隔(CSV)文件,其中包含了处理每个相应百分比请求(从1%到100%)所需要的相应百分比时间(以微秒为单位)。由于这种格式已经"二进制化",所以比"gnuplot"格式更有用。

-g gnuplot-file

把所有测试结果写入一个"gnuplot"或者TSV(以Tab分隔)文件。此文件可以方便地导入到 Gnuplot, IDL, Mathematica, Excel中。其中的第一行为标题。

-h

显示使用方法的帮助信息。

-H custom-header

对请求附加额外的头信息。此参数的典型形式是一个有效的头信息行,其中包含了以冒号分隔的字段和值(如:"Accept-Encoding: zip/zop;8bit")。

-i

执行HEAD请求,而不是GET 。

-k

启用KeepAlive功能,即在一个HTTP会话中执行多个请求。默认不启用KeepAlive功能。

-n requests

在测试会话中所执行的请求个数。默认仅执行一个请求,此时其结果不具有意义。

-p POST-file

包含了POST数据的文件。

-P proxy-auth-username:password

对一个中转代理提供基本认证信息。用户名和密码由一个":"隔开,并将被以base64编码形式发送。无论服务器是否需要(即是否发送了407代理认证需求代码),此字符串都会被发送。

-q

如果处理的请求数大于150,ab每处理大约10%或者100个请求时,会在stderr输出一个进度计数。此 -q 标记可以屏蔽这些信息。

-s

用于编译中(ab -h 会告诉你)使用了SSL的受保护的https ,而不是http协议的时候。此功能是实验性的,最好不要用。

-S

不显示中值和标准偏差值,而且在均值和中值为标准偏差值的1到2倍时,也不显示警告或出错信息。默认时,会显示最小值/均值/最大值等数值。(为以前的版本提供支持)

-t timelimit

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

-T content-type

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

-v verbosity

设置显示信息的详细程度,4或更大值会显示头信息,3或更大值可以显示响应代码(404,200等),2或更大值可以显示警告和其他信息。

-V

显示版本号并退出。

-w

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

-x <table>-attributes

设置<table>属性的字符串。此属性被填入<table 这里 > 。

-X proxy[:port]

对请求使用代理服务器。

-y <tr>-attributes

设置<tr>属性的字符串。

-z <td>-attributes

设置<td>属性的字符串。

Apache JMeter

这是一款很不错的性能测试软件, 它不仅功能强大而且还免费, 操作界面与LoadRunner相似。

它是一款用来对客户端/服务器软件(如web应用)进行负载测试的、 100%纯Java桌面应用。

它能来用对静态文件、 Java Servlet、 CGI脚本、Java对象、数据库、ftp服务器等静态和动态资源进行性能测试。

时间: 2024-08-05 02:40:46

FW 常见的性能测试工具有: loadRunner/netperf/httperf/apache_ab/Apache JMeter的相关文章

性能测试培训:Ajax接口级性能测试之jmeter版

性能测试培训:Ajax接口级性能测试之jmeter版 poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.在poptest认为工具不是问题,jmeter还是loadrunner都是工具级别的,真的提高性能测试水平,还是需要具备一定架构知识,网络知识,服务器方面的知识,poptest通过大量的实战案例的讲解提高学员的实战经验,尽快上手性能测试.(大家对课程感兴趣,请加qq:908821478) 1.  被测程序环境部署 对于自动化测

性能测试工具 - Apache JMeter (安装)

简介 Apache JMeter 是100%纯java语言开发的负载测试和性能测试开源工具. 功能 Apache JMeter可以对静态/动态资源进行性能测试,模拟多个用户并行请求资源端,以测试其强度或分析不同负载情况下的整体性能. 使用 1.下载Apache JMeter 访问http://jmeter.apache.org,点击菜单Download,下载对应程序. 或者使用brew 命令下载 $ brew install jmeter 2.运行JMeter $ open /usr/local

app性能测试【通过loadrunner录制】

随着智能手机近年来的快速增长,从游戏娱乐到移动办公的各式各样的手机APP软件渗透到我们的生活中,对于大型的手机APP测试不仅要关注它的功能性.易用性还要关注它的性能,最近发现LoadRunner12可以对手机APP做性能测试,但由于LoadRunner12还没有破解版最多只有50个并发用户,所以我用LoadRunner12录制手机APP的脚本后放到LoadRunner8.0里进行压测,LoadRunner8.0可并发10000个用户. 1.下载CCProxy代理服务器,安装运行该软件用来检测本机

为什么我们需要性能测试,需要loadrunner

什么是功能: 功能按我理解就是软件实现需求,提供服务,那么功能测试就是实现的需求是否与客户给定需求一致,也就是符合预期结果 什么是性能: 功能是实现需求,提供服务,那么性能就可以理解为服务的好坏.比如有两家快餐厅,它们都能提供上菜的需求,那么性能指提供的饭菜是否快,是否好吃:又比如两个相同的提供登录功能软件,一个登录时间为1s,另外一个登录时间需要两秒,那么很明显第一个登录软件的性能是较好.所以我们进行性能测试,也是鉴定一个软件提供的服务是好还是坏 是先测试功能还是性能: 实际应用中,我们一般流

性能测试:常见的性能测试缺陷

性能测试,是结合被测系统应用架构.业务场景和实现细节.逻辑,对软件响应时间.处理速率.容错能力等进行分析测试,找到系统的性能瓶颈,并确认问题得到解决的过程. 由于工作需要,对性能测试缺陷分类进行了整理,这篇博客,聊聊常见的性能缺陷以及表现方式... 性能测试缺陷分类 缺陷类型 缺陷描述 硬件 磁盘空间 CPU IO读写速率 内存 网络 带宽 网络波动 CDN 延时 丢包 应用 JVM 代码逻辑 配置 JDK版本 底层配置 参数配置 数据库 索引 锁 表空间 慢SQL 数据量 中间件 超时 线程池

GT手机性能测试工具二:项目中配置

GT demo官方示例文档 http://gt.qq.com/docs/i/GTiOSUserGuide.pdf 云笔记中实践GT过程 云笔记项目中嵌入GT framework: step1 下载framework SDK 下载地址 http://gt.qq.com/download.html iOS平台 最新release版是 v2.2.3,发布日期是2015年8月26日. GT SDK: GT.embeddedframework_v2.2.3.tar.gz 将framework下载至本地目录

性能测试工具分享--LoadRunner

今天在测试课指导老师朱香元的指导下,开始了测试软件的安装,下面我分享一下整个安装流程,最后我会附带安装包的 第一步:链接:http://pan.baidu.com/s/1pXqk2 密码:csjk ,到这个链接中下载全部的内容. 第二步:  根据文件夹中的PPT---->loadrunner.pptx 进行全部流程的操作.如下图所示: 备注: 1.在安装的过程中,当按照PPT做到第八页的时候,因为不同机子存在的问题不一样.他会安装相应的缺少的插件. 2.在它安装缺少的插件期间,它依旧会提示找不到

《零成本实现Web性能测试:基于Apache JMeter》读书笔记

1.性能测试概念 性能测试目的: 评估系统能力,验证系统是否符合预期性能指标 识别系统中的弱点 系统调优,改进系统性能 检测长时间运行可能发生的问题,揭示隐含问题 验证稳定性.可靠性 常见性能指标 B/S架构(h5页面属于B/S架构):一般关注web服务器性能指标 平均每秒钟响应次数=总请求次数/秒数 平均每秒业务脚本迭代次数 成功的请求 失败的请求 成功的点击次数 失败的点击次数 每秒点击次数 每秒成功的点击次数 每秒失败的点击次数 尝试连接数 吞吐量 C/S架构(native属于C/S架构)

【转】Apache JMeter web性能测试实例

Apache JMeter是可以对利用HTTP或FTP服务器的应用程序进行测试的工具.它是基于Java的,通过所提供的API它还具有高度可扩展性.典型的JMeter测试包括创建循环和线程组.循环使用预设的延迟来模拟对服务器的连续请求.线程组是为模拟并发负载而设计的.JMeter提供了用户界面.它还公开了API,用户可以从Java应用程序来运行基于JMeter的测试.为了在JMeter中创建负载测试,需要构建测试计划.在实际操作中,Jmeter需要执行一系列的操作.最简单的测试计划通常包括下列元件