First, Http_load
The program is very small, after decompression is less than 100K
The http_load runs in parallel multiplexing to test the throughput and load of the Web server. However, unlike most stress testing tools, it can run in a single process and generally does not kill the client. You can also test site requests for HTTPS classes.
: http://soft.vpser.net/test/http_load/http_load-12mar2006.tar.gz
Installation
#tar ZXVF http_load-12mar2006.tar.gz
#cd http_load-12mar2006
#make && make Install
<!--more-->
Command format: http_load-p number of concurrent access processes-S access time URL file to access
Parameters can be freely combined, and there is no limit to the choice between parameters. Like you wrote Http_load-parallel 5-seconds.
The urls.txt is also possible. Let's give you a brief explanation of the parameters.
-parallel Shorthand-P: means the number of concurrent user processes.
-fetches abbreviated-F: Meaning total number of accesses
-rate Shorthand-P: meaning the frequency of visits per second
-seconds shorthand-S: meaning Total access time
Prepare the URL file: urllist.txt, the file format is one url,url per line preferably more than 50-100 test results better. 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 Urllist.txt
Parameter understanding, let's look at running a command to see its return result
Command:%./http_load-rate 5-seconds The URLs description performed a test that lasted for 10 seconds, with a frequency of 5 per second.
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
Results Analysis:
1. Fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds
Description in the above test run 49 requests, the maximum number of concurrent processes is 2, the total transfer of data is 289884bytes, the run time is 10.0148 seconds
2. 5916 mean bytes/connection shows the average amount of data transmitted per connection 289884/49=5916
3. 4.89274 fetches/sec, 28945.5 bytes/sec
Indicates that the response request per second is 4.89274, and the data passed 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 per connection is 28.8932 msecs, maximum response time 44.243 msecs, minimum response time 24.488 msecs
5. msecs/first-response:63.5362 mean, 81.624 max, 57.803 min
6, HTTP response Codes:code 200-49 explains the type of open response page, if the type of 403 is too many, it may
Be aware that the system is experiencing bottlenecks.
Special Instructions:
The main indicators in the test results are fetches/sec, Msecs/connect, which is the number of queries per second that the server can respond to, using this metric to measure performance. Seems to be a bit higher than Apache's AB accuracy and more persuasive.
Qpt-responds to user times per second and response time per connection.
The result of the test is mainly to look at these two values. Of course, only these two indicators do not complete the performance analysis, we also need to the server CPU, men analysis, in order to come to the conclusion
Second, Webbench
Webbench is a Web site stress testing tool under Linux that can simulate up to 30,000 concurrent connections to test the load capacity of a Web site. can go to google search, I am here to give a
: http://soft.vpser.net/test/webbench/webbench-1.5.tar.gz
This program is smaller, after decompression less than 50K, hehe
Installation
#tar ZXVF webbench-1.5.tar.gz
#cd webbench-1.5
#make && make Install
Generates the Webbench executable file in the current directory, which can be used directly
Usage:
Webbench-c Concurrent number-T run test time URL
Such as:
Webbench-c 5000-t http://www.163.com
Third, AB
Options
-A Auth-username:password
Provides a basic authentication trust to the server. The user name and password are separated by a: and sent in Base64 encoded form. This string is sent regardless of whether the server is required (that is, if the 401 authentication requirement code is sent).
-C concurrency
The number of requests produced at one time. The default is one at a time.
-C Cookie-name=value
Attach a cookie to the request: line. Its typical form is a parameter pair of Name=value. This parameter can be repeated.
-D
The message "percentage served within XX [MS] table" is not displayed (supported for previous versions).
-E Csv-file
Produces a comma-delimited (CSV) file that contains the corresponding percentage (in subtle units) of time that is required to process requests for each corresponding percentage (from 1% to 100%). This format is more useful than the ' gnuplot ' format because it is "binary".
-G Gnuplot-file
Writes all test results to a ' gnuplot ' or a TSV (tab-delimited) file. This file can be easily imported into gnuplot, IDL, Mathematica, Igor or even Excel. One of the first behavior headings.
-H
Displays the usage method.
-H Custom-header
Additional header information is attached to the request. A typical form of this parameter is a valid header information row that contains a pair of fields and values separated by colons (for example, "Accept-encoding:zip/zop;8bit").
-I.
Executes the head request instead of get.
-K
Enable the HTTP KeepAlive feature, which is to execute multiple requests in an HTTP session. By default, the KeepAlive feature is not enabled.
-N Requests
The number of requests executed in the test session. By default, only one request is executed, but usually its result does not represent meaning.
-P Post-file
A file that contains the data that needs to be post.
-P Proxy-auth-username:password
Provides a basic authentication trust for a transit agent. The user name and password are separated by a: and sent in Base64 encoded form. This string is sent regardless of whether the server is required (that is, if the 401 authentication requirement code is sent).
-Q
If the number of requests processed is greater than 10%, AB outputs a progress count in stderr each time the request is processed by approximately one or 100 requests. This-Q flag can suppress this information.
-S
Used to compile (Ab-h will display relevant information) using SSL for protected HTTPS instead of HTTP protocol. This feature is experimental and very rudimentary. It's better not to use.
-S
Median and standard divergence values are not displayed, and warning or error messages are not displayed when the mean and median values are 1 to twice times the standard deviation value. By default, values such as min/mean/maximum values are displayed. (Support for previous versions).
-T TimeLimit
The maximum number of seconds the test takes. Its internal implied value is-n 50000. It allows you to limit the testing of the server to a fixed total time. By default, there is no time limit.
-T Content-type
The Content-type header information used by the post data.
-V verbosity
Setting the level of detail to display information-4 or greater displays header information, 3 or greater values can display response codes (404, 200, etc.), and 2 or greater values can display warnings and other information.
-V
Displays the version number and exits.
-W
Outputs the result in the format of an HTML table. By default, it is a table with a two-column width on a white background.
-X <table>-attributes
A string that sets the <table> property. This property is filled in <table here;.
-X proxy[:p ORT]
Use a proxy server for requests.
-Y <tr>-attributes
A string that sets the <tr> property.
-Z <td>-attributes
A string that sets the <td> property.
Defects
There are various statically declared fixed-length buffers in the program. In addition, parsing of command-line arguments, the response headers of the server, and other external inputs can be very simple, which may have undesirable consequences.
It does not realize the http/1.x completely; Accept only certain ' expected ' response formats. The frequent use of STRSTR (3) can lead to performance problems, that is, you may be testing the performance of AB rather than the server.
A lot of parameters, generally we use the-C and-n parameters can be. For example:
./ab-c 1000-n http://127.0.0.1/index.php
This represents processing 1000 requests at the same time and running the index.php file 1000 times.
#/usr/local/xiaobai/apache2054/bin/ab-c 1000-n http://127.0.0.1/index.html.zh-cn.gb2312
This is apachebench, 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)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished 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
Test the page document
Document length:1018 bytes
Document size
Concurrency level:1000
Concurrency number
Time taken for tests:8.188731 seconds
Duration of the entire test
Complete requests:1000
Number of requests completed
Failed requests:0
Number of failed requests
Write errors:0
Total transferred:1361581 bytes
Network traffic in the entire scene
HTML transferred:1055666 bytes
The amount of HTML content transferred throughout the scene
Requests per second:122.12 [#/sec] (mean)
One of the most concerned indicators, equivalent to the number of transactions per second in LR, followed by mean in parentheses indicates that this is an average
Time per request:8188.731 [MS] (mean)
Two of the most concerned indicators, equivalent to the average transaction response time in LR, followed by mean in parentheses indicates that this is an average
Time per request:8.189 [MS] (mean, across all concurrent requests)
Average of actual run time per request
Transfer rate:162.30 [Kbytes/sec] Received
Average traffic on the network per second can help eliminate the problem of extended response times due to excessive network traffic
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 4554
total:813 1638 1338.9 1093 7785
The 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)
The response of all requests in the entire scene. Each request in the scene has a response time, where 50% of the user's 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
Due to concurrent requests, the CPU is not actually processed at the same time, but instead is rotated on a per-request basis, so basically the first time of the request is approximately equal to the second time per request multiplied by the number of concurrent requests.
Iv. Siege
An open-source stress testing tool that allows multiuser concurrent access to a Web site based on configuration, recording the corresponding time for each user's request process, and repeating under a number of concurrent accesses.
Official: http://www.joedog.org/
Siege Download: http://soft.vpser.net/test/siege/siege-2.67.tar.gz
Extract:
# TAR-ZXF Siege-2.67.tar.gz
Go to unzip directory:
# CD siege-2.67/
Installation:
#./configure; Make
#make Install
Use
Siege-c 200-r 10-f Example.url
-C is the concurrency,-R is the number of repetitions. The URL file is a text, each line is a URL, it will be randomly accessed from the inside.
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//completed 419,263 times processing
availability:100.00%//100.00% success rate
Elapsed time:5999.69 secs//Total time
Data transferred:84273.91 MB//Total data transfer 84273.91 MB
Response time:0.37 secs//spents 1.65 seconds: Shows the speed of the network connection
Transaction rate:569.91 trans/sec//569.91 processing per second: indicates the server
throughput:14.05 mb/sec//Average data transfer per second
concurrency:213.42//Actual maximum number of concurrent
Successful transactions:2564081//successful processing times
Failed transactions:11//Failure handling times
Longest transaction:29.04//maximum time spent per transmission
Shortest transaction:0.00//minimum time per transmission
Introduction to Linux under four Web Server stress test tools (http_load, Webbench, AB, Siege)