微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

设置自动缩放策略评估

如何解决设置自动缩放策略评估

风险建模系统使用扩展计算系统,该系统根据计算系统的当前负载或利用率实施自动扩展策略。

系统从实例给定的多个计算实例开始。系统每秒轮询实例以查看该秒的平均利用率,并执行如下所示的缩放。一旦采取任何行动,系统将停止轮询 10 秒。在此期间,实例数没有变化。

平均利用率 > 60%:如果翻倍的值不超过 2 * 10^8,则将实例数翻倍。这是一个动作。如果实例数量超过此限制加倍,则不执行任何操作。

平均利用率

25%

将这个系统每秒的平均利用率值作为一个数组,确定时间范围结束时的实例数。

例如,系统以实例数 = 2 开始。平均利用率为averageUtil = [25,23,1,2,3,4,5,6,7,8,9,10,76,80] .

在第一秒,利用率为 25,因此不采取任何行动。

At the second second,averageUtil[1] = 23 < 25,so instances = 2 / 2 = 1. The next 10 seconds,averageUtil[2]..averageUtil[11],no polling is done.

在 averageUtil(12] = 76,76 > 60 时,实例数量翻了一番。没有更多的读数需要考虑,2 是最终答案。

Example 1:
Input: averageUtil=[1,80]
Output: 2
Explanation:
Here instance = 1 and averageUtil = [5,80]. At the 1st and 2nd seconds of the time period,no action will be taken,Even though the utilization is less than 25%,the number of instance is 1. During the 3rd second,the no of instance will be doubled to 2.

Constraints:
1 <= instances <= 10^5
1 <= n <= 10^5
1 <= averageUtil[i] <= 10

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。