Summary of open-source stress testing tools

Source: Internet
Author: User
Tags benchmark socket error

I, Tool AB attached to Apache

The full name of AB is apachemark. It is a small tool attached to Apache. It is specially used for the HTTP server's Benchmark Testing and can simulate multiple concurrent requests at the same time.

At the beginning of this example, I executed such a command AB-N 10-C 10 http://www.google.com /. This command is used to start AB, send 10 requests (-N 10) to www.google.com, and send 10 requests (-C 10) Each time-that is, all requests are sent.

Apache AB does a good job of repeated stress tests, but only one link can be tested at a time.

\ Apahce \ bin> AB .exe-N 10-C 10 http://www.google.com/
This is apachetings, version 2.0.40-dev <$ revision: 1.146 $> APACHE-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 the Apache Software Foundation, http://www.apache.org/

Benchmarking www.google.com (Be patient)... Done

Server Software: GWs
Server Hostname: www.google.com
Server port: 80

Document path :/
Document length: 4941 bytes

Concurrency level: 10
Time taken for tests: 5.218750 seconds // ** duration of the test **
Complete requests: 10 // ** number of completed requests **
Failed requests: 9 // ** number of failed requests **
(CONNECT: 0, Length: 9, exceptions: 0)
Write errors: 0
Total transferred: 52730 bytes ** network transmission volume in the entire scenario **
HTML transferred: 49540 bytes ** The amount of HTML content transmitted in the entire scenario **
Requests per second: 1.92 [#/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: 5218.750 [MS] (mean) * The second of the most important indicator, equivalent to the average transaction response time in LR, the mean in the brackets below indicates that this is an average **
Time per request: 521.875 [MS] (mean, internal SS all concurrent requests)
Transfer Rate: 9.77 [Kbytes/sec] received * Average network traffic per second. This helps you determine whether the response time is prolonged due to excessive network traffic **

Connection times (MS)
Min mean [+/-SD] median Max
Connect: 187 488 257.6 437 921
Processing: 312 1673 1204.4 1547 3985
Waiting: 296 1668 1206.3 1546
Total: 593 2162 1432.6 1890
** The following content shows the responses 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 ** milliseconds, and 60% of the user response time is less than ** milliseconds, the maximum response time is less than ** millisecond **
Percentage of the requests served within a certain time (MS)
50% 1890
66% 2406
75% 3093
80% 3984
90% 4906
95% 4906
98% 4906
99% 4906
100% 4906 (longest request)

-----------------------------------------------------------------------------

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)

Ii. webshells

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

# Website- C 100-T 10 http: // 192.168.200.100/info. php

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

Root @ Ubuntu-desktop:/etc/nginx/sites-available # webdesk- C 100-T 10 http: // 192.168.200.100/info. php
Webbench-simple web benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL open source software.

Benchmarking: Get http: // 192.168.200.100/info. php
100 clients, running 10 sec.

Speed = 19032 pages/min, 18074373 Bytes/sec.
Requests: 3172 susceed, 0 failed.

Iii. siege

Apache AB does a good job of repeated stress tests, but only one link can be tested at a time.

How to test a set of links (for example, one hour of logs exported from the logs for real stress testing), and then found this:
Siege is a stress testing and evaluation tool. It is designed for web development to evaluate the application's affordability. It can perform concurrent access to multiple users on a Web Site Based on configurations, record the corresponding time of all the request processes of each user, and repeat them under a certain number of concurrent accesses.

Download/install
Siege is an open source project: http://www.joedog.org/siege/

Download:
Wget ftp://sid.joedog.org/pub/siege/siege-latest.tar.gz

Installation:
#./Configure; make
# Make install

# Siege-help (if there is help, the installation is successful)

Siege includes a set of stress testing tools:
Siege (1) siege is an HTTP stress testing and evaluation tool.
Example:
Task List: www.chedong.com. URL File

Http://www.chedong.com/tech/

Http://www.chedong.com/tech/acdsee.html

Http://www.chedong.com/tech/ant.html

Http://www.chedong.com/tech/apache_install.html

Http://www.chedong.com/tech/awstats.html

Http://www.chedong.com/tech/cache.html

Http://www.chedong.com/tech/click.html

Http://www.chedong.com/tech/cms.html

Http://www.chedong.com/tech/compress.html

Http://www.chedong.com/tech/cvs_card.html

Http://www.chedong.com/tech/default.html

Http://www.chedong.com/tech/dev.html

Http://www.chedong.com/tech/gnu.html

....

Siege-C 20-R 2-F www.chedong.com. url
Parameter description:
-C 20 concurrent 20 users
-R 2 repeat the loop twice
-F www.chedong.com. url task list: URL list

Output example:

** Siege 2.59
** Preparing 20 concurrent users for battle. This "battle" has 20 concurrent users
The server is now under siege... done. The service is in the "siege" test:
Transactions: 40 hits processed 40 times
Availability: 100.00% success rate
Elapsed time: 7.67 secs total time
Data transferred: 877340 bytes total data transmission: 877340 bytes
Response time: 1.65 secs corresponding time: 1.65 seconds: Display network connection speed
Transaction rate: 5.22 TRANS/sec processes 5.22 requests per second on average: indicates the backend processing speed of the server.
Throughput: 114385.92 Bytes/sec average data transferred per second: 114385.92 bytes
Concurrency: 8.59 maximum concurrency: 8.59
Successful transactions: 40 successful processing times
Failed transactions: 0 failure handling times

Auxiliary Tools:
Incremental stress testing:
To facilitate incremental stress testing, siege also includes some auxiliary tools:
Bombardment (1)
Is an auxiliary tool for testing according to the incremental user pressure:
Example:
Bombardment urlfile.txt 5 3 4 1
Initialize URL list: urlfile.txt
Initialization: 5 Users
Each increase: Three users
Run: 4 times
The latency between each client is: 1 second

Output in CSV format:
Siege2csv. pl (1)
Siege2csv. pl converts the bombardment output to the CSV format:
Time data transferred Response Time Transaction rate throughput concurrency Code 200 (note that this is horribly broken .)
242 60.22 603064 0.02 4.02 10014.35 0.08
605 59.98 1507660 0.01 10.09 25136.05 0.12
938 59.98 2337496 0.02 15.64 38971.26 0.26
1157 60 2883244 0.04 19.28 48054.07

IV,Http_load

: Http://www.acme.com/software/http_load/http_load-12mar2006.tar.gz

The program is very small. After decompression, less than 100 k of home travel is convenient.

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 test https-type website requests.

Command Format: http_load-P concurrent access process count-s URL file to be accessed during access time
For example:
Reference
Http_load-P 30-S 60 urllist.txt

Quasi-standby URL File: TST. list, the file format is one URL per line. It is better to test the URL with more than 50-URLs. In addition, the main indicator in the test results is the fetches/sec option, 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.

Official example:
Reference

%./Http_load-rate 10-seconds 60 urllist.txt
49 fetches, 4 Max parallel, 289884 bytes, in 10.0148 seconds
5916 mean Bytes/connection
4.89274 fetches/sec, 28945.5 Bytes/sec
Msecs/Connect: 28.8932 mean, 44.243 Max, 24.488 min
Msecs/first-response: 63.5362 mean, 81.624 Max, 57.803 min

4.89274 fetches/sec. This value means that the server can respond to about 4.8 queries per second.
This value is calculated based on 49 fetches/10.0148 seconds.

V,Web application Stress[Download]

Http://www.microsoft.com/downloads/details.aspx? Familyid = e2c0585a-062a-439e-a67d-75a89aa36495 & displaylang = en

Note:

1. in the "Settings" function settings, one is the stress level (threads), which specifies the number of threads used by the program in the background for requests, which is equivalent to simulating the number of client connections, more vividly, that is, setting the number of bombing threads. Generally, enter 500 ~ 1000, because the number of threads is set based on the local capacity. If you have sufficient confidence in your machine configuration, the higher the setting, the better the bombing effect.

2. In "test run time", specify the duration of a stress test, which can be divided into days, hours, minutes, And seconds. Set the duration based on the actual situation!

Usage:

Right-click the tool and select the Add command to add a new test project: new script, in the master option, enter the IP address of the server to be tested [192.168.200.100]. Select the Web connection method to be tested at the bottom. Select "get" for "Mode" and "path" for "Web page" to be tested [/info. php].

Set the number of stress level (threads) threads to 1000 in the "Settings" function settings. After that, click the gray triangle button in the tool to perform the test (4 ). After the test is completed, wait for a friend to send the task manager and connection view!

After the attack, you can see from the task manager that the CPU usage has reached 100%, and the loss rate has reached the maximum. Run the netstat-An command in the CMD window. You can see that my IP address is connected to port 80 on a friend's server. In addition, its web site cannot be opened, prompting too many users to connect, achieving the same purpose as the D. o.s attack.

Data analysis:
Select the "reports" command under the "View" menu, or click the button on the toolbar to open the report window and expand the corresponding report in the list on the left.

Check whether there are any socket-related errors in the socket errors section (the value is not 0 ).

Socket errors
--------------------------------------------------------------------------------
Connect: 406
Send: 0
Recv: 306
Timeouts: 0

The following is an explanation of each socket error: connect-the number of times the client cannot connect to the server. If this value is too high, check for any potential errors generated between the client and the server. Ping the server from each client or telnet the server's port 80 to verify that you get the correct response; send -- the number of times that the client cannot correctly send data to the server. If the value is too high, check whether the server is working correctly. Open a browser on the client and click the site page to verify that the site is working correctly. Recv-the number of times that the client cannot correctly receive data from the server. If this value is too high, execute the same operation as the send error, and check whether the error is reduced if you reduce the load factor; timeouts -- the number of timeout threads, and then it is disabled. If this value is too high, open a browser on the client and manually click the site page to verify if your program is slow even if there is only one user. Perform another stress test with different load coefficients to see the potential characteristics of the program.

Result Codes
Code Description count
========================================================== ==========================================================
200 OK 11058
Na HTTP result code not given 306
If the "socket" error is very low or 0, find the "result codes" section in the report list on the left. Check whether all result codes are 200,200, indicating that all requests are successfully returned by the server. If you find a result greater than or equal to 400, click the "page data" node in the report list to expand all projects and view the report of each script item on the right window page, find the project with the error.

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.