Load banacing between two instances of Function App

Man 51 Reputation points
2022-09-08T12:44:47.343+00:00

I have a function app that's successfully running fine. However I am trying to set rules to create a new instance when CPU usage is above 90%. In such case, how does load balancing works between two instances?

Is there any inbuilt options for this or should I use any other application to handle load balancing effectively?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. David Broggy 6,291 Reputation points MVP Volunteer Moderator
    2022-09-08T16:27:04.903+00:00

    Hi Man-2022
    Have you considered using a probe for this?

    "HTTP / HTTPS probes can be useful to implement your own logic to remove instances from load balancer if the probe port is also the listener for the service. For example, you might decide to remove an instance if it's above 90% CPU and return a non-200 HTTP status."

    load-balancer-custom-probe-overview


  2. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-09-12T07:33:20.19+00:00

    Hi @Man ,

    Thanks for reaching out to Q&A forum.

    It appears that you are trying to set up autoscale rules based on CPU utilization metrics. Usually the requests are routed to instances based on round robin method. In your case, when the Function app is running on one instance and CPU utilization is more than 90%, then a new instance gets added. Initially, the requests will be routed to the new instance as the previous instance is exhausted. Basically, the load balancing is handled by the Function app infrastructure and there is no need to configure load balancing exclusively.

    Hope this helps! Feel free to reach out to me if you have any questions or concerns.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.