主頁 > 知識庫 > 使ApacheBench支持multi-url的方法

使ApacheBench支持multi-url的方法

熱門標(biāo)簽:陜西辦理400電話 地圖標(biāo)注小程序 宿州外呼系統(tǒng)公司 信陽電銷外呼系統(tǒng)怎么樣 海外工廠地圖標(biāo)注 株洲電銷 貴陽網(wǎng)絡(luò)外呼系統(tǒng)軟件 南充電銷外呼系統(tǒng) 南昌外呼系統(tǒng)定制

由于標(biāo)準(zhǔn)的ab只支持對單個uri進(jìn)行壓測,不滿足實(shí)際需要,故做以下修改,使ab支持multi-url。

1、下載Apache httpd相關(guān)源碼包以及針對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、驗證結(jié)果

#/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已經(jīng)支持-L參數(shù)(上面幫助信息的倒數(shù)第3行),大功告成。

到此這篇關(guān)于使ApacheBench支持multi-url的方法的文章就介紹到這了,更多相關(guān)ApacheBench支持multi-url內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

標(biāo)簽:三明 拉薩 玉林 汕頭 晉城 鄭州 開封 石嘴山

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《使ApacheBench支持multi-url的方法》,本文關(guān)鍵詞  使,ApacheBench,支持,multi-url,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《使ApacheBench支持multi-url的方法》相關(guān)的同類信息!
  • 本頁收集關(guān)于使ApacheBench支持multi-url的方法的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章