noobCoder
noobCoder

Reputation: 389

Node Azure Function Performance Improvements

I have built a azure function that interacts with an external API. This external API is rate limited to 350 requests per second. When I'm running my code locally I'm able to make and consume 10,000 async requests within 60 seconds.

When I deploy my code to my function app and test it. The function takes over 5 minutes to process the same amount of requests. Is there a reason as to why my function run time would increase by 5 times without any code changes?

I'm currently using the consumption plan.

Upvotes: 0

Views: 115

Answers (1)

Bjorne
Bjorne

Reputation: 1484

Azure Functions consumption plan has a outbound connection limit of 600 active 1200 passive per instance. You should be able to see Host thresholds exceeded: Connections in the logs if you are exceeding this. If this is the case it is very likely that the root cause is that you are not reusing the HttpClient for C# or equivalents for other languages.

Upvotes: 2

Related Questions