I. Environment preparation installation and command view
1. Installation Tools
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 'll 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 'll be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 'll 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 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 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 | 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 | 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!
Command parameters for 2.ab tests
ab:wrong number of Argumentsusage:ab [options] [Http[s]://]hostname[:p Ort]/pathOptions are:-N Requests number of requests to perform-c concurrency number of multiple requests to MakeAt a Time-T timelimit Seconds to Max. To spend in benchmarking this implies-N50000-S timeout Seconds to Max.wait forEach response Default is -seconds-B windowsize Size of TCP send/receive buffer,inchbytes-B 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 forpost/PUT data, eg. 'application/x-www-form-urlencoded'Default is'Text/plain'-V verbosity how much troubleshootingInfoTo print-WPrint out ResultsinchHTML Tables-I use HEAD instead of GET-x attributes String to insert as table attributes-Y attributes String to insert asTRattributes-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 is A Colon separated username and pass Word. -P attribute Add Basic Proxy authentication, the attributes is a colon separated username and PA ssWOrd. -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 Don't show progress when doing Morethan MaxRequests-G filename Output collected data to gnuplot formatfile. -e filename Output CSVfileWith 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.2or all)
Second, the test plan
1. Simulate 50 concurrent requests per second
Centos7 AB Test (Apache Bench)