使ApacheBench支持multi-url的方法

这篇文章主要介绍了使ApacheBench支持multi-url的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下由于标准的ab只支持对单个uri进行压测,不满足实际需要,故做以下修改,使ab支持multi-url。1、下载Apache httpd相关源码包以及针对ab工具的patch包1234wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.6.5.tar.gzwget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gzwget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.37.tar.gzwget https://github.com/philipgloyne/apachebench-for-multi-url/archive/master.zip注:httpd依赖于apr和apr-util参考文案:http://www.cncsto.com/article/582、编译安装apr1234tar -zxf apr-1.6.5.tar.gzcd apr-1.6.5./configure --prefix=/usr/local/aprmake && make install3、编译安装apr-util1234tar -zxf apr-util-1.6.1.tar.gzcd apr-util-1.6.1./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/aprmake && make install4、替换httpd源码里面的ab.c文件123unzip master.ziptar -zxf httpd-2.4.37.tar.gz\cp ./apachebench-for-multi-url-master/ab.c ./httpd-2.4.37/support/5、编译安装httpd1234567891011121314151617cd 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=allmake && make install6、验证结果12345678910111213141516171819202122232425262728293031323334353637#/usr/local/apache/bin/ab -hUsage: /usr/local/apache/bin/ab [options] [http[s]://]hostname[:port]/pathOptions 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 attributesare a colon separated username and password.-P attribute  Add Basic Proxy Authentication, the attributesare 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的方法的文章就介绍到这了

(0)

相关推荐

  • Apache源码安装

    Apache源码安装

  • 一键LAMP(个人)

    #!/bin/bash #LAMP CPUS=`lscpu |grep "CPU(s)"|awk '{print $2}'|head -1` PHP="php-7.4.7 ...

  • G120变频器通过BICO参数使编码器数值清零的方法

    在使用CU250S-2的控制单元时,由于其自带编码器接口,所以编码器的码值可以通过控制单元进行处理并在参数中显示.变频器中的参数r482通常用于显示编码器当前码值,断电上电之后r482会被清零.有时需 ...

  • 怎样查看手机是否支持北斗导航?方法很简单,跟我一起来看看吧

    怎样查看手机是否支持北斗导航?方法很简单,跟我一起来看看吧

  • 错误:对象不支持"attachEvent"属性或方法 解决方法

    web在chrome中运行正常,但用IE浏览器测试时,报错"错误:对象不支持"attachEvent"属性或方法". 查询JS资料得知,为IE浏览器支持问题,只 ...

  • 使家庭和睦的七种方法

    转自:禾迪的博客 第一项规则:切莫喋喋不休. 第二项规则:别尝试改造你的伴侣. 第三项规则:不要任意的批评. 第四项规则:给予真诚的欣赏. 第五项规则:随时注意琐碎.细微的小地方. 第六项规则:要有礼 ...

  • 使兰花快速服盆的方法,太好用了!

    兰花服盆是专业养兰人很关注的一个话题,新手养兰图的是开心,对兰花的服盆不是很清楚,脑海里常常也没有服盆这个概念,但对专业的养兰人来说就很重要了,他们都希望自己种的兰花快速服盆,兰花服盆的速度越快,对兰 ...

  • 使英语学习事半功倍的好方法

    一.句子比单词重要 词典不是最重要的,关键在于语境.机械记忆的单词量再大,也不会真正提高外英语水平.要养成背诵句子的好习惯,因为句子中既包含了发音规则,又有语法内容,还能表明某个词在具体语言环境中的特 ...

  • 使病弱兰花恢复长势的方法

    我们在兰花的养殖过程中,常会因为气温.病虫害.分株过勤.栽培不当及植株老化而导致兰苗生长缓慢,出现叶子发黄.烂根.烂芽等问题.可以这样说养兰草的人,都会碰到弱苗.也许是拿到单苗兰草:也许兰草因病救了过 ...

  • 使兰花快速服盆的方法

    兰花服盆是专业养兰人很关注的一个话题,新手养兰图的是开心,对兰花的服盆不是很清楚,脑海里常常也没有服盆这个概念,但对专业的养兰人来说就很重要了,他们都希望自己种的兰花快速服盆,兰花服盆的速度越快,对兰 ...

  • 面瘫,主要是:风邪侵袭面部经络,使肌肉瘫痪,中医好方法。

    面瘫,主要是:风邪侵袭面部经络,使肌肉瘫痪,中医好方法。