即使 Auto Scaling 后 CPU 利用率下降,负载测试期间的响应时间也太长
场景如下:
我在 Amazon EC2 Linux 实例上以负载均衡模式运行 Java/Spring 应用程序,最初有 3 台服务器,可以根据需要向上或向下扩展。
扩展标准:当 CPU 利用率超过 30% 并持续超过 10 分钟时,再添加 2 台服务器。
缩减标准:当 CPU 利用率下降到 15% 以下并持续超过 10 分钟时,删除一台服务器。
加载(使用 blazemeter.com):增加编号。用户数量在大约 15 分钟内从 0 稳步增加到 50,并从此保持不变。
响应:
- 前15分钟,负载增加到每秒50次,并在接下来的5分钟内保持稳定。 CPU 利用率保持在 30% 左右。此阶段的响应时间低于 20ms。
- 虽然负载为每秒 50 次点击,但在开始后大约 20 分钟时,CPU 利用率在 10 多分钟内飙升至 33% 左右,从而触发了升级。响应时间急剧增加,在 5000ms 至 15000ms 之间波动。
- 现在增加了 2 个服务器(服务器数量现在为 5),CPU 利用率回到 20%,但响应时间没有显示出缩短的迹象。在剩下的测试期间,它仍然保持在 5000ms 到 15000ms 之间,直到负载被移除。
我的问题是,为什么当 CPU 利用率恢复正常(大约 20% 利用率)时,响应时间没有降至正常(大约 20 毫秒)?
CPU利用率图表
响应时间图表
感谢您的宝贵时间:)
Here's the scenario:
I'm running my Java/Spring app on Amazon EC2 Linux instance in load balancing mode with 3 servers up initially, that can scale up or down as required.
Scale up criteria: When CPU Utilization goes above 30% for more than 10 mins, add 2 more servers.
Scale down criteria: When CPU Utilization decreases to below 15% for more than 10 minutes, remove one server.
Loading (with blazemeter.com): Increase the no. of users steadily from 0 to 50 in around 15 minutes, and remain constant from there onwards.
Response:
- In the first 15 minutes, the load increased to 50 hits/second, and remained steady for another 5 minutes. CPU Utilization remains at around 30%. Response time is below 20ms in this phase.
- While the load was at 50 hits/second, at around 20 mins from start, CPU utilization spiked to around 33% for more than 10 mins thereby triggering step up. Response time increases dramatically to fluctuate between 5000ms to 15000ms.
- With 2 additional servers now (server count now 5), CPU utilization goes back to 20%, but response time shows no sign of receding. It still remains between 5000ms to 15000ms for the rest of the testing period till the load was removed.
My question is, why do you think the response time didn't come down to normal (around 20ms) when the CPU utilization was back to normal (around 20% utilization)?
CPU Utilization chart
Response time chart
Thanks for your time :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论