千家信息网

Windows 7环境下网站性能测试小工具 Apache Bench 和 Webbench使用和下载

发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,1、简要说明:Apache Bench 是Apache的网站性能测试小程序,Windows平台下的程序名简称ab.exe,要想获得这个80k的可执行程序,用户需要下载整个Apache Httpd软件包
千家信息网最后更新 2025年12月02日Windows 7环境下网站性能测试小工具 Apache Bench 和 Webbench使用和下载

1简要说明

Apache Bench Apache的网站性能测试小程序,Windows平台下的程序名简称ab.exe,要想获得这个80k的可执行程序,用户需要下载整个Apache Httpd软件包!还需要将其安装到电脑上,确实比较麻烦。

Webbench也是一款网站性能测试小程序,可以获得网站的吞吐率、传送速度等基本性能指标。该程序是在Linux下编程的,在Linux下编译安装使用都很方便,但在Windows 下的程序却没有。

为了方便起见,我将ab.exe 小程序单独拷贝出来,并且下载了webbench的源码,使用CodeBlocks程序和Cygwin64,将源码编译了一下,生成Windows7 环境下可执行的文件webbench.exe ,方便在一个平台下同时使用2个程序,进行网站性能测试。

2、下载地址

Windows7 64位下的两个网站性能测试小工具下载地址:

链接:https://pan.baidu.com/s/1hDhBlNc4ss_sp-qPYk_kEQ

提取码:upas

3、运行截图:

01-Windows7 64位下webbench测试结果

02-Apache Bench 性能测试小工具-运行参数

03-Apache Bench 性能测试小工具-测试结果1

04-Apache Bench 性能测试小工具-测试结果2

4、测试命令及结果分析

ab.exe -n 15000 -c 100 http://www.abc.com/

# -n 15000总共发送的1.5万个访问请求N

# -c 100模拟100个用户同时访问C个;

# 结果分析:

# Concurrency Level: 模拟并发用户数(命令行中输入的数据)C

# Time taken for tests: 完成整个测试的时间T

# Requests per second: 服务器性能(在当前并发下每秒能处理的请求数)=N/T

# Time per request: (mean)从用户的角度计算,每个请求平均花费时间=T/N/C
# 解释:每个用户发送N/C个请求,共花费T秒,每个请求平均花费时间=T/N/C

# Time per request:(mean, across all concurrent requests)从服务器角度计算,完成每个请求的平均花费时间=T/N

# Transfer rate: 传送速率


webbench.exe -c 100 -t 5 http://www.abc.com/

# -c 100模拟100个用户同时访问;

# -t 5 持续5秒钟测试时间

# 需要测试的网址 http://www.abc.com/ ,注意只测网站名时,结尾要加/

#

# Speed pages/min 每分钟多少个请求, Speed pages/sec 每秒钟多少个请求

# bytes/sec 传送速率

# Requests: 总共完成的请求数

5、注意事项

!!!不要对公共网址发送大量访问请求!!!可用于自己的网站上线前的性能测试。

6、使用帮助

C:\>ab --help

ab: wrong number of arguments

Usage: ab [options] [http://]hostname[:port]/path

Options are:

-n requests Number of requests to perform

-c concurrency Number of multiple requests to make at a time

-t timelimit Seconds to max. to spend on benchmarking

This implies -n 50000

-s timeout Seconds to max. wait for each response

Default is 30 seconds

-b windowsize Size of TCP send/receive buffer, in bytes

-B address Address to bind to when making outgoing connections

-p postfile File containing data to POST. Remember also to set -T

-u putfile File containing data to PUT. Remember also to set -T

-T content-type Content-type header to use for POST/PUT data, eg.

'application/x-www-form-urlencoded'

Default is 'text/plain'

-v verbosity How much troubleshooting info to print

-w Print out results in HTML tables

-i Use HEAD instead of 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)

-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.

-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.

-q Do not show progress when doing more than 150 requests

-l Accept variable document length (use this for dynamic pages)

-g filename Output collected data to gnuplot format file.

-e filename Output CSV file with percentages served

-r Don't exit on socket receive errors.

-m method Method name

-h Display usage information (this message)

C:\>webbench --help

webbench [option]... URL

-f|--force Don't wait for reply from server.

-r|--reload Send reload request - Pragma: no-cache.

-t|--time Run benchmark for seconds. Default 30.

-p|--proxy Use proxy server for request.

-c|--clients Run HTTP clients at once. Default one.

-9|--http09 Use HTTP/0.9 style requests.

-1|--http10 Use HTTP/1.0 protocol.

-2|--http11 Use HTTP/1.1 protocol.

--get Use GET request method.

--head Use HEAD request method.

--options Use OPTIONS request method.

--trace Use TRACE request method.

-?|-h|--help This information.

-V|--version Display program version.


测试 性能 程序 网站 用户 时间 结果 工具 同时 命令 地址 平台 服务器 源码 角度 速率 分析 服务 运行 环境 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 服务器宝塔安装好进不去 清镇虚拟服务器 陇西县公安局网络安全大队长 上海打造智慧园区软件开发 外网访问web服务器 jsp页面调用数据库 数据库字段模糊匹配 铁路投资控制系统数据库组件 战地总是连不上服务器怎么办 深圳巡检软件开发怎么收费 福州约奥网络技术有限 网络安全的手抄报简单字少 方舟生存山海经服务器是哪个 存在一定的网络安全风险隐患 享专属服务器抢票啥意思 移动网显示无法连接到服务器 双11网络安全团队新闻 大一数据库 医生基本信息 通过一个网站怎么查数据库的数据 万德数据库官网股票 初中毕业生能学软件开发吗 服务器显卡和普通显卡接口 组建服务器 数据库中只想查看第三行 学校网络安全事故处置应急演练 查数据库备份地址 镇海ios软件开发教程 怎么看数据库表被锁了 东营软件开发团队 网络安全主题班会学习心得
0