开发者社区> 问答> 正文

ECS 内无法提高 CPU 运行负载能力

如题,我在做压测的时候,发现无论如何都提高不了 ECS 的 cpu 运行负载。每次 cpu 占用率都只在 5%左右,而我在本地压测时候, cpu 占用率都能达到快 100%。是 ECS 对 CPU 有保护措施吗?
另: 本人的 ECS 规格为 1 vCPU,2G RAM,1M 带宽。服务器应用用 docker 下的 openresty 开发,openresty 内没有对客户端请求做限制。

展开
收起
langll 2018-10-25 15:17:29 2472 0
4 条回答
写回答
取消 提交回答
  • 擅长互联网移动开发。。。
    ReECS 内无法提高 CPU 运行负载能力
    如果是突发性能实例是有CPU限制的,而且是用积分制的。
    2018-11-08 19:58:29
    赞同 展开评论 打赏
  • 旺旺:nectar2。
    回 5楼(langll) 的帖子
    楼主您好,

    感谢更新帖子内容,且说明了具体的原因喔。

    是否可以直接在服务器本地访问测试,得出CPU使用值呢?
    2018-10-31 18:35:19
    赞同 展开评论 打赏
  • 回 1楼云上珠玑的帖子
    刚看了一下,我的实例规则组是 n4,共享计算型实例。。这个有什么影响吗

    -------------------------

    回 3楼云上珠玑的帖子
    用的 apache benchemark 压测的,测试过程见下面。其中,ip 地址被我打码了。我分别测得 apache2.4 和 openresty1.13,他们提供同样的页面的。

    ### 压测 apache  c10 n300
    ➜ ~ ab -c 10 -n 300 http://101.xx.xx.xx:84/
    This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    Benchmarking 101.xx.xx.xx (be patient)
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Finished 300 requests
    Server Software: Apache/2.4.18
    Server Hostname: 101.xx.xx.xx
    Server Port: 84
    Document Path: /
    Document Length: 6184 bytes
    Concurrency Level: 10
    Time taken for tests: 15.848 seconds
    Complete requests: 300
    Failed requests: 0
    Total transferred: 1912800 bytes
    HTML transferred: 1855200 bytes
    Requests per second: 18.93 [#/sec] (mean)
    Time per request: 528.282 [ms] (mean)
    Time per request: 52.828 [ms] (mean, across all concurrent requests)
    Transfer rate: 117.86 [Kbytes/sec] received
    Connection Times (ms)
    min mean[+/-sd] median max
    Connect: 10 16 58.9 12 1032
    Processing: 16 438 1125.1 128 13828
    Waiting: 15 152 581.2 51 7172
    Total: 28 454 1126.5 143 13843
    Percentage of the requests served within a certain time (ms)
    50% 143
    66% 322
    75% 377
    80% 561
    90% 816
    95% 1381
    98% 3294
    99% 7235
    100% 13843 (longest request)


    ### 压测 openresty c10 n300
    ➜ ~ ab -c 10 -n 300 http://101.xx.xx.xx:8001/
    This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    Benchmarking 101.xx.xx.xx (be patient)
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Finished 300 requests
    Server Software: openresty
    Server Hostname: 101.xx.xx.xx
    Server Port: 8001
    Document Path: /
    Document Length: 6776 bytes
    Concurrency Level: 10
    Time taken for tests: 15.974 seconds
    Complete requests: 300
    Failed requests: 0
    Total transferred: 2106900 bytes
    HTML transferred: 2032800 bytes
    Requests per second: 18.78 [#/sec] (mean)
    Time per request: 532.472 [ms] (mean)
    Time per request: 53.247 [ms] (mean, across all concurrent requests)
    Transfer rate: 128.80 [Kbytes/sec] received
    Connection Times (ms)
    min mean[+/-sd] median max
    Connect: 11 51 172.3 15 1064
    Processing: 12 460 536.2 294 3384
    Waiting: 11 148 316.7 42 3358
    Total: 24 510 554.3 324 3398
    Percentage of the requests served within a certain time (ms)
    50% 324
    66% 512
    75% 771
    80% 961
    90% 1249
    95% 1655
    98% 2163
    99% 2268
    100% 3398 (longest request)


    整个压测过程中,cpu 使用率就没超过 5% ...

    -------------------------

    回 4楼langll的帖子
    找到原因了,原来是达到网络瓶颈了。。。毕竟只有 1Mb 的带宽
    2018-10-25 17:16:57
    赞同 展开评论 打赏
  • 后端开发者,阿里云用户
    回 楼主(langll) 的帖子

    您好,您的ECS实例规则族是什么?

    突发性能实例T5么?

    -------------------------

    回 2楼(langll) 的帖子
    是怎么测压的呢?

    有日志么?
    2018-10-25 15:23:14
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS快储存加密技术 立即下载