The following forum(s) have migrated to Microsoft Q&A (Preview): Azure Service Fabric!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

How to dynamically scale a reliable service? RRS feed

  • Question

  •  I understand partitioning, but what I'm interested in here is how to dynamically scale a named service.

    I know I can go in to ApplicationManifest.xml and add another service name of the same service type, but that's not really dynamic.

    While my application type is running, how would I increase the number of certain named service type?



    Saturday, December 10, 2016 1:02 AM


All replies

  • Sunday, December 11, 2016 2:00 PM
  • Frank, thanks for the reply, but this is not really what I was asking.

    If I am running an app in SF and my service type name is mysvc1, I have a particular endpoint, partitioning etc. What I want to know is, programmatically, how do I create a new service, give it the name 'mysvc2' of the same service type that mysvc1 is?

    Increasing the number of nodes in a VM Scale set does not increase the number of services I have, it only allows me more places to put services and replicas.



    Sunday, December 11, 2016 3:22 PM
  • You do not need to create a 'mysvc2' service that is identical to 'mysvc1'. Use AutoScale feature in ScaleSets.

    'To give you an example, say you start with a 5-node cluster and a service that is configured to have 10 partitions and a target of three replicas. In this case, Service Fabric would balance and distribute the replicas across the cluster--and you would end up with two primary replicas per node. If you now need to scale out the cluster to 10 nodes, Service Fabric would rebalance the primary replicas across all 10 nodes. Likewise, if you scaled back to 5 nodes, Service Fabric would rebalance all the replicas across the 5 nodes.'


    Sunday, December 11, 2016 8:51 PM
  • Yes, I understand all that, but given the case above, you are not increasing the number of partitions and therefore, you are not really scaling out a service. Scaling out a service would require adding more partitions, which you can't do at run time OR creating another named instance of the same service type. That is what I am asking about.

    Adding more nodes does not solve the issue I am asking about.

    I want to know how to dynamically, programmatically, create a new instance of a named service type that is of the same type that is already running.



    Sunday, December 11, 2016 9:00 PM
  • If partitions are spreaded out to more nodes, in effect the service is scaling out.


    Monday, December 12, 2016 2:05 PM
  • Are you looking for System.Fabric.FabricClient.ServiceManagementClient
    public Task CreateServiceAsync(ServiceDescription description)


    Monday, December 12, 2016 6:12 PM