【发布时间】:2020-04-22 19:08:01
【问题描述】:
我一直在从部署在 Google App Engine 上的 NodeJS 应用程序中提供静态文件,现在我已经设置了启用 CDN 的 Google Cloud 负载均衡器 (GCLB),并将我的静态文件移动到后端使用的云存储桶中。
整个过程运行良好,但问题是使用 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 UI 中显示为 0。
【问题讨论】:
标签: google-app-engine google-cloud-platform apachebench google-cdn