ab apache 基准测试中的传输速率
transfer rate in ab apache benchmark
我正在对用 SpringBoot 编写的简单 helloworld app written in my framework against the one 进行基准测试。
SpringBoot版本的ab日志:
luog~$ ab -n 100000 -c 20 http://localhost:8080/hello?name=rythm
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
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)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: localhost
Server Port: 8080
Document Path: /hello?name=rythm
Document Length: 155 bytes
Concurrency Level: 20
Time taken for tests: 6.733 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 32100000 bytes
HTML transferred: 15500000 bytes
Requests per second: 14851.38 [#/sec] (mean)
Time per request: 1.347 [ms] (mean)
Time per request: 0.067 [ms] (mean, across all concurrent requests)
Transfer rate: 4655.56 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 0 1 0.7 1 15
Waiting: 0 1 0.7 1 15
Total: 0 1 0.7 1 15
Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 2
80% 2
90% 2
95% 2
98% 3
99% 4
100% 15 (longest request)
ActFramework 的 ab 日志:
luog~$ ab -n 100000 -c 20 http://localhost:5460/?who=rythm
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
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)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software:
Server Hostname: localhost
Server Port: 5460
Document Path: /?who=rythm
Document Length: 111 bytes
Concurrency Level: 20
Time taken for tests: 6.796 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 18600000 bytes
HTML transferred: 11100000 bytes
Requests per second: 14714.64 [#/sec] (mean)
Time per request: 1.359 [ms] (mean)
Time per request: 0.068 [ms] (mean, across all concurrent requests)
Transfer rate: 2672.78 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 0 1 1.2 1 9
Waiting: 0 1 1.2 1 9
Total: 0 1 1.2 1 9
Percentage of the requests served within a certain time (ms)
50% 1
66% 2
75% 2
80% 3
90% 3
95% 3
98% 4
99% 4
100% 9 (longest request)
正如我们所见,每秒的事务处理量几乎相同。但是传输速率非常不同。 SpringBoot版本超过4.5Kb/s,Act版本只有2.7Kb/s
我不知道
为什么响应时间几乎相同,而传输速率却相差如此之大?
如何提高传输速率?我正在使用 undertow 作为我的网络层,我应该做些什么来调整 undertow 吗? Here 是我创建 undertow 网络层的代码
处理的请求数量相同,但响应在内容和 HTTP 中都不同 headers。因此流量也有差异。
我正在对用 SpringBoot 编写的简单 helloworld app written in my framework against the one 进行基准测试。
SpringBoot版本的ab日志:
luog~$ ab -n 100000 -c 20 http://localhost:8080/hello?name=rythm
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
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)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: localhost
Server Port: 8080
Document Path: /hello?name=rythm
Document Length: 155 bytes
Concurrency Level: 20
Time taken for tests: 6.733 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 32100000 bytes
HTML transferred: 15500000 bytes
Requests per second: 14851.38 [#/sec] (mean)
Time per request: 1.347 [ms] (mean)
Time per request: 0.067 [ms] (mean, across all concurrent requests)
Transfer rate: 4655.56 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 0 1 0.7 1 15
Waiting: 0 1 0.7 1 15
Total: 0 1 0.7 1 15
Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 2
80% 2
90% 2
95% 2
98% 3
99% 4
100% 15 (longest request)
ActFramework 的 ab 日志:
luog~$ ab -n 100000 -c 20 http://localhost:5460/?who=rythm
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
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)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software:
Server Hostname: localhost
Server Port: 5460
Document Path: /?who=rythm
Document Length: 111 bytes
Concurrency Level: 20
Time taken for tests: 6.796 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 18600000 bytes
HTML transferred: 11100000 bytes
Requests per second: 14714.64 [#/sec] (mean)
Time per request: 1.359 [ms] (mean)
Time per request: 0.068 [ms] (mean, across all concurrent requests)
Transfer rate: 2672.78 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 0 1 1.2 1 9
Waiting: 0 1 1.2 1 9
Total: 0 1 1.2 1 9
Percentage of the requests served within a certain time (ms)
50% 1
66% 2
75% 2
80% 3
90% 3
95% 3
98% 4
99% 4
100% 9 (longest request)
正如我们所见,每秒的事务处理量几乎相同。但是传输速率非常不同。 SpringBoot版本超过4.5Kb/s,Act版本只有2.7Kb/s
我不知道
为什么响应时间几乎相同,而传输速率却相差如此之大?
如何提高传输速率?我正在使用 undertow 作为我的网络层,我应该做些什么来调整 undertow 吗? Here 是我创建 undertow 网络层的代码
处理的请求数量相同,但响应在内容和 HTTP 中都不同 headers。因此流量也有差异。