0
votes

I am using Azure Function app service plan to serve client requests. Reason for selecting Azure service plan is, requests are long-running and takes more than 10 minutes.

I am looking for implementing Azure architecture which will be cost-effective and perform better for a large number of requests.

Any suggestions on what Azure components I can use or what architecture I should follow.

1
What type of work is the function doing? What takes so long (>10 mins).Murray Foxcroft
It does the integration between two systems. It runs an hourly basis and check for any updated records in one system and copy those updates to another system. There could be 1000 or 2000 records to updated and that took a long time.Vaibhav Ghorpade
Following what Josh said in the answer below, there is a need for more and deeper knowledge of details to design a good architecture for your problem. Depending on different facts from that Azure Durable Functions might be an option.Sebastian Achatz

1 Answers

2
votes

More details and characteristics about the workload are really necessary to offer up any solid suggestions (e.g. is it memory, cpu intensive? Is it dependent on downstream resources etc). Depending on your workload Functions and\or App Services may not be a right fit.

At a high level consider if refactoring this 10 minute process is an option. Many times long running tasks are in actuality many smaller tasks that can be broken down so their individual execution times are reasonable and you can then make use of the scaling aspects of Serverless (Azure Functions). If this is the case but breaking it down is too complex to orchestrate consider using something like Durable Functions or Logic Apps to provide that orchestration for you.

Generally speaking if I have long running requests it typically means its async from a user perspective and latency isn't an issue so another option is to have an Http Trigger (API) on an Azure Function running on a consumption plan so it will scale as needed and that accepts the request and places it on a queue but the queue listener is on dedicated compute without time restrictions (e.g. Function on App Service Plan, Azure Container Instances, etc). Keep in mind you need to be careful about your queue length as you could get lots of requests in your queue but only limited resources to process them on your dedicated compute within an acceptable time frame.

At the end of the day though "cost effective" AND "performant" is often a tough ask (outside Serverless) and my suggestion is to refactor your workload if you can.