0

I have a system that uses stateless services hosted in Service Fabric

This is running in a local dev cluster with 5 nodes

Some of my services have InstanceCount set to -1

I was expecting to see multiple instances of the host executables to show in task manager but I only see 1

This is making me think there is only 1 instance

Am I doing something wrong?

Paul

Paul
  • 2,773
  • 7
  • 41
  • 96
  • Your problem is unclear to me. There is no such thing as a stateless cluster. I Suppose you mean you have a service fabric application with at least one stateless service? If so than that is correct, there will be just one instance of your application. On each node there should be one instance of the stateless service defined in the app. What does the cluster Service Fabric Explorer tell you? – Peter Bons Apr 06 '18 at 14:28
  • Sorry I mean that I have 5 stateless services. The service fabric application has 5 nodes I was therefore expecting that as the instancecount is -1 I would see 5 occurrences of the application in task manager but I only see 1 – Paul Apr 06 '18 at 14:37
  • If you have 5 nodes (which means, 5 machines) I would expect to see 1 instance per node / machine. The Windows Task manager shows only the instances for one machine, did you check Task Manager on all machines? The Service Fabric Explorer should tell you the number of instances. – Peter Bons Apr 06 '18 at 14:41
  • I am looking at the development cluster with 5 nodes so does that mean that there are not actually 5 instances? – Paul Apr 06 '18 at 14:43
  • What does your Service Fabric Cluster says? You should open that dashboard, expand "Nodes" tree and see there if there is an instance of your service per node. – Francesco Bonizzi Apr 06 '18 at 15:51
  • My services are spread across the nodes. There is only 1 instance of each service running – Paul Apr 06 '18 at 17:32

1 Answers1

1

There is not enough information to determine what the actual problem here is, but based on your description I might suspect of two possible reasons:

  1. There is an error activating your services: If SF shows in the explorer that your service has any error or warnings, the problem might be because it couldn't start more than one instance of that service on the same node, this is common to happen if you have for example two apis\sites listining on the same port, this is very common to happen on local dev clusters where all the nodes are setup on same machine, but for SF they seems like a different node.

  2. Your services are sharing the same process: On SF, when you run multiple replicas(stateless instances) of same package on same node they will usually share the same process by default, it could be the case of your service being sharing the same process, but is hard to say, as you didn't provide much information on how your services are defined.

As stated at the beginning, it is just a guess, because you didn't provide much information about your service structure we can't tell exactly what is going on behind the scenes and these are the most probable reasons.

Diego Mendes
  • 10,631
  • 2
  • 32
  • 36