Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

More than one instance of stateless service per node

My stateless service receives tasks from Service Bus queue and processes it. I'm trying now to find an optimal way to use resources of Service Fabric node as much as possible. So I see 2 approaches: 1) create several threads inside the service 2) create several instances of the service per node. I consider that the 2nd way is more safe and correct but when I specified InstanceCount = 5 for 1-node cluster I received a warning.

Config.xml

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="fabric:/EmailSenderApp" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters>
    <Parameter Name="MainService_InstanceCount" Value="1" />
    ...
  </Parameters>
</Application>

Error:

Unhealthy event: SourceId='System.FM', Property='State', HealthState='Warning', ConsiderWarningAsError=false.
Partition is below target replica or instance count.
fabric:/EmailSenderApp/EmailSenderMainService 5 1 09916a6b-1701-46ce-a281-0e223a68f980
Ready _Node_0 131708550454646056
(Showing 1 out of 1 instances. Total available instances: 1)
like image 723
Yuriy Gavrishov Avatar asked Sep 06 '25 02:09

Yuriy Gavrishov


1 Answers

Currently is not possible do have more than one primary partition on same node.

SF has placement constraints to block this, My opinion is that it is a bug, b because there is no concern on loosing state on stateless service, for this reason I've opened a GitHub issue to Allow singleton stateless services to have multiple instances per node bypassing placement constraint

To sort this issue, I guide you to this answer with options for solving a similar problem:

Simulate 10,000 Azure IoT Hub Device connections from Azure Service Fabric cluster

like image 122
Diego Mendes Avatar answered Sep 07 '25 22:09

Diego Mendes