Reputation: 1247
I have a stateless service that is "micro" enough that I would like to run several of them per node that I have in my fabric cluster. This is especially true since it seems that one node is equivalent to one VM in the world of service fabric (except for the local development cluster). By default it seems that Service Fabric expects a maximum of one of each service to be running on a given node. If I set the InstanceCount to be greater than the number of available nodes, I will get a warning to the effect of there are not enough nodes available to fulfill to requested number of instances.
I can work around this by creating multiple named services of a given service type and set the InstanceCount individually for each named service. Is this the correct way to accomplish this or have I missed something obvious?
Upvotes: 3
Views: 2702
Reputation: 17530
Sounds like you just need more partitions of the service? Have you tried using a different partition schema, other than the default single partition for services.
It will run one of your .exe for each partition. Remember if they use any communication and listens on ports, you need to use one that can share the port or use multiply ports for each partition.
Upvotes: 4
Reputation: 9050
Yes, you need to create multiple instances (aka named services) of your stateless service type.
The word "instance" is overloaded for stateless services. For any kind of service (stateful or stateless), you can create one or more "instances" (aka "named service") of a service type. An instance of a stateful service gets a set of replicas, and an instance of a stateless service gets a set of "instances" (there's that terminology overload!). To put it another way, in both cases you get a set of things that belong to a service instance (named service) and will be distributed across nodes, never grouped on a single node. If you create another instance (named service) of a service type, that has its own set of things which can be grouped on the same nodes as another instance (named service), and in fact, instances (named services) of the same service type will even share the same host process (.EXE) when running on the same node.
Upvotes: 4