Can I use load balancer for scaling Azure Service Fabric apps

只愿长相守 提交于 2019-12-20 10:45:39

问题


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 stateless front end web services and stateful partitioned internal services. The internal services scale by partitioning the data.

But what happens to the front end services in load? .The chances are very less as they are doing nothing but relying to internal stateful services. Still should we use load balancer before front end services? If so, can we host the same too via Service Fabric's Stateless model using OWIN or any other web host?

The question is asked already in SO but as comment. It didnt get reply as the original question was different. Azure Service Fabric usage


回答1:


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.



来源:https://stackoverflow.com/questions/31598366/can-i-use-load-balancer-for-scaling-azure-service-fabric-apps

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