Apache Bench stress testing tool implementation principle and usage analysis

Apache Bench stress testing tool implementation principle and usage analysis

1: Throughput (Requests per second)

A quantitative description of the server's concurrent processing capability, measured in reqs/s, which refers to the number of requests processed per unit time under a certain number of concurrent users. The maximum number of requests that can be processed per unit time under a certain number of concurrent users is called the maximum throughput.

Remember: throughput is based on the number of concurrent users. This sentence represents two meanings: 1. The throughput rate is related to the number of concurrent users; 2. The throughput rate is generally different under different numbers of concurrent users.

Calculation formula: total number of requests / time spent processing these requests, that is,

Request per second = Complete requests / Time taken for tests

2: The number of concurrent connections

The number of concurrent connections refers to the number of requests accepted by the server at a certain moment, or simply put, a session.

3: The number of concurrent users (Concurrency Level)

It is important to distinguish this concept from the number of concurrent connections. A user may have multiple sessions, or connections, at the same time. Under HTTP/1.1, IE7 supports two concurrent connections, IE8 supports six concurrent connections, and FireFox3 supports four concurrent connections, so accordingly, the number of our concurrent users must be divided by this base.

4: Average user request waiting time (Time per request)

Calculation formula: time taken to process all requests / (total number of requests / number of concurrent users), that is

Time per request = Time taken for tests / (Complete requests / Concurrency Level)

5: Server average request waiting time (Time per request: across all concurrent requests)

Calculation formula: time taken to process all requests/total number of requests, that is

Time taken for / testsComplete requests

As you can see, it is the inverse of the throughput rate.

At the same time, it is also = average user request waiting time / number of concurrent users, that is,

Time per request / Concurrency Level

Official website download address: https://www.apachelounge.com/download/

After downloading, unzip it and use cmd to enter the current project decompression directory:

Then enter the shell command execution interface (enter the bin directory):

Test command:

./ab -n 100 -c 10 http://localhost:8085/linewell/test1/pass/testApacheBench.do

-n indicates the number of requests, and -c indicates a maximum of several requests can be sent simultaneously.

Because of my Java test, if -c is set to 1, the Java backend controller will delay for one second, and will process them one by one, basically requiring 100 processing times. If -c is 10, 10 will be processed at a time.

Output:

This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done


Server Software:
Server Hostname: localhost
Server Port: 8085

Document Path: /linewell/test1/pass/testApacheBench.do
Document Length: 0 bytes

Concurrency Level: 10
Time taken for tests: 0.077 seconds
Complete requests: 100
Failed requests: 0
Non-2xx responses: 100
Total transferred: 9200 bytes
HTML transferred: 0 bytes
Requests per second: 1299.09 [#/sec] (mean)
Time per request: 7.698 [ms] (mean)
Time per request: 0.770 [ms] (mean, across all concurrent requests)
Transfer rate: 116.72 [Kbytes/sec] received

Connection Times (ms)
    min mean[+/-sd] median max
Connect: 0 0 0.3 0 1
Processing: 1 5 3.4 5 27
Waiting: 1 4 3.1 4 26
Total: 2 5 3.4 5 27

Percentage of the requests served within a certain time (ms)
 50% 5
 66% 6
 75% 7
 80% 7
 90% 9
 95% 11
 98% 11
 99% 27
 100% 27 (longest request)

Output result analysis:

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to implement web stress testing through Apache Bench
  • Apache ab concurrent load stress test implementation method
  • Use the Apache ab tool to perform a simple stress test on the Apache server
  • Summary of common knowledge about Apache stress testing and web performance optimization
  • Apache ab tool page stress test return results interpretation
  • Installation and use of Apache stress testing tools

<<:  Detailed explanation of MySQL partition table

>>:  Docker beginners' first exploration of common commands practice records

Recommend

How to configure Basic Auth login authentication in Nginx

Sometimes we build a file server through nginx, w...

Introduction to Nginx regular expression related parameters and rules

Preface Recently, I have been helping clients con...

How to query and update the same table in MySQL database at the same time

In ordinary projects, I often encounter this prob...

25 Tools to Improve Website Usability and Conversion Rates

For a website, usability refers to whether users c...

VMware Workstation installation Linux (Ubuntu) system

For those who don't know how to install the s...

Detailed explanation of memory management of MySQL InnoDB storage engine

Table of contents Storage Engine Memory Managemen...

Vue+Echart bar chart realizes epidemic data statistics

Table of contents 1. First install echarts in the...

How to use ssh tunnel to connect to mysql server

Preface In some cases, we only know the intranet ...

How to use the Linux md5sum command

01. Command Overview md5sum - Calculate and verif...

The use of v-model in vue3 components and in-depth explanation

Table of contents Use two-way binding data in v-m...

Summary of the use of special operators in MySql

Preface There are 4 types of operators in MySQL, ...

uniapp Sample code for implementing global sharing of WeChat mini-programs

Table of contents Create a global shared content ...

Simply understand the writing and execution order of MySQL statements

There is a big difference between the writing ord...