Copyright NOTICE: This article may be reproduced, but not without my permission, shall not be used for any commercial purposes or other purposes for the purpose of profit. I reserve all the rights to this article. If you want to reprint, please reprint is to retain this copyright notice, and to ensure the integrity of this article. Also please the author to understand the work of creation, respect for the labor achievements of the authors.
Author: lei (Jackei)
Email: jackeichan@gmail.com
Blog:http://jackei.cnblogs.com
Introduction
According to the original plan, today began to study JMeter, one day to read the majority of the User Manual, found that the original as long as the calm, learning efficiency is quite high, and a lot of English documents are not so terrible ^_^
Originally wanted to drop the document translation, but later thought, understand is one thing, all translated is another thing, the workload is too large, and this is not my first to study the original intention of JMeter. Let's talk about the problems that you are interested in studying together.
Open source tools are often developed for a specific purpose, so it's a bit grudging to find an open source performance test tool to compare with LoadRunner or qaload. But open source tools also have their advantages: small, lightweight, offering excellent solutions in areas that are good for you. Therefore, we can consider preparing a "open Source Test Toolbox", peacetime use of free time to understand the application of various tools of the environment and purpose, knowledge accumulated slowly after, you can in the face of problems, easy to dissolve ^_^
Also, if there is enough free time in August and September, I think I'll write a series of articles about the introduction of open source performance testing tools in the actual development and testing process. If you have friends interested, I hope you can study and discuss together.
Brief Introduction
The full name of AB is Apachebench, a gadget that comes with Apache, dedicated to the benchmark testing of HTTP Server, that can simulate multiple concurrent requests at the same time. Some time ago to see the company's developers are also using it to do some testing, looks good, very simple, but also easy to use, so take a moment to see today.
By following a simple example and a note, I believe you can understand the use of this tool more easily.
a simple example
/* At the beginning of this example, I executed such a command ab-n 10-c http://www.google.com/. the meaning of this command is to start AB, send 10 requests to www.google.com (-n 10), and send 10 requests (-C 10) at a time--that is to say, once. followed by the AB output test report, the red part is the comment I added. */
C:\Program files\apache Software foundation\apache2.2\bin>ab-n 10-c Ten http
://www.google.com/
This is apachebench, Version 2.0.40-dev < $Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 1997-2005 the Apache Software Foundation, http://www.apache.org/
Benchmarking www.google.com (Be patient) ... done
Server software:gws/2.1
Server Hostname:www.google.com
Server port:80
Document Path:/
Document length:230 bytes
Concurrency Level:10
* * The duration of the entire test/
Time taken for tests:3.234651 seconds
/* Number of requests completed/*
Complete requests:10
/* Number of failed requests * *
Failed requests:0
Write errors:0
Non-2xx responses:10
Keep-alive requests:10
/* network traffic in the entire scene * *
Total transferred:6020 bytes
/* The amount of HTML content in the entire scene is transmitted.
HTML transferred:2300 bytes
/* One of the most concerned indicators, the equivalent of LR in the number of transactions per second , the following brackets in the mean that this is an average * *
Requests per second:3.09 [#/sec] (mean)
/* The two most concerned indicators, equivalent to the average transaction response time in LR, followed by the mean in parentheses that this is an average * *
Time per request:3234.651 [MS] (mean)
* * This does not know what is meant to have a friend to know, please leave a message, thank ^_^ * *
Time/request:323.465 [MS] (mean, across all concurrent requests)
/* Average traffic per second on the network, can help to eliminate the existence of excessive network traffic caused the response time to prolong the problem * *
Transfer rate:1.55 [Kbytes/sec] Received
* * The time spent on the network decomposition, the data of the specific algorithm is not very clear * *
Connection Times (MS)
Min MEAN[+/-SD] Median max
Connect:20 318 926.1 30 2954
processing:40 2160 1462.0 3034 3154
waiting:40 2160 1462.0 3034 3154
Total:60 2479 1276.4 3064 3184
/* The following content is the response of all requests in the entire scene. There is a response time for each request in the scene, where 50% of the user response time is less than 3064 milliseconds, 60 of the user response time is less than 3094 milliseconds, and the maximum response time is less than 3184 milliseconds * *
Percentage of the requests served within a certain time (MS)
50% 3064
66% 3094
75% 3124
80% 3154
90% 3184
95% 3184
98% 3184
99% 3184
100% 3184 (Longest request)
More Information
AB is not as powerful as LR, but it's lightweight, and if you're just looking to check a module's response in the development process, or do some simple test, AB is a good choice--at least not to spend a lot of time learning about LR's complex features, let alone the License 's Price.
The following is the detailed parameters of ab explanation, we are interested to study, there is not enough time to study recently, if a friend interested in the hope that you can help translate the meaning of each parameter, there are questions to discuss also welcome to reply ^_^
AB [- A Auth-username:password] [- c concurrency] [- c Cookie-name=value] [- D ] [- e csv-file] [- g Gnuplot-file] [- H ] [- H Custom-header] [- I ] [- K ] [- N requests] [- P Post-file] [- P Proxy-auth-username:password] [- Q ] [- S ] [- S ] [- T TimeLimit] [- T Content-type] [- v verbosity] [- V ] [- W ] [- x <table>-attributes] [- X proxy[:p ORT]] [-