centos7下ab測試(Apache Bench)

來源:互聯網
上載者:User

標籤:header   tls   show   summary   請求   cti   1.5   ssi   limit   

一、環境準備安裝和命令查看

1、安裝工具

yum install httpd-tools

[[email protected] ttt]# yum install httpd-tools
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-40.el7.centos.4 will be installed
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-tools-2.4.6-40.el7.centos.4.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-tools-2.4.6-40.el7.centos.4.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-3.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================
Installing: httpd-tools x86_64 2.4.6-40.el7.centos.4 updates 83 k
Installing for dependencies:apr x86_64 1.4.8-3.el7 base 103 k
apr-util x86_64 1.5.2-6.el7 base 92 k

Transaction Summary
====================================================================================================================================
Install 1 Package (+2 Dependent packages)

Total download size: 278 k
Installed size: 584 k
Is this ok [y/d/N]: y
Downloading packages:
(1/3): httpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm | 83 kB 00:00:00
(2/3): apr-1.4.8-3.el7.x86_64.rpm                   | 103 kB 00:00:00
(3/3): apr-util-1.5.2-6.el7.x86_64.rpm              | 92 kB 00:00:00
------------------------------------------------------------------------------------------------------------------------------------
Total 203 kB/s | 278 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-3.el7.x86_64 1/3
Installing : apr-util-1.5.2-6.el7.x86_64 2/3
Installing : httpd-tools-2.4.6-40.el7.centos.4.x86_64 3/3
Verifying : httpd-tools-2.4.6-40.el7.centos.4.x86_64 1/3
Verifying : apr-util-1.5.2-6.el7.x86_64 2/3
Verifying : apr-1.4.8-3.el7.x86_64 3/3

Installed:
httpd-tools.x86_64 0:2.4.6-40.el7.centos.4

Dependency Installed:
apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7

Complete!

 

2.ab測試的命令參數

ab: wrong number of argumentsUsage: ab [options] [http[s]://]hostname[:port]/pathOptions 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    -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)    -Z ciphersuite  Specify SSL/TLS cipher suite (See openssl ciphers)    -f protocol     Specify SSL/TLS protocol                    (SSL2, SSL3, TLS1, TLS1.1, TLS1.2 or ALL)

二、測試方案

1、類比每秒50次並發請求

 

centos7下ab測試(Apache Bench)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.