使ApacheBench支持multi-url
由于标准的ab只支持对单个uri进行压测,不满足实际需要,故做以下修改,使ab支持multi-url。
1、下载Apache httpd相关源码包以及针对ab工具的patch包
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.6.5.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.37.tar.gz
wget https://github.com/philipgloyne/apachebench-for-multi-url/archive/master.zip
注:httpd依赖于apr和apr-util
2、编译安装apr
tar -zxf apr-1.6.5.tar.gz
cd apr-1.6.5
./configure --prefix=/usr/local/apr
make && make install
3、编译安装apr-util
tar -zxf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
4、替换httpd源码里面的ab.c文件
unzip master.zip
tar -zxf httpd-2.4.37.tar.gz
\cp ./apachebench-for-multi-url-master/ab.c ./httpd-2.4.37/support/
5、编译安装httpd
cd httpd-2.4.37
./configure \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--prefix=/usr/local/apache \
--sysconfdir=/etc/httpd24 \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-pcre \
--with-mpm=prefork \
--enable-modules=most \
--enable-mpms-shared=all
make && make install
6、验证结果
#/usr/local/apache/bin/ab -h
Usage: /usr/local/apache/bin/ab [options] [http[s]://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make
-t timelimit Seconds to max. wait for responses
-b windowsize Size of TCP send/receive buffer, in bytes
-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 for POSTing, 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.
-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.
-h Display usage information (this message)
-L Use URL list file name, eg. url.txt
-Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers)
-f protocol Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or ALL)
可以看到ab已经支持-L参数(上面帮助信息的倒数第3行),大功告成。
使ApacheBench支持multi-url的更多相关文章
- Apache下开启SSI配置使html支持include包含
写页面的同学通常会遇到这样的烦恼,就是页面上的 html 标签越来越多的时候,寻找指定的部分就会很困难,那么能不能像 javascript 一样写在不同的文件中引入呢?答案是有的,apache 能做到 ...
- Qone 正式开源,使 javascript 支持 .NET LINQ
Qone 下一代 Web 查询语言,使 javascript 支持 LINQ Github: https://github.com/dntzhang/qone 缘由 最近刚好修改了腾讯文档 Excel ...
- 修改sqlarchemy源码使其支持jdbc连接mysql
注意:本文不会将所有完整源码贴出,只是将具体的思路以及部分源码贴出,需要感兴趣的读者自己实验然后实现吆. 缘起 公司最近的项目需要将之前的部分业务的数据库连接方式改为jdbc,但由于之前的项目都使用s ...
- 记一次在mac上源码编译curl,使其支持NSS的过程
一.背景 在一次学习https原理的过程中,希望客户端指定特定的cipher suites来抓包分析SSL/TLS的握手过程,就想到了使用curl工具,而不是使用浏览器. 接下来使用man curl找 ...
- AFNETWorking 不支持中文URL请求
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #000000; min-height: 16.0px } p.p ...
- Linux下安装libiconv使php支持iconv函数
libiconv组件安装好了可以让我们php支持iconv函数了,这个函数的作用就是字符编码强制转换了,下面和111cn小编一起来看一个Linux中安装libiconv使php支持iconv函数的例子 ...
- 2.移植3.4内核-使内核支持烧写yaffs2
在上章-制作文件系统,并使内核成功启动jffs2文件系统了 本章便开始使内核支持烧写yaffs2文件系统 1.首先获取yaffs2源码(参考git命令使用详解) cd /work/nfs_root g ...
- Atom 编辑器安装 linter-eslint 插件,并配置使其支持 vue 文件中的 js 格式校验
安装方式有如下几种. 1.最常用的安装方式. # 进入atom插件文件夹 cd ~/.atom/packages/ # git clone 插件源文件 git clone https://github ...
- 使HTML5支持RTSP流 微信直播RTSP流 微信播放RTSP直播流(HTML5播放rtsp,web播放rtsp,微信支持rtsp)
一.大家都知道HTML5的VIDEO可以播放视频,但是H5不支持RTSP播放,所以需要中间件! 二.我们经理长年的努力,开发了HTML5支持RTSP的中间件,使HTML5支持RTSP直播! 三.不卡顿 ...
随机推荐
- HDU6025 Coprime Sequence(gcd)
HDU6025 Coprime Sequence 处理出数列的 \(gcd\) 前缀和后缀,删除一个数后的 \(gcd\) 为其前缀和后缀的 \(gcd\) . 遍历数列取 \(max\) 即为答案. ...
- leetcode-mid-dynamic programming-62. Unique Paths
mycode time limited class Solution(object): def uniquePaths(self, m, n): """ :type ...
- iOS SDK开发之 .framework静态库
查看.a静态库的生成及使用单击此处 注:这篇教程将只使用一小部分Objective-C代码,本文主要讲解从开始到应用的详细步骤.环境:xcode 9.2下面我们开始操作: 第一步:创建一个静态库工程 ...
- 四十二、python中异常
1.常用异常: AttributeError 试图访问一个对象没有的树形,比如foo.x,但是foo没有属性xIOError 输入/输出异常:基本上是无法打开文件ImportError 无法引入模块或 ...
- String对象的常见方法
String 对象方法 方法 描述 anchor() 创建 HTML 锚. big() 用大号字体显示字符串. blink() 显示闪动字符串. bold() 使用粗体显示字符串. charAt() ...
- JS中设置cookie,读取cookie,删除cookie
在开发时,碰到一个需求,需要保存一个表的信息(非隐私),希望下次打开还存在.于是想到用cookie,一番折腾完成.示例数据都是假的,打马赛克是怕泄密. 这个表取名为Data,为Array,每一行是一个 ...
- SQLSERVER 和 ORACLE 查询数据库文件大小
SQLSERVER: SQLSERVER一个库的文件分为数据文件(行数据)和日志文件两个文件,详情可以在数据库的属性->文件中查看. 在资源管理器中打开文件所在路径可以直接看到这两个文件 但是, ...
- linux中从一台机器复制文件或目录到另一台机器上linux机器上
本机IP:x.x.x.1需要拷贝的机器IP:x.x.x.2用户名:ssh_user 目的:将本机中source_path路径下的文件或目录拷贝到另一台机器的destination_path/路径下 复 ...
- java基础/java调用shell命令和脚本
一.项目需求: 从某一机构获取证书,证书机构提供小工具,执行.sh脚本即可启动服务,本地调用该服务即可获取证书. 问题:linux服务器启动该服务,不能关闭.一旦关闭,服务即停止. 解决方案:java ...
- supervisor启动elk7.4.0组件
es [program:elasticsearch] command = /srv/app/elk/elasticsearch/bin/elasticsearch autostart = true s ...