ApplicationManifest documentation isn't very helpful.
What is "MetricB"?
I found out that LoadMetrics is within ServiceTypes->StatelessServiceType, but where is ServiceScalingPolicies?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for the feedback! We are currently investigating and will update you shortly.
Great thanks
As per what is MetricB it is just the name of the metric you setting up the autoscale policy for. This could be CPU, Memory, etc. MetricB was just used as an example. I believe in this example it is actually a custom metric:
ServiceScalingProperties should be under the application manifest
https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-resource-manager-autoscaling#setting-auto-scaling-policy
OK but where excactly in appManifest? Because on the root level it doesnt work.
E.g. Load Metrics is under ServiceTypes.StatelessServiceType.
I don't believe these settings are enabled by default. Rather you need to build them into your code if you want to utilize the autoscaling feature.
@masnider @dkkapur would either of you be able to confirm?
I guess PartitionInstanceCountScaleMechanism is valid in C#, but not in the ApplicationManifest.xml.
Hi,
@josere You are correct, there is a discrepancy between C# and XML in this case. Documentation will be fixed. Thanks for pointing this out.
@senj Here is a complete example of application manifest with auto scaling turned on:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="DemoType" ApplicationTypeVersion="1.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="DemoServicePackage" ServiceManifestVersion="1.0.0.0" />
</ServiceManifestImport>
<DefaultServices>
<Service Name="DemoService">
<StatelessService ServiceTypeName="Demo" InstanceCount="2">
<SingletonPartition />
<LoadMetrics>
<LoadMetric Name="MyMetricName" Weight="High" DefaultLoad="75"/>
</LoadMetrics>
<ServiceScalingPolicies>
<ScalingPolicy>
<AveragePartitionLoadScalingTrigger MetricName="MyMetricName" LowerLoadThreshold="65" UpperLoadThreshold="90" ScaleIntervalInSeconds="100"/>
<InstanceCountScalingMechanism MinInstanceCount="1" MaxInstanceCount="4" ScaleIncrement="1"/>
</ScalingPolicy>
</ServiceScalingPolicies>
</StatelessService>
</Service>
</DefaultServices>
</ApplicationManifest>
This will create a default service that reports metric called "MyMetricName", and that scales based on it.
Great thank you
@MicahMcKittrick-MSFT
Most helpful comment
Hi,
@josere You are correct, there is a discrepancy between C# and XML in this case. Documentation will be fixed. Thanks for pointing this out.
@senj Here is a complete example of application manifest with auto scaling turned on:
This will create a default service that reports metric called "MyMetricName", and that scales based on it.