Stress testing tool Apache Bench

1: Throughput (Requests per second)

Server capabilities concurrent processing described quantization unit is reqs / s, refers to the number of requests processed per unit time at a certain number of concurrent users. The maximum number of requests at a certain number of concurrent users that can be processed per unit of time, called maximum throughput.

Remember: Throughput is based on the number of concurrent users. This sentence represents two meanings, 1: number of concurrent users and throughput associated; 2: different number of concurrent users, the throughput is generally different.

Calculated: Total number of requests / the number of requests processed time spent, i.e.,

Request per second = Complete requests / Time taken for tests

2: the number of concurrent (The number of concurrent connections) are connected

The number of concurrent connections means that at some point the number of requests received by the server, simply speaking, is a conversation.

3: the number of concurrent (The number of concurrent users, Concurrency Level) user

Important to distinguish the difference between the concept and the number of concurrent connections, a user may simultaneously generate multiple sessions, i.e. the number of connections. In HTTP / 1.1, IE7 supports two concurrent connections, IE8 support six simultaneous connections, FireFox3 supports four concurrent connections, so Accordingly, we have to divide the number of concurrent users of this base.

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

Calculated: number of requests processed all the time spent / (total number of requests / number of concurrent users), i.e.

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

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

Calculated: number of requests processed all the time spent / total number of requests, i.e.,

Time taken for / testsComplete requests

We can see that it is the inverse of throughput.

It also mean = user request waiting time / number of concurrent users, i.e.,

Time per request / Concurrency Level

 

Download the official website: https://www.apachelounge.com/download/

 After the download, unzip, with cmd into the current project unpacked directory:

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

 

Test command:

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

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)

 

The output resolution:

 

 

 

Guess you like

Origin www.cnblogs.com/chenmz1995/p/12579987.html