Can I use load balancer for scaling Azure Service Fabric apps

最后都变了- 提交于 2019-12-03 00:18:34

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!