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

Detailed explanation of the use of Linux time command

1. Command Introduction time is used to count the...

Introduction to ufw firewall in Linux

Let's take a look at ufw (Uncomplicated Firew...

Several ways to shut down Hyper-V service under Windows 10

When using VMware Workstation to open a virtual m...

Implementing a web calculator based on JavaScript

This article shares the specific code of JavaScri...

js to realize a simple puzzle game

This article shares the specific code of js to im...

10 skills that make front-end developers worth millions

The skills that front-end developers need to mast...

How to install and deploy gitlab server on centos7

I am using centos 7 64bit system here. I have tri...

Detailed explanation of common usage of MySQL query conditions

This article uses examples to illustrate the comm...

Detailed steps for installing ros2 in docker

Table of contents Main topic 1. Install Docker on...

Idea deployment tomcat service implementation process diagram

First configure the project artifacts Configuring...

In-depth understanding of Vue's plug-in mechanism and installation details

Preface: When we use Vue, we often use and write ...

Web Design Tutorial (5): Web Visual Design

<br />Previous article: Web Design Tutorial ...

jQuery plugin to implement dashboard

The jquery plug-in implements the dashboard for y...

Steps for Docker to build its own local image repository

1. Environment and preparation 1. Ubuntu 14.04 2....