Advertisement
Guest User

Rules And Services configuration

a guest
May 31st, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.35 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8" ?>
  2.     <serviceModel xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/serviceModel">
  3.       <subscriptions>
  4.         <subscription name="KWEB.Azure.SubscriptionName"
  5.                      certificateThumbprint="XXXXE0F7XXXX88AC933F3EADE369FC5C91B7XXXX"
  6.                      subscriptionId="bc42XXXX-8b31-XXXX-a6af-743107e3XXXX"
  7.                      certificateStoreLocation="CurrentUser"
  8.                      certificateStoreName="My">
  9.           <services>
  10.             <service dnsPrefix="kwebstage" slot="Production">
  11.               <roles>
  12.                 <role alias="AutoscalingApplicationRole"
  13.                      roleName="KWEB.Website"
  14.                      wadStorageAccountName="targetstorage"/>
  15.               </roles>
  16.             </service>
  17.           </services>
  18.           <storageAccounts>
  19.             <storageAccount alias="targetstorage"
  20.              connectionString="DefaultEndpointsProtocol=https;AccountName=storageStageAccountName;AccountKey=XXXXXXXXXXXXXXXXXXXXXXXXXX==">
  21.             </storageAccount>
  22.           </storageAccounts>
  23.         </subscription>
  24.       </subscriptions>
  25.     </serviceModel>
  26.  
  27.  
  28.     <?xml version="1.0" encoding="utf-8" ?>
  29.     <rules xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/rules">
  30.       <constraintRules>
  31.         <rule name="default" enabled="true" rank="1" description="The default constraint rule">
  32.           <actions>
  33.             <range min="1" max="6" target="AutoscalingApplicationRole"/>
  34.           </actions>
  35.         </rule>
  36.       </constraintRules>
  37.       <reactiveRules>
  38.         <rule name="ScaleUpOnHighUtilization" rank="10" description="Scale up the web role" enabled="true" >
  39.           <!--The reactive rule named ScaleUpOnHighUtilization increments the instance count of the target role
  40.          by one if the average CPU utilization over the last five minutes has been greater than or equal to 60%.-->
  41.           <when>
  42.             <any>
  43.               <greaterOrEqual operand="WebRoleA_CPU_Avg_5m" than="60"/>
  44.             </any>
  45.           </when>
  46.           <actions>
  47.             <scale target="AutoscalingApplicationRole" by="1"/>
  48.           </actions>
  49.         </rule>
  50.         <rule name="ScaleDownOnLowUtilization" rank="10" description="Scale up the web role" enabled="true" >
  51.           <!--The reactive rule named ScaleDownOnLowUtilization decrements the instance count of the target role
  52.          by one if the average CPU utilization over the last five minutes has been less than 60%.-->
  53.           <when>
  54.             <all>          
  55.               <less operand="WebRoleA_CPU_Avg_5m" than="60"/>
  56.             </all>
  57.           </when>
  58.           <actions>
  59.             <scale target="AutoscalingApplicationRole" by="-1"/>
  60.           </actions>
  61.         </rule>
  62.       </reactiveRules>
  63.       <operands>
  64.         <!--Both reactive rules use an operand named WebRoleA_CPU_Avg_5m that calculates the average CPU usage over
  65.        the last five minutes for a Windows Azure role named AutoscalingApplicationRole.
  66.        This role is defined in the service model-->
  67.         <performanceCounter alias="WebRoleA_CPU_Avg_5m"
  68.          performanceCounterName="\Processor(_Total)\% Processor Time"
  69.          source ="AutoscalingApplicationRole"
  70.          timespan="00:05:00" aggregate="Average"/>
  71.       </operands>
  72.     </rules>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement