Introduction to four Web server stress testing tools (http_load, webbench, AB, and siege) in Linux
I. http_load
The program is very small, and less than 100 kb after decompression
Http_load runs in Parallel Multiplexing to test the web server throughput and load. However, unlike most stress testing tools, it can run in a single process without killing the client. You can also test HTTPS-type website requests.
: Http://soft.vpser.net/test/http_load/http_load-12mar2006.tar.gz
Install
# Tar zxvf http_load-12mar2006.tar.gz
# Cd http_load-12mar2006
# Make & make install
Command Format: http_load-p concurrent access process count-s URL file to be accessed during access time
Parameters can be freely combined, and there is no limit between parameters. For example, if you write http_load-parallel 5-seconds
300 urls.txt is also supported. We will briefly describe the parameters.
-Parallel-p indicates the number of concurrent user processes.
-Fetches short-f: indicates the total number of visits
-Rate abbreviation-r: indicates the Access frequency per second.
-Seconds-s: indicates the total access time.
Prepare the URL File: urllist.txt. The file format is one URL per line. It is better to have more than 50-URLs. The file format is as follows:
Http://www.vpser.net/uncategorized/choose-vps.html
Http://www.vpser.net/vps-cp/hypervm-tutorial.html
Http://www.vpser.net/coupons/diavps-april-coupons.html
Http://www.vpser.net/security/vps-backup-web-mysql.html
For example:
Http_load-p 30-s 60 urllist.txt
The parameters are understood. Let's run a command to see its return results.
Command: %./http_load-rate 5-seconds 10 urls indicates that a test lasts for 10 seconds and the frequency is 5.
49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds5916 mean bytes/connection4.89274
Fetches/sec, 28945.5 bytes/secmsecs/connect: 28.8932 mean, 44.243 max, 24.488 minmsecs/first
-Response: 63.5362 mean, 81.624 max, 57.803 minHTTP response codes: code 200-49 system encountered a bottleneck.
Special instructions:
The main indicators in the test results are the fetches/sec and msecs/connect options, that is, the number of queries that the server can respond to per second. This indicator is used to measure the performance. It seems to be more accurate and persuasive than apache AB.
Qpt-number of responding users and response time per second, and the response time per connection.
The test results mainly refer to these two values. Of course, only these two indicators cannot complete the performance analysis. We also need to analyze the cpu and men of the server to draw a conclusion.
Ii. webshells
Webbench is a website stress testing tool in Linux. It can simulate up to 30 thousand concurrent connections to test the load capacity of the website. You can search by google. Here is
: Http://soft.vpser.net/test/webbench/webbench-1.5.tar.gz
This program is smaller. It will be less than 50 kb after decompression.
Install
# Tar zxvf webbench-1.5.tar.gz
# Cd webbench-1.5
# Make & make install
The webbench executable file is generated in the current directory and can be used directly.
Usage:
Webbench-c concurrency-t run test time URL
For example:
Webbench-c 5000-t 120 http://www.163.com
Iii. AB
AB is a powerful test tool provided by apache.
Apache is installed,
You can view its description.
$./AB
./AB: wrong number of arguments
Usage:./AB [options] [http: //] 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
-P postfile File containing data to POST
-T content-type Content-type header for POSTing
-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
-H Display usage information (this message)
There are many parameters. Generally we use-n and-c.
For example:
./AB-c 1000-n 100 http://www.vpser.net/index.php: Process requests at the same time and run index.php files.
Iv. Siege
An open-source stress testing tool that allows you to perform concurrent access to multiple users on a WEB Site Based on configurations, recording the corresponding time of all request processes of each user, and repeated in a certain number of concurrent accesses.
Official: http://www.joedog.org/
Siege download: http://soft.vpser.net/test/siege/siege-2.67.tar.gz
Decompress:
# Tar-zxf siege-2.67.tar.gz
Go to the extract directory:
# Cd siege-2.67/
Installation:
#./Configure; make
# Make install
Use
Siege-c 200-r 10-f example. url
-C indicates the concurrency and-r indicates the number of repetitions. A url file is a text file. Each line is a url and it will be randomly accessed from it.
Example. url content:
Http://www.licess.cn
Http://www.vpser.net
Http://soft.vpser.net
Result description
Lifting the server siege... Done.
Transactions: 3419263 hits // 419263 processed
Availability: 100.00% // 100.00% success rate
Elapsed time: 5999.69 secs // total time used
Data transferred: 84273.91 MB // a total of 84273.91 MB Data transmission
Response time: 0.37 secs // corresponding time: 1.65 seconds: display the network connection speed
Transaction rate: 569.91 trans/sec // all processes 569.91 times per second: indicates that after the server
Throughput: 14.05 MB/sec // average data transferred per second
Concurrency: 213.42 // The actual maximum number of concurrent jobs
Successful transactions: 2564081 // number of Successful processes
Failed transactions: 11 // number of Failed processes
Longest transaction: 29.04 // the maximum duration of each transmission
Shortest transaction: 0.00 // the Shortest time taken for each transmission