Search code examples
azure-service-fabric

in Azure service fabric is there a way to limit memory usage of micro service


We came across a situation where one of the microservice had memory issues and consumed all the memory in one of the vms in the cluster. This in turn affected all other microservics.

Is there a way to set a limit on how much memory the microservice can occupy?

These are all stateless microservices.


Solution

  • Check out Resource Governance Policies. You specify them in ApplicationManifest. You can set MemoryInMB or MemoryReservationInMB for example. According to the documentation the first one is rather "harsh" limit and the second one is "soft" limit. Not sure exactly what it means. (I assume if the first one reaches the limit the exception will be thrown). I recommend to play with these two and see if this will satisfy your needs.