1

I have implemented autoscaling using the Enterpise Library Autoscaling Block, pretty much as described in the tutorial.

So the first time when I am running load test for my site it's increasing the instance count by one.

And when I am running load again then CPU usage is 100% but it's not increasing the instance count. And when CPU usage is 0% it's not decreasing the instance count.

So what is wrong here?

I have following Rules and Service XML. Rules XML:

<?xml version="1.0" encoding="utf-8" ?>
<rules xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/rules">
  <constraintRules>
    <rule name="default" enabled="true" rank="1"
        description="The default constraint rule">
      <actions>
        <range min="2" max="5" target="ServiceWebRole"/>
      </actions>
    </rule>
  </constraintRules>
  <reactiveRules>
     <rule name="ScaleUpOnHighUtilization" rank="10"
         description="Scale up the web role" enabled="true">
       <when>
         <any>
           <greaterOrEqual operand="WebRoleA_CPU_Avg_5m" than="60"/>
         </any>
       </when>
       <actions>
         <scale target="ServiceWebRole" by="1"/>
       </actions>
     </rule>
     <rule name="ScaleDownOnLowUtilization" rank="11"
         description="Scale up the web role" enabled="true">
       <when>
         <all>
           <less operand="WebRoleA_CPU_Avg_5m" than="40"/>
         </all>
       </when>
       <actions>
         <scale target="ServiceWebRole" by="-1"/>
       </actions>
     </rule>
   </reactiveRules>
   <operands>
     <performanceCounter alias="WebRoleA_CPU_Avg_5m"
        performanceCounterName="\Processor(_Total)\% Processor Time"
        source="ServiceWebRole" timespan="00:05:00" aggregate="Average"/>
   </operands>
</rules>

Service XML:

<?xml version="1.0" encoding="utf-8" ?>
<serviceModel
     xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/serviceModel">
  <subscriptions>
    <subscription name="My subscription name"
        certificateThumbprint="My subscription certificateThumbprint"
        subscriptionId="My subscriptionId"
        certificateStoreLocation="LocalMachine" certificateStoreName="My">
      <services>
        <service dnsPrefix="productionservice" slot="Production" scalingMode="Scale">
          <roles>
            <role alias="ServiceWebRole" roleName="ServiceWebRole"
                 wadStorageAccountName="targetstorage"/>
          </roles>
        </service>
      </services>
      <storageAccounts>
         <storageAccount alias="targetstorage"
            connectionString="DefaultEndpointsProtocol=https;AccountName=autoscale;AccountKey=storageaccountkey">
         </storageAccount>
       </storageAccounts>
     </subscription>
  </subscriptions>
</serviceModel>
sharptooth
  • 167,383
  • 100
  • 513
  • 979
Dalvir Saini
  • 380
  • 2
  • 11
  • 30
  • The rules you specify say to average the CPU load over 5 minutes. Is the load really higher than the threshold long enough so the the average is high enough to trigger the rule? – sharptooth May 15 '13 at 07:30

0 Answers0