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

 locked
Azure service fabric actor for long running tasks RRS feed

  • Question

  •  am very new to Azure Service Fabric. From my research I am quite keen in utilizing it for a specific optimization problem scenario. However I do not find any detail information on MSDN to back my findings.

    My requirement is that I have a web API that gets an input and dumped to a database. This input is used to run an optimization algorithm which typically takes around 3-5 minutes. There may be multiple requests submitted by users which will need to be processed eventually.

    I currently think spawning up a new ASF reliable actors per optimization input is a good choise. However I am not clear on how ASF functions for such tasks that are long running and not instantaneous.

    Further I am in doubt how my resource utilization within the cluster will be. My end goal is to be able to submit at least a predefined amount of optimization algorithm actors or stateless services when required in parallel.

    Really appreciate your technical advice related to the concerns I have. Is it actors or stateless services that I should consider for this scenario.



    Thursday, December 22, 2016 10:53 AM

Answers

  • Actor don't prevent multiple from running on the same node. For that you're going to need reliable services (stateless or stateful), and you'll probably want to create them on the fly and then limit the number that run on a given node via node capacities and the Cluster Resource Manager. See here to get started with defining capacities and defining load for a given service.
    Tuesday, December 27, 2016 8:18 PM

All replies

  • Optimization is CPU intensive and in your case each one takes 3-5 minutes to run, so it doesn't make sense to run multiple jobs at the same time in one node, so actor is the better choice.

    Assume a 5-node cluster you can run 5 actors in each node that picks up the job from your database. If capacity is not enough you can increase # of nodes or use scale set.


    Frank

    Thursday, December 22, 2016 3:15 PM
  • Actor don't prevent multiple from running on the same node. For that you're going to need reliable services (stateless or stateful), and you'll probably want to create them on the fly and then limit the number that run on a given node via node capacities and the Cluster Resource Manager. See here to get started with defining capacities and defining load for a given service.
    Tuesday, December 27, 2016 8:18 PM