Can I use load balancer for scaling Azure Service Fabric apps

前端 未结 1 429
别跟我提以往
别跟我提以往 2021-02-04 15:51

Recently came to know about Azure Service Fabric and seems a good way to develop scaling applications as bunch of micro services. Everywhere it is telling that we need to have s

相关标签:
1条回答
  • 2021-02-04 16:40

    Yes, you'll definitely want to distribute load across your stateless services as well. The key difference is that since they are stateless, they can handle requests in a round-robin fashion.

    Whereas stateful services have partitions, which map to individual chunks of the service's state, stateless services simply have instances, which are identical clones of each other, just on different nodes. You can set the number of instances in on the default service definition in the application manifest. For instance, this declaration will ensure that there are always 5 instances of your stateless service running in the cluster:

    <Service Name="Stateless1">
       <StatelessService ServiceTypeName="Stateless1Type" InstanceCount="5">
         <SingletonPartition />
       </StatelessService>
    </Service>
    

    You can also set the InstanceCount to -1, in which case Service Fabric will create an instance of your stateless service on each node.

    The Azure load-balancer will round-robin your incoming traffic across each of your instances. Unfortunately, there isn't a good way to simulate this in a one-box environment right now.

    0 讨论(0)
提交回复
热议问题