Tool for testing website load capabilities

Source: Internet
Author: User

Server performance stress testing tools include http_load, webbench, AB, and siege.

 

A webbench can simulate up to 30 thousand concurrent connections to test the load capacity of the website.

1. applicable system: Linux


2. Compile and install:

Reference wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
Tar zxvf webbench-1.5.tar.gz
CD webbench-1.5
Make & make install

Usage:

Webbench-C concurrency-t run test time URL
For example:
Webbench-C 5000-T 120 http://www.xxx.com

 

 

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 repeat it in a certain number of concurrent accesses.
Official: http://www.joedog.org/
Siege download: http://deepvps.googlecode.com/files/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.deepvps.com

 

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

 

 

 

 

AB
AB is a powerful test tool provided by Apache. After Apache is installed, it is generally provided. You can view its usage instructions.

$./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.xxx.com/index.php

This indicates that 1000 requests are processed simultaneously and the index. php file is run 100 times.

Parameters
-N requests number of requests to perform
// The number of requests executed in the test session. By default, only one request is executed.
-C concurrency number of multiple requests to make
// The number of requests generated at a time. The default value is one at a time.
-T timelimit seconds to max. Wait for responses
// The maximum number of seconds for testing. The implicit value is-N 50000. It limits the server test to a fixed total time. By default, there is no time limit.
-P postfile file containing data to post
// File that contains the data to be post.
-T Content-Type Header for posting
// The Content-Type Header used by the post data.
-V verbosity how much troubleshooting info to print
// Set the details of the display information-4 or a greater value will display the header information, 3 or a greater value can display the response code (404,200, etc ), 2 or a greater value can display warnings and other information. -V displays the version number and exits.
-W print out results in HTML tables
// Output results in HTML table format. By default, it is a table of the width of the two columns of the white background.
-I use head instead of get
// Execute the head request 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)
//-C cookie-name = value attaches a cookie to the request: Row. The typical form is a parameter pair of name = value. This parameter can be repeated.
-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.
//-P proxy-auth-UserName: password provides basic authentication trust for a transit proxy. The user name and password are separated by one and sent in base64 encoding format. This string is sent regardless of whether the server needs it (that is, whether the 401 authentication request code is sent.
-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)
//-Attributes: Specifies the attribute string. The defect program contains various static declared fixed-length buffers. In addition, parsing command line parameters, server response headers, and other external inputs is also simple, which may have adverse consequences. It does not fully implement HTTP/1.x; only accept some 'preview' response formats. Frequent use of strstr (3) may cause performance problems, that is, you may be testing the performance of AB rather than the server.

There are many parameters. Generally we can use the-C and-N parameters. For example, open CMD and enter the following code. Cd c:/apache2.2/binab-N 1000-C 100 [url] http://zf.guqin.com/index/index#/url#this example simultaneously processes requests and runs index.php files. The following is the printed content.
This is apachetings, version 2.0.41-dev <$ revision: 1.121.2.12 $> APACHE-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, [url] http://www.zeustech.net/#/url]
Copyright (c) 1998-2002 the Apache Software Foundation, [url] http://www.apache.org/#/url?benchmarking 127.0.0.1 (Be patient)
Completed100 requests
Completed200 requests
Completed300 requests
Completed400 requests
Completed500 requests
Completed600 requests
Completed700 requests
Completed800 requests
Completed900 requests
Finished 1000 requests
Server Software: Apache/2.2.8
// Platform apache version 2.2.8
Server Hostname: zf.guqin.com
// Server host name
Server port: 80
// Server port document path:/index. php
// Document of the test page
Document length: 1018 bytes
// Document size concurrency level: 1000
// Concurrency
Time taken for tests: 8.188731 seconds
// Test duration
Complete requests: 1000
// Number of completed requests
Failed requests: 0
// Number of failed requests
Write errors: 0 total transferred: 1361581 bytes
// Network transmission volume in the entire scenario
HTML transferred: 1055666 bytes
// The amount of HTML content transmitted throughout the scenario
Requests per secondd: 122.12 [#/sec] (mean)
// One of the most important indicators is equivalent Transactions per secondThe mean value in the brackets indicates that this is an average value.
Time per request: 8188.731 [MS] (mean)
// The second metric that everyone cares about most is equivalent Average Transaction Response TimeThe mean value in the brackets indicates that this is an average value.
Time per request: 8.189 [MS] (mean, internal SS all concurrent requests)
// Average actual running time of each request
Transfer Rate: 162.30 [Kbytes/sec] canceled ed
// Average network traffic per second, can help eliminate the problem of excessive network traffic resulting in prolonged response times (MS)
Min mean [+/-SD] median Max
Connect: 4 646 1078.7 89 3291
Processing: 165 992 493.1 938 4712
Waiting: 118 934 480.6 882
Total: 813 1638 1338.9 1093
// Decomposition of time consumed on the network, the specific algorithm of each data is not very clear percentage of the requests served within a certain time (MS)
50% 1093
66% 1247
75% 1373
80% 1493
90% 4061
95% 4398
98% 5608
99% 7368
100% 7785 (longest request)
// Response of all requests in the entire scenario. Each request has a response time in the scenario. 50% of the user response time is less than 1093 milliseconds, and 60% of the user response time is less than 1247 milliseconds, the maximum response time is less than 7785 milliseconds. For concurrent requests, the CPU does not actually process them at the same time, but is rotated one by one based on the time slice obtained by each request, therefore, the first time per request is basically equal to the second time per request time multiplied by the number of concurrent requests.

 

 

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://deepvps.googlecode.com/files/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. File Format

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 there are too many types of 403, 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 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.

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.