Apache stress testing tool-AB initial experience

Source: Internet
Author: User

Apache stress testing tool-AB initial experience

We know that there are indeed a lot of stress testing software, such as Microsoft's WAST, HP's LoadRunner, and so on, but it still takes some time to learn these software, and it is a headache to choose it, later, on GUO Xin's "Building a high-performance Web site" [PDF download], he saw his introduction to this Apache stress testing tool AB, which he liked very much, so today, we finally have the opportunity to experience AB's stress testing on the website.

Before the experiment, My apache has been installed. Operating System: Ubuntu 10.04 VMware 7.0

1. First check the version information AB-V (note that it is an uppercase V)
01. bkjia @ bkjia :~ $ AB-V
02. This is apacheloud, Version 2.3 <$ Revision: 655654 $>
03. Copyright 1996 Adam Twiss, Zeus Technology Co., http://www.zeustech.net/
04. Licensed to The Apache Software Foundation, http://www.apache.org/


2. You can also use lower-case v to view some AB-v attributes of the AB command.
01. bkjia @ bkjia :~ $ AB-v
02. AB: option requires an argument -- v
03. AB: wrong number of arguments
04. Usage: AB [options] [http [s]: //] hostname [: port]/path
05. Options are:
06.-n requests Number of requests to perform
07.-c concurrency Number of multiple requests to make
08.-t timelimit Seconds to max. wait for responses
09.-B windowsize Size of TCP send/receive buffer, in bytes
10.-p postfile File containing data to POST. Remember also to set-T
11.-u putfile File containing data to PUT. Remember also to set-T
12.-T content-type Content-type header for POSTing, eg.
13. 'application/x-www-form-urlencoded'
14. Default is 'text/plain'
15.-v verbosity How much troubleshooting info to print
16.-w Print out results in HTML tables
17.-I Use HEAD instead of GET
18.-x attributes String to insert as table attributes
19.-y attributes String to insert as tr attributes
20.-z attributes String to insert as td or th attributes
21.-C attribute Add cookie, eg. 'apache = 1234. (repeatable)
22.-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
23. Inserted after all normal header lines. (repeatable)
24.-A attribute Add Basic WWW Authentication, the attributes
25. are a colon separated username and password.
26.-P attribute Add Basic Proxy Authentication, the attributes
27. are a colon separated username and password.
28.-X proxy: port Proxyserver and port number to use
29.-V Print version number and exit
30.-k Use HTTP KeepAlive feature
31.-d Do not show percentiles served table.
32.-S Do not show confidence estimators and warnings.
33.-g filename Output collected data to gnuplot format file.
34.-e filename Output CSV file with percentages served
35.-r Don't exit on socket receive errors.
36.-h Display usage information (this message)
37.-Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers)
38.-f protocol Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or ALL)


3. Now let's perform a stress test on 88181 of websites, use the command AB-n1000-c10 http://www.88181.com/index.php, where-n1000 represents the total number of requests-c10 represents the number of concurrent users as 10 http://www.88181.com/index.php represents the request URL, and below is the test result, I have commented out the three most important indicators.

 
01. bkjia @ bkjia :~ $ AB-n1000-c10 http://www.88181.com/index.php
02. This is apacheloud, Version 2.3 <$ Revision: 655654 $>
03. Copyright 1996 Adam Twiss, Zeus Technology Co., http://www.zeustech.net/
04. Licensed to The Apache Software Foundation, http://www.apache.org/
05.
06.
07. Benchmarking www.88181.com (be patient)
08. completed100 requests
09. completed200 requests
10. completed300 requests
11. completed400 requests
12. completed500 requests
13. completed600 requests
14. completed700 requests
15. completed800 requests
16. completed900 requests
17. completed1000 requests
18. Finished 1000 requests
19.
20./* the WEB server uses nginx */
21. Server Software: nginx
22. Server Hostname: www.88181.com
23. Server Port: 80
24.
25. Document Path:/index. php
26. Document Length: 154 bytes
27.
28. Concurrency Level: 10
29. Time taken for tests: 74.373 seconds
30. Complete requests: 1000
31. Failed requests: 0
32. Write errors: 0
33. Non-2xx responses: 1000
34. Total transferred: 330000 bytes
35. HTML transferred: 154000 bytes
36./* One of the most important indicators is the throughput.
37. It is equivalent to the number of transactions per second in LR. The mean in the brackets below indicates that this is an average value */
38. Requests per secondd: 13.45 [#/sec] (mean)
39./* Metric 2, the most important indicator, refers to the average user request wait time
40. It is equivalent to the average transaction response time in LR. The mean in the brackets below indicates that this is an average value */
41. Time per request: 743.726 [MS] (mean)
42./* The Third Metric that everyone cares about most refers to the average Server Request Processing Time
43. Time per request: 74.373 [MS] (mean, average SS all concurrent requests)
44. Transfer rate: 4.33 [Kbytes/sec] canceled ed
45.
46. Connection Times (MS)
47. min mean [+/-sd] median max
48. Connect: 129 163 245.3 145 3154
49. Processing: 129 576 1510.8 147
50. Waiting: 129 567 1502.0 147
51. Total: 261 739 1543.7 294 11888
52.
53. Percentage of the requests served within a certain time (MS)
54. 50% 294
55. 66% 297
56. 75% 304
57. 80% 308
58. 90% 1290
95% 3452
60. 98% 7582
61. 99% 7962
62. 100% 11888 (longest request)


4. To make the results more comparative, we will change the number of concurrent users to 100 for stress testing. Here I will only post three indicators.
01. Requests per second: 190.95 [#/sec] (mean)
02. Time per request: 523.694 [MS] (mean)
03. Time per request: 5.237 [MS] (mean, average SS all concurrent requests)


5. Change the number of concurrent users to 200 for testing.
01. Requests per second: 186.00 [#/sec] (mean)
02. Time per request: 1149.433 [MS] (mean)
03. Time per request: 5.747 [MS] (mean, average SS all concurrent requests)


6. Situations of 500 concurrent users
01. Requests per second: 180.99 [#/sec] (mean)
02. Time per request: 2631.662 [MS] (mean)
03. Time per request: 5.263 [MS] (mean, average SS all concurrent requests)


Let's analyze the test results. First, compare the throughput. When the number of concurrent users is 190 reqs/s, the maximum throughput is 200,500. When the number of concurrent users is, the throughput is reduced, as a result, the user's waiting time increases significantly, and there is already 2 seconds of waiting time. This shows that the performance has dropped significantly. Of course, the analysis of this test result does not show that 88181 of the concurrent users of the website can only be around 500, Because I tested it when the server load is heavy, which obviously cannot explain the problem. In addition, when testing in the production environment, it is best to make the test results into a report so that we can clearly compare the problem. Well, I should prepare for it, I submitted a test report for our website.

This article permanently updates the link address:

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.