NewSingleHostReverseProxy慢10倍

时间:2016-10-17 14:54:19

标签: go

我有这个非常简单的RP演示here,看起来比它应该慢。

以下是在RP上制作的ab结果

ab -q -k -n 20000 -c 100 http://localhost:8080/home
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
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:            8080

Document Path:          /home
Document Length:        0 bytes

Concurrency Level:      100
Time taken for tests:   4.842 seconds
Complete requests:      20000
Failed requests:        0
Keep-Alive requests:    0
Total transferred:      4360000 bytes
HTML transferred:       0 bytes
Requests per second:    4130.48 [#/sec] (mean)
Time per request:       24.210 [ms] (mean)
Time per request:       0.242 [ms] (mean, across all concurrent requests)
Transfer rate:          879.34 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.9      0      10
Processing:     1   24   9.5     22      90
Waiting:        1   23   9.4     22      90
Total:          1   24   9.5     23      90
WARNING: The median and mean for the initial connection time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%     23
  66%     26
  75%     29
  80%     31
  90%     36
  95%     42
  98%     49
  99%     54
 100%     90 (longest request)

当我对后端进行性能测试时,它可以做到40k qps。

我觉得RP可能会更快,但我不确定它是如何以及为什么显示当前的结果。

谢谢!

0 个答案:

没有答案