MDGSF Software Engineer

[测试] ab 测试

2019-02-21

测试不同语言 hello world 的性能。

ab -c10 -n50000 http://localhost:8000/

openresty


Server Software:        openresty/1.13.6.2
Server Hostname:        localhost
Server Port:            8080

Document Path:          /
Document Length:        20 bytes

Concurrency Level:      10
Time taken for tests:   1.759 seconds
Complete requests:      50000
Failed requests:        0
Total transferred:      8400000 bytes
HTML transferred:       1000000 bytes
Requests per second:    28431.00 [#/sec] (mean)
Time per request:       0.352 [ms] (mean)
Time per request:       0.035 [ms] (mean, across all concurrent requests)
Transfer rate:          4664.46 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       2
Processing:     0    0   0.1      0       2
Waiting:        0    0   0.0      0       2
Total:          0    0   0.1      0       2

Percentage of the requests served within a certain time (ms)
  50%      0
  66%      0
  75%      0
  80%      0
  90%      0
  95%      0
  98%      1
  99%      1
 100%      2 (longest request)

golang


Server Software:
Server Hostname:        localhost
Server Port:            8000

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      10
Time taken for tests:   2.168 seconds
Complete requests:      50000
Failed requests:        0
Total transferred:      6450000 bytes
HTML transferred:       600000 bytes
Requests per second:    23066.21 [#/sec] (mean)
Time per request:       0.434 [ms] (mean)
Time per request:       0.043 [ms] (mean, across all concurrent requests)
Transfer rate:          2905.80 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:     0    0   0.0      0       2
Waiting:        0    0   0.0      0       2
Total:          0    0   0.1      0       2

Percentage of the requests served within a certain time (ms)
  50%      0
  66%      0
  75%      0
  80%      0
  90%      0
  95%      1
  98%      1
  99%      1
 100%      2 (longest request)

nginx + golang

Server Software:        openresty/1.13.6.2
Server Hostname:        localhost
Server Port:            8080

Document Path:          /server1
Document Length:        12 bytes

Concurrency Level:      10
Time taken for tests:   3.867 seconds
Complete requests:      50000
Failed requests:        0
Total transferred:      8800000 bytes
HTML transferred:       600000 bytes
Requests per second:    12930.01 [#/sec] (mean)
Time per request:       0.773 [ms] (mean)
Time per request:       0.077 [ms] (mean, across all concurrent requests)
Transfer rate:          2222.35 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     0    1   0.1      1       2
Waiting:        0    1   0.1      1       2
Total:          0    1   0.1      1       2

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      1
  80%      1
  90%      1
  95%      1
  98%      1
  99%      1
 100%      2 (longest request)

python


Server Software:        Werkzeug/0.14.1
Server Hostname:        localhost
Server Port:            5000

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      10
Time taken for tests:   35.822 seconds
Complete requests:      50000
Failed requests:        0
Total transferred:      8300000 bytes
HTML transferred:       600000 bytes
Requests per second:    1395.79 [#/sec] (mean)
Time per request:       7.164 [ms] (mean)
Time per request:       0.716 [ms] (mean, across all concurrent requests)
Transfer rate:          226.27 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     2    7   1.8      7      19
Waiting:        1    7   1.7      6      17
Total:          2    7   1.9      7      19

Percentage of the requests served within a certain time (ms)
  50%      7
  66%      8
  75%      8
  80%      9
  90%     10
  95%     11
  98%     12
  99%     12
 100%     19 (longest request)


weixingongzhonghao

下一篇 [Linux] ss 命令

Comments

Content