AB pressure test

Source: Internet
Author: User

Ultra-practical pressure test tool-ab Toolwrite in front

Before learning AB tools, we need to know a few concepts about stress testing

    1. Throughput rate (requests per second)
      Concept: A quantitative description of the server concurrency processing capability, in reqs/s, refers to the number of requests processed per unit of time for a concurrent user. The maximum number of requests per unit of time that a concurrent user could process, called the maximum throughput rate.
      Calculation formula: Total number of requests/time taken to complete these requests, i.e.
      Request per second = complete Requests/time taken for tests

    2. Concurrent connections (the number of concurrent connections)
      Concept: The number of requests received by the server at some point, simply speaking, is a conversation.

    3. Concurrent users (the number of concurrent users,concurrency level)
      Concept: To be aware of the difference between this concept and the number of concurrent connections, a user may produce multiple sessions at the same time, that is, the number of connections.

    4. Average user request wait time (times per request)
      Calculation formula: The amount of time spent processing all requests (total number of requests/concurrent users), i.e.
      Time per request = time taken for tests/(complete requests/concurrency level)

    5. Average Server request latency (time per request:across all concurrent requests)
      Calculation formula: The amount of time/Total requests processed to complete all requests, i.e.
      Time taken For/testscomplete requests
      As you can see, it is the reciprocal of the throughput rate.
      At the same time, it also = user average request waiting time/number of concurrent users, i.e.
      Time per request/concurrency level

Introduction to AB Tools

AB all called: Apache bench

    • The explanations on the official website are as follows:

      AB is the performance Test tool for Apache Hypertext Transfer Protocol (HTTP). Its design intent is to depict the execution performance of the currently installed Apache, primarily to show how many requests per second Apache you have installed.

    • Other website Explanation:

      AB is an Apache self-brought stress test tool. AB is very practical, it can not only the Apache server site access stress testing, or other types of servers can be stress testing. such as Nginx, Tomcat, IIS, and so on.

Download AB Tools

Go to Apache official website http://httpd.apache.org/download Apache

Start Testing

Input command
ab -n 100 -c 10 http://test.com/
Where-n indicates the number of requests, and-C represents the number of concurrent

Test results Analysis

When the above command runs, it's out of the test report.


Full Test Report
    • This section shows the Web server information, you can see the server is using Nginx, the domain name is wan.bigertech.com, the port is 80

Server information
    • This is information about the requested document, where "/", the size of the document is 338436 bytes (this is the body length of the HTTP response)

Document Information
    • This section shows a few important indicators of stress testing

Key indicators

Concurrency level:100
Number of concurrent requests
Time taken for tests:50.872 seconds
Duration of the entire test
Complete requests:1000
Number of requests completed
Failed requests:0
Number of failed requests

Total transferred:13701482 bytes
Network traffic in the entire scene
HTML transferred:13197000 bytes
The amount of HTML content transferred throughout the scene

Requests per second:19.66 [#/sec] (mean)
Throughput rate, 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:5087.180 [MS] (mean)
Average user request Wait time, the two most concerned about the indicator, equivalent to the average transaction response time in LR, the following parentheses in the mean that this is an average
Time per request:50.872 [MS] (mean, across all concurrent requests)
Server average request processing time, the three most concerned about the target

Transfer rate:263.02 [Kbytes/sec] Received
Average traffic on the network per second can help eliminate the problem of extended response times due to excessive network traffic

    • This segment represents the decomposition of the time consumed on the network

Network consumption time
    • This is the distribution of each request processing time, 50% of the processing time in 4930ms, 66% of the processing time within 5008ms ..., it is important to see the processing time of 90% .

Response information about login issues

Sometimes a stress test requires a user to log in, what to do?
Please refer to the following steps:

    1. After logging in with your account and password, use the developer tools to find the cookie value (session ID) that identifies the session.
    2. If only one cookie is used, simply type the command:
      ab -n 100 -C key=value http://test.com/

      If more than one cookie is required, set the header directly:
      ab -n 100 -H “Cookie: Key1=Value1; Key2=Value2” http://test.com/

Summarize

In general, AB Tool AB is small and simple, quick to learn, can provide the basic performance indicators needed, but no graphical results, can not be monitored. The AB tool can therefore be used as a temporary emergency task and as a simple test.
The same type of pressure testing tools are: Webbench, siege, Http_load, etc.

AB pressure test

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.