Web server performance/stress testing tools: http_load, webbench, AB, and siege tutorials

Source: Internet
Author: User
Tags vps

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 testers

It can run in a single process and generally does not kill the client. You can also test https-type website requests.

: Http://soft.vpser.net/test/http_load/http_load-12mar2006.tar.gz
Easy to 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-P: 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 better.

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

Result Analysis:
1.49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds
In the preceding test, 49 requests are run, the maximum number of concurrent processes is 2, the total data transmitted is 289884 bytes, and the running time is 10.0148 seconds.
2.5916 mean Bytes/connection indicates that the average data volume transmitted by each connection is 289884/49 = 5916
3.4.89274 fetches/sec, 28945.5 Bytes/sec
The number of response requests per second is 4.89274, and the amount of data transmitted per second is 28945.5 Bytes/sec.
4. msecs/Connect: 28.8932 mean, 44.243 Max, 24.488 min indicates that the average response time for each connection is 28.8932 msecs

The maximum response time is 44.243 msecs, and the minimum response time is 24.488 msecs.
5. msecs/first-response: 63.5362 mean, 81.624 Max, 57.803 min
6. HTTP Response codes: Code 200-49 indicates the type of the response page to be opened. If 403 has too many types, it may

Check whether the system has 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 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 can not complete the performance analysis, we also need

CPU and men analysis 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.
Easy to 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.vpser.net

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 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

This indicates that 1000 requests are processed simultaneously and the index. php file is run 100 times.
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.