azure-service-fabric

Azure Service Fabric - more than one service instance per node


I have Azure Service Fabric stateless service which doesn't use any endpoints. It takes message from queue, processing it and save results to db.

I want to deploy 10 instances on my 2 nodes. By default I have -1 instancecount - it means that there will be 2 instances for 2 nodes. I can specify instancecount as 1 or 2 and it will be OK, but I cannot set 10 instances, it gives me error.

So I decide to create another instance of my application type. Is it right solution? Is there more elegant way to do this?


Solution

  • There are a few ways you can currently choose from:

    1. Multiple Application instances (as you're doing). Multiple Applications hosting a service. Increases complexity, because instances must be managed.
    2. Multiple Services. One application, hosting multiple services. Same downside as #1.
    3. Multiple Partitions within a service (instead of one SingletonPartition). Downside of this, is that this number is 'fixed'. Changes require redeployment of the type with some downtime.
    4. Use multiple receivers inside one service. Probably a good option, because it gives the least overhead, as creating multiple processes (#1, 2 & 3) creates some overhead.

    (an important question is: do you really require multiple instances?)

    More info here.