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 <sec>          Run benchmark for <sec> seconds. Default 30.

-p|--proxy <server:port> Use proxy server for request.

-c|--clients <n>         Run <n> 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.

原文地址:https://www.cnblogs.com/rancher-maomao/p/9902137.html

时间: 2024-07-28 12:30:31

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

Windows环境下使用Redis缓存工具的图文详细方法

网上找了两篇关于Redis的博客,记录下! Java 使用Redis缓存工具的图文详细方法 Windows环境下使用Redis缓存工具的图文详细方法

Windows XP环境下 搭建Android NDK环境

搭建Android NDK环境 Windows XP环境下 1 一些下载 ① NDK r7:http://developer.android.com/sdk/ndk/index.html ② cygwin:http://www.cygwin.com/  (1.7.11-1)③ notepad++:http://notepad-plus-plus.org/download/v5.9.8.html 2 cygwin安装 ① 执行下载的setup.exe.点Next② 选择安装方式.选择在线安装.假设

【windows】环境下mysql的数据备份以及恢复

[windows]环境下mysql的数据备份以及恢复 无论是刚刚入行的'猿友'还是入行很久的'老猿',我相信都会遇到过因为各种原因(很多情况下是自己误删了数据库)的操作.drop databases xxxxx 而误删了线上项目的数据库是一件很恐怖的事情,那么如果大家遇到这种情况怎么办呢?首先不要着急(我感觉说了也白说-,-),先看一看自己的mysql是否开启了binlog日志功能,如果没有???game over !!! 关于查看binlog日志有没有开启,请到自己的Mysql文件下找my.i

windows环境下使用apxs编译添加apache模块

windows环境下使用apxs编译添加apache模块 简介说明:本文使用mod_limitipconn模块为例. 环境: windows7 x86系统 apache 2.4.18 目标: 在windows环境下,利用mod_limitipconn0.24源码.apxs为apache2.4.18添加mod_limitipconn模块. 分析: limitipconn模块最新版已经支持apache2.4了.但是没有编译好的对应版本.因此需要自己动手编译模块.在windows下要实现这个目标,需要

iOS系统提供开发环境下命令行编译工具:xcodebuild

iOS系统提供开发环境下命令行编译工具:xcodebuild[3] xcodebuild 在介绍xcodebuild之前,需要先弄清楚一些在XCode环境下的一些概念[4]: Workspace:简单来说,Workspace就是一个容器,在该容器中可以存放多个你创建的Xcode Project, 以及其他的项目中需要使用到的文件. 使用Workspace的好处有: 1),扩展项目的可视域,即可以在多个项目之间跳转,重构,一个项目可以使用另一个项目的输出.Workspace会负责各个Project

Windows PHP 环境下 Redis开发环境搭建

1.redis简介 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set --有序集合)和hashs(哈希类型).这些数据类型都支持push/pop.add/remove及取交集并集和差集及更丰富的操作,而且这些操作都是原子性的.在此基础上,redis支持各种不同方式的排序.与memcached一样,为了保证效率,数据都是缓存在内存中.区别的是redi

WP8_(windows phone环境下)上传文件从C#到php接口

在windows phone环境下,将手机上的图片上传到服务端(php环境): 注意事项:在上传的地方,头文件中name,例如name= img,则在php服务端处理时 ,需要约定好 存取一致 php:$_FILES['img']['name'],如若两端的name不相同则服务端无法正确获取上传的文件: public class UploadSrv { #region 选择图片   /// <summary> /// 打开照相机 /// </summary> public void

ueditor1.4.3在.net环境下的vs开发工具中集成经验

Ueditor是个很不错的在线富文本编辑器,几个项目一直使用它.最近想更新版本,发现新版1.4.3与旧版的部署方式完全不一样了,官网文档介绍的是直接放在iis下的部署说明,没有提到在vs开发工具中如何集成,自己新建了一个测试项目琢磨了一会,测试没啥问题,记录下给大家分享. 项目结构如下图: 因为我创建的是web项目类型,所以把controller.ashx以项目形式的一般处理程序迁移过去,并重命名成ueditor.ashx(记得在ueditor.config.js修改服务器统一请求接口路径).另

windows+WampServer环境下Phpwind论坛的搭建

windows+WampServer环境下Phpwind论坛的搭建 1.安装WampServer 安装完毕,点击图标,开启WampServer, 成功开启后,在任务栏会出现图标,点击图标,会出现WamServer目录,服务即成功开启了 2.对文件phpwind_UTF8_8.5解压,会有如下两文件 3.将upload文件复制到WampWerver的www direcory目录(注意:复制的upload文件不能与该路径下其他应用的upload文件同名,可以重命名后在复制过来) 4.查看端口号()进