常见的性能测试工具有: 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服务器等静态和动态资源进行性能测试。

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

  1. 杂项-性能测试工具:LoadRunner

    ylbtech-杂项-性能测试工具:LoadRunner LoadRunner,是一种预测系统行为和性能的负载测试工具.通过以模拟上千万用户实施并发负载及实时性能监测的方式来确认和查找问题,LoadR ...

  2. 性能测试学习第二天_性能测试工具概述Loadrunner介绍

    性能测试工具概述Loadrunner介绍 http://www.51testing.com/html/42/n-6542.html 其中,T直接影响用户体验时间 性能测试的原理: 记录一个访问过程的通 ...

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

    性能测试培训:Ajax接口级性能测试之jmeter版   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.在poptest认为工具 ...

  4. 使用Apache JMeter进行SQL优化性能测试

    一. 前言 最近在公司里做性能测试,对于一张大概400万数据的表,进行全表扫描往往会比较费时,更不要说有若干这样的表格级联进行检索了.为了能够在不影响生产环境的前提下进行SQL的性能优化,需要首先利用 ...

  5. Apache Jmeter 性能测试

    今天在写性能测试报告的时候需要使用到数据,打算用做一下性能测试,然后在百度后发现了一款Apache开源的Jmeter压测工具 Jmeter概述: Apache JMeter是一款纯java编写负载功能 ...

  6. 软件性能测试分析与调优实践之路-JMeter对RPC服务的性能压测分析与调优-手稿节选

    一.JMeter 如何通过自定义Sample来压测RPC服务 RPC(Remote Procedure Call)俗称远程过程调用,是常用的一种高效的服务调用方式,也是性能压测时经常遇到的一种服务调用 ...

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

    简介 Apache JMeter 是100%纯java语言开发的负载测试和性能测试开源工具. 功能 Apache JMeter可以对静态/动态资源进行性能测试,模拟多个用户并行请求资源端,以测试其强度 ...

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

    什么是功能: 功能按我理解就是软件实现需求,提供服务,那么功能测试就是实现的需求是否与客户给定需求一致,也就是符合预期结果 什么是性能: 功能是实现需求,提供服务,那么性能就可以理解为服务的好坏.比如 ...

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

    随着智能手机近年来的快速增长,从游戏娱乐到移动办公的各式各样的手机APP软件渗透到我们的生活中,对于大型的手机APP测试不仅要关注它的功能性.易用性还要关注它的性能,最近发现LoadRunner12可 ...

随机推荐

  1. java中类相关注意事项

    下面default类就是默认修饰符的类 1.Java中调用类中属性或方法(不管是否静态属性或方法)都要在类的方法中调用,虽然这个太基础,但今天想在类中调用静态类的静态变量,不能调用: 2.Java调用 ...

  2. 获取指定ip段的所有存活主机的主机名和操作系统

    https://jingyan.baidu.com/article/ceb9fb1089fd948cad2ba000.html java探测局域网存活 https://blog.csdn.net/we ...

  3. JavaWeb学习总结(十五)Jsp中提交的表单的get和post的两种方式

    两者的比较: Get方式: 将请求的参数名和值转换成字符串,并附加在原来的URL之后,不安全 传输的数据量较小,一般不能大于2KB: post方式: 数量较大: 请求的参数和值放在HTML的请求头中, ...

  4. Repeater的j简单使用

    嘿嘿,今天没有任务,所以突然想起来我之前记得笔 记说要把repeater的使用以及获取值的详细使用总结一下,所以这就闲来无聊总结一下,虽然现在不会使用这些小知识点的,但是我感觉自己的学习还是要 不断地 ...

  5. tts文本转语音服务

    1. 谷歌tts http://translate.google.cn/translate_tts?ie=UTF-8&tl=zh-CN&q=谷歌 2. 百度tts http://tts ...

  6. Python操作MySQL数据库的三种方法

    https://blog.csdn.net/Oscer2016/article/details/70257024 1. MySQLdb 的使用 (1) 什么是MySQLdb?   MySQLdb 是用 ...

  7. Linux 下安装JDK1.8

    本文主要介绍的是如何是Linux环境下安装JDK的,因为Linux环境下,很多时候也离不开Java的,下面笔者就和大家一起分享如何jdk1.8的过程吧. 一.安装环境 操作系统:Red Hat Ent ...

  8. HDU 2102 A计划(BFS/DFS走迷宫)

    A计划 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submis ...

  9. ELK系列五:Logstash输出到Elasticsearch和redis

    1.Logstash与Redis的读写 1.1 Logstash 写入Redis 看完Logstash的输入,想必大家都清楚了Logstash的基本用法,那就是写配置文件. output{ { red ...

  10. Python中的str与bytes之间的转换的三种方法

    # bytes object b = b"example" # str object s = "example" # str to bytes sb = byt ...