Although Apache comes with a stress test tool AB, AB's functionality is too simple to simulate real web access, so we're going to use the more powerful web stress test tool--siege (the English original: Siege).
After installing siege, modify the siege configuration, find the Siegerc file, and then vim SIEGERC
Adjustment:
verbose = Falseconcurrent = 50delay = 1internet = Truebenchmark = True
Siege parameter Description:
*-C NUM
Set the number of concurrent users (connections), such as-C10, to set the concurrent 10 connections. The default number of connections can be viewed in ~/.SIEGERC, the instruction is concurrent = x, before we have adjusted the default concurrent connection is 50.
*-R NUM
(repetitions), the number of repetitions, that is, the number of requests per connection, setting this, you do not need to set-T. corresponding to the reps = x directive in the. SIEGERC configuration file
*-T NUM
(time), duration, which is the duration of the test, ends after NUM time, the unit defaults to points, such as-t10, then the test time is 10 minutes,-t10s, the test time is 10 seconds. The instruction in the corresponding. SIEGERC is time = x instruction
*-B
(benchmark), benchmark, if this parameter is set, then the delay time is 0. In. Siegerc we modify it to open by default.
*-F Url.txt
(file), which is the URL list file. The file = x directive in the. SIEGERC configuration file
Test Result Analysis:
[[email protected" ~]# siege-c 500-r 50-f shunz.net.url** Siege 2.67** Prepari Ng concurrent users for battle. The server is now under siege. Done. transactions:25000 hitsavailability:100.00%elapsed time:65.52 secsdata Transfer red:83.65 mbresponse time:0.57 secstransaction rate:381.56 trans/secthroughput: 1.28 mb/secconcurrency:216.02successful transactions:21707failed transactions: 0Longest transaction:5.83shortest transaction:0.00
The above is the result of 500 concurrent repeat Test 50 times the URL list in Shunz.net.url,
Analyze the test results in one of the following strips:
transactions:25000 hits means a total of 25,000 tests were completed.
availability:100.00% validity of test 100%
Elapsed time:65.52 secs spents 65.52 seconds
Data transferred:83.65 MB transmits 83.65MB
Response time:0.57 secs response time
Transaction rate:381.56 Trans/sec transmitted 381.56 times per second
throughput:1.28 mb/sec Data throughput 1.28MB per second
concurrency:216.02 Actual concurrent access
Successful transactions:21707 successful transmission
Failed transactions:0 failed transmission
Longest transaction:5.83 maximum time per transfer
Shortest transaction:0.00 the shortest time per transmission
Siege Simple Tutorial