Azure ConstraintRules无法正常工作

时间:2012-11-30 11:20:00

标签: c# asp.net azure autoscaling

我正在部署一个非常简单的Azure云服务。

尝试让Autoscaling正常工作,这样我就可以根据时间安排扩展/缩小。

安装和配置所有内容,部署到Azure时没有任何问题,但我的规则似乎没有得到遵守。

目前我有以下内容,我希望服务至少运行2个实例,但始终保持为1。

<rules xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/rules" enabled="true">
  <constraintRules>
    <rule name="Default" description="Default rules" enabled="true" rank="1">
      <actions>
        <range min="2" max="8" target="MyRoleName"/>
      </actions>
    </rule>
  </constraintRules>
</rules>

感觉我错过了一些非常简单但又不确定的东西?

谢谢

2 个答案:

答案 0 :(得分:1)

来自我的Wasabi经验的AFAIR - 没有时间表的约束规则根本不会由服务运行 - 它们没有专门的触发条件。其目的是限制最大和最小实例数 - 因此,响应规则将无法过度配置(这可能导致高于计划的开支)和服务实例配置不足(这可能会导致Azure SLA要求违反)。

我认为您应该read this article关于为您的服务设置基于计划的自动缩放的正确方法。 简而言之 - 您需要时间表部分供您统治。这样的事情(来自上述链接的无耻撕裂)

<rules xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/rules" enabled="true">
  <constraintRules>
    <rule name="Default" description="General Limitation" enabled="true" rank="1">
      <actions>
        <range min="2" max="8" target="MyRoleName"/>
      </actions>
    </rule>

    <rule name="Peak" description="Active at peak times" enabled="true" rank="100">
      <actions>
        <range min="4" max="4" target="MyRoleName"/>
      </actions>
      <timetable startTime="08:00:00" duration="02:00:00">
        <daily/>
      </timetable>
    </rule>
  </constraintRules>
</rules>

答案 1 :(得分:0)

您在哪里托管Autoscaling应用程序块?您是否只在问题中添加了设置文件?我的答案是,并非如此简单。 添加辅助角色并在那里实施Autoscaling应用程序块来处理您的Web角色。

旧问题/答案:您可以将您完成的步骤与以下指南进行比较 http://blogs.msdn.com/b/golive/archive/2012/04/26/auto-scaling-azure-with-wasabi-from-the-ground-up.aspx 这个很好: http://www.windowsazure.com/en-us/develop/net/how-to-guides/autoscaling/

如果没有进一步的信息,很难弄清楚你的设置不正确。