Google Cloud CDN,使用apache基准进行性能测试

时间:2020-01-04 14:47:30

标签: google-app-engine google-cloud-platform apachebench google-cdn

我一直在从部署在Google App Engine上的NodeJS应用程序提供静态文件,现在我已经设置了启用CDN的Google Cloud负载均衡器(GCLB),并将我的静态文件移动到了后端使用的云存储桶中。 / p>

整个过程运行良好,但是问题是,使用Apache Benchmark进行测试时性能并未提高。

测试1000个请求,并发级别为100:

Document Length:        748366 bytes

Concurrency Level:      100
Time taken for tests:   37.069 seconds
Complete requests:      1000
Failed requests:        1
   (Connect: 0, Receive: 0, Length: 1, Exceptions: 0)
Total transferred:      748686041 bytes
HTML transferred:       747940252 bytes
Requests per second:    26.98 [#/sec] (mean)
Time per request:       3706.873 [ms] (mean)
Time per request:       37.069 [ms] (mean, across all concurrent requests)
Transfer rate:          19723.87 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  446 748.1    261    9033
Processing:   397 2920 2407.1   2252   17769
Waiting:       31   85 109.7     56    1595
Total:        444 3366 2578.2   2665   18986

Percentage of the requests served within a certain time (ms)
  50%   2665
  66%   3702
  75%   4410
  80%   4937
  90%   6504
  95%   8125
  98%  10853
  99%  13447
 100%  18986 (longest request)

测试1000个请求,并发级别为10:

Document Length:        748366 bytes

Concurrency Level:      10
Time taken for tests:   35.386 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      749112083 bytes
HTML transferred:       748366000 bytes
Requests per second:    28.26 [#/sec] (mean)
Time per request:       353.863 [ms] (mean)
Time per request:       35.386 [ms] (mean, across all concurrent requests)
Transfer rate:          20673.37 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       20   74  96.3     41     757
Processing:    98  278 159.5    240    2165
Waiting:       30   59  67.0     49    1915
Total:        135  352 196.6    290    2201

Percentage of the requests served within a certain time (ms)
  50%    290
  66%    334
  75%    381
  80%    442
  90%    577
  95%    742
  98%    935
  99%   1152
 100%   2201 (longest request)

我不希望并发级别显着增加处理请求所花费的时间。也许我以某种方式误读了这些结果?

要注意的另一个(相关)问题是CDN缓存匹配在Google LB用户界面中显示为0。

1 个答案:

答案 0 :(得分:1)

听起来您的文件没有被缓存。 Cloud CDN仅缓存满足cloud.google.com/cdn/docs/caching#cacheability中列出的条件的响应。您可以使用cloud.google.com/cdn/docs/troubleshooting#responses-not-cached的故障排除步骤来确定特定问题。如果这样做没有帮助,那么我很乐意查看您是否共享特定的URL。

您可能已经知道,ab并不是评估CDN性能的最现实的方法,并且在碰到Cloud CDN本身的任何瓶颈之前,您都将遇到本地计算机的瓶颈。如果您确实使用ab,请确保指定-k选项。如果不这样做,则可能会用完临时端口。

相关问题