ab压力测试命令(在线ddos免费测压平台)
2022-01-12 11:38:09

ab 是apache对 http服务器进行压力测试的工具,它可以测试出服务器每秒可以处理多少请求。本文记录mac版本安装 ab 的步骤以及遇到的坑。

下载

进入 下载页面。

MAC 安装 apache ab 压力测试工具以及遇到的坑

安装

brew 安装

添加ip到 /etc/hosts,添加以下配置:

185.199.108.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com

再执行

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

执行成功后,使用brew安装apr、apr-util和prce

brew install apr
brew install apr-util
brew inatll prce

apache ab安装

解压下载后压缩包,进入 httpd-2.4.51 目录。执行以下命令:

./configure
make
make install

执行 ./configure 命令时报错:

jeremy@jeremydeMacBook-Pro httpd-2.4.51 % ./configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-apple-darwin20.2.0
checking host system type... x86_64-apple-darwin20.2.0
checking target system type... x86_64-apple-darwin20.2.0
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found.  Please read the documentation.

APR not found 没找到./configure 改成

 ./configure --with-apr=/usr/local/opt/apr --with-apr-util=/usr/local/opt/apr-util --with-pcre=/usr/local/Cellar/pcre/8.45

其中 pcre 的路径可能不同,需要在 /usr/local/Cellar/pcre 里面确定路径。

上述命令执行成功后,如果没有报错,表明安装成功,执行ab

ab: wrong number of arguments
Usage: ab [options] [http[s]://]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

出现以上界面,说明 ab 已经安装成功。

运行 ab

主要参数

总结

ab 是apache对 http服务器进行压力测试的工具,它可以测试出服务器每秒可以处理多少请求。本文记录mac版本安装 ab 的步骤以及遇到的坑。

下载

进入 下载页面。

MAC 安装 apache ab 压力测试工具以及遇到的坑

安装

brew 安装

添加ip到 /etc/hosts,添加以下配置:

185.199.108.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com

再执行

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

执行成功后,使用brew安装apr、apr-util和prce

brew install apr
brew install apr-util
brew inatll prce

apache ab安装

解压下载后压缩包,进入 httpd-2.4.51 目录。执行以下命令:

./configure
make
make install

执行 ./configure 命令时报错:

jeremy@jeremydeMacBook-Pro httpd-2.4.51 % ./configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-apple-darwin20.2.0
checking host system type... x86_64-apple-darwin20.2.0
checking target system type... x86_64-apple-darwin20.2.0
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found.  Please read the documentation.

APR not found 没找到./configure 改成

 ./configure --with-apr=/usr/local/opt/apr --with-apr-util=/usr/local/opt/apr-util --with-pcre=/usr/local/Cellar/pcre/8.45

其中 pcre 的路径可能不同,需要在 /usr/local/Cellar/pcre 里面确定路径。

上述命令执行成功后,如果没有报错,表明安装成功,执行ab

ab: wrong number of arguments
Usage: ab [options] [http[s]://]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

出现以上界面,说明 ab 已经安装成功。

运行 ab

主要参数

总结

未解决
您可能还需要
天天领红包,单单有红包
ac1900路由器怎么样(深度评测ac1900路由器及设置方法)
ab互为质数什么意思(欧几里得定律详解其定义)
工号可以设置重复吗?
同时使用指纹与人脸识别的考勤机数据会乱吗?
Do I have to verify my number for mobile phone login_
5g创业项目怎么赚钱,5g创业思路分享
老师在家校群内的昵称可以修改吗?
办公电话最多支持多少客户同时呼入进来?
导入班表提示:解析Excel文件失败
2021年华为最新款手机型号(新款手机型号及价格)
b6手环功能介绍(华为b6智能手环评测)
b360主板配什么cpu最佳(b360主板支持cpu列表)
b360主板能装win7吗(b360主板装win7的方法)
b2c电子商务网站都有哪些(讲解b2b电子商务模式)
b2c电商系统有哪些(电商系统物流系统操作)
b2c电商排名,b2C电子商务企业排名
b2c电商平台制作流程(跨境电商的主要平台操作方法)
b2c平台成功的关键是什么(最重要的6个关键性因素)
b2c企业有哪些公司(精选这10大B2C电商平台)
b2b营销是什么意思(附B2B与B2C营销优缺点)
b2b网站有哪些特点,十大国内b2b网站排名
b2b推广的社交网络,b2b平台免费发布信息网
b2b推广方式有哪些,免费b2b推广技巧
b2b平台推广策略有哪些,B2B网站推广4个技巧
b2b平台免费推广ppt(全程ppt解析B2B细则)
b2b市场营销是什么(附最实用的6种B2B营销策略)
b2b医药电商平台排名,中国十大医药电商平台介绍
b2b医药电商平台排名,中国医药电商10强是哪些
b2b2c网站建设模式及案例(简述s2b2c和b2b2c的区别)
b2b2c模式有哪些平台(盘点适合b2b2c商业模式)
正在加载...