我有一个应用服务计划,按以下方式扩展:
- 范围:2-20 个实例
- CPU > 20%:扩展到 20 个实例
- CPU < 15%:扩展到 2 个实例
随着时间的推移,我看到的实际实例数如下:
- 20 个实例
- (CPU ~ 0%)
- 缩减到 2 个实例
- (负载开始:CPU > 50%)
- 最多 20 个实例(约 5 分钟)
- (加载完成:CPU ~ 0%)
- 最多 15 个实例(约 5 分钟)
- 最多 12 个实例(约 5 分钟)
- 最多 5 个实例(约 5 分钟)
- 最多 2 个实例(约 5 分钟)
如何使其立即扩展到 2 个实例,而无需额外的步骤?
此外,有时,从 2 个实例扩展到 20 个实例会失败,并且 2 个实例仍处于巨大负载状态。是否可以告诉 azure 扩展到尽可能多的实例,而不是在巨大负载期间为用户留下 2 个实例?
更新:添加比例设置 JSON。
更新:添加比例设置屏幕截图。
{
"id": "...",
"name": "...",
"type": "Microsoft.Insights/autoscaleSettings",
"location": "westus",
"tags": {
"$type": "...",
"...": "Resource"
},
"properties": {
"profiles": [
{
"name": "Default",
"capacity": {
"minimum": "2",
"maximum": "20",
"default": "2"
},
"rules": [
{
"metricTrigger": {
"metricName": "CpuPercentage",
"metricNamespace": "",
"metricResourceUri": "...",
"timeGrain": "PT1M",
"statistic": "Average",
"timeWindow": "PT5M",
"timeAggregation": "Maximum",
"operator": "GreaterThan",
"threshold": 20
},
"scaleAction": {
"direction": "Increase",
"type": "ExactCount",
"value": "20",
"cooldown": "PT1M"
}
},
{
"metricTrigger": {
"metricName": "CpuPercentage",
"metricNamespace": "",
"metricResourceUri": "...",
"timeGrain": "PT1M",
"statistic": "Average",
"timeWindow": "PT5M",
"timeAggregation": "Average",
"operator": "LessThan",
"threshold": 15
},
"scaleAction": {
"direction": "Decrease",
"type": "ExactCount",
"value": "2",
"cooldown": "PT1M"
}
}
]
}
],
"enabled": true,
"name": "...",
"targetResourceUri": "...",
"notifications": [
{
"operation": "Scale",
"email": {
"sendToSubscriptionAdministrator": false,
"sendToSubscriptionCoAdministrators": false,
"customEmails": [
"..."
]
},
"webhooks": null
}
]
}