设置自动缩放策略评估

问题描述

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

系统从实例给定的多个计算实例开始。系统每秒轮询实例以查看该秒的平均利用率,并执行如下所示的缩放。一旦采取任何行动,系统将停止轮询 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 (将#修改为@)