Stress testing tools

Source: Internet
Author: User
Tags response code

1. Stress Test webbench
Webbench can simulate up to 30 thousand concurrent connections to test the load capacity of the website. I personally feel better than the AB stress testing tool that comes with Apache, and it is especially convenient to install and use.

1. applicable system: Linux

2. Compile and install:

Reference

Wget http://blog.zyan.cc/soft/linux/webbench/webbench-1.5.tar.gz
Tar zxvf webbench-1.5.tar.gz
CD webbench-1.5
Make & make install


3. Usage:

Reference

Webbench-C 500-T 30 http: // 127.0.0.1/test.jpg

Parameter description:-C indicates the number of concurrencies, and-T indicates the time (seconds)

4. Test Result example:

Reference

Webbench-simple web benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL open source software.

Benchmarking: Get http: // 127.0.0.1/test.jpg
500 clients, running 30 sec.

Speed = 3230 pages/min, 11614212 Bytes/sec.
Requests: 1615 susceed, 0 failed.

2. Stress Test AB

 

Parameters of the AB website stress testing command and Chinese annotations of the output results

 

I used to install Apache without knowing how to test Apache performance. Now I have found a test tool. It is the test tool AB (APACHE benchmark) that comes with Apache. It is under the bin directory of Apache.
Format:./AB [Options] [http: //] hostname [: Port]/path
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:

./AB-C 1000-N 1000 http: // 127.0.0.1/index. php (use it with caution and it will drag your server to death)

This indicates that 1000 requests are processed simultaneously and the index. php file is run 1000 times.
#/Usr/local/Xiaobai/apache2054/bin/AB-C 1000-N 1000 http: // 127.0.0.1/index.html. zh-cn.gb2312
This is apachetings, version 2.0.41-dev <$ revision: 1.121.2.12 $> APACHE-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 the Apache Software Foundation, http://www.apache.org/

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.0.54
// Platform apache version 2.0.54
Server Hostname: 127.0.0.1
// Server host name
Server port: 80
// Server port

Document path:/index.html. zh-cn.gb2312
// 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 the number of transactions per second in LR. The mean in the brackets below indicates that this is an average value.
Time per request: 8188.731 [MS] (mean)
// The second indicator that everyone cares most about is equivalent to the average transaction response time in LR. The mean in the brackets below 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
// The average network traffic per second can help eliminate the problem of excessive network traffic resulting in prolonged Response Time

Connection 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 the time consumed on the network. The specific algorithms of various data are 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, 60% of the user response time is less than 1247 milliseconds, and 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.


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


This article is from the "Looking Forward" blog, please be sure to keep this source http://ladder.blog.51cto.com/8847731/1567586

Stress testing tools

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.