Azure App Service timing out in 230 seconds.

Viraj Vaitha 0 Reputation points
2023-02-05T09:54:34.1866667+00:00

Hi,

I have a web service (Azure App Service) for the backend of my web application. The heaviest task requires use of GPU, and since Azure don't offer serverless GPU the cost is simply to high. For this reason, I have an API that sends the video data to the serverless GPU company to process our workloads, and we only pay for what we use (this is amazing and works GREAT!)

Unfortunately, Azure App Service (compute/VM) is unable to wait more than 230 seconds for the response. I don't want to switch to AKS, because it has quite a steep learning curve, and the costs are unpredictable. I created one for 2 days and got charged 20£, without even making any requests.

Please can someone suggest how I can extend the App Service wait time, or an alternative service?

Thanks,

Viraj

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,879 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ajkuma 22,401 Reputation points Microsoft Employee
    2023-02-06T19:00:39.8666667+00:00

    @Viraj Vaitha ,

    If you haven’t done this already, you can extend the App Service wait time by using the Always On feature. This feature keeps your app running continuously by pinging your app at regular intervals.

     If the Always On setting is off, please enable it from Azure Portal **
    – Your WebApp > Configuration blade (> General settings).**

     

    To add more background, SSE uses long-polling requests, it may hit the 230s limit. Azure Load Balancer has a default idle timeout setting of four minutes (~230 secs). If your web app requires background processing, it is recommended to use Azure WebJobs or Azure Functions.

    • WebJobs is a feature of Azure App Service that enables you to run a program or script in the same instance as a web app. There is no additional cost to use WebJobs.
    • Alternatively, if your requirement fits, you may use Azure Functions to process your workloads. Azure Functions provides another way to run programs and scripts.
    • Additionally, you only pay for the time your code runs, and you can scale up or down based on demand. Azure Functions also has a lower learning curve compared to AKS.

    For a comparison between WebJobs and Functions, see Choose between Flow, Logic Apps, Functions, and WebJobs

    See -Why does my request time out after 230 seconds?

    0 comments No comments

  2. Viraj Vaitha 0 Reputation points
    2023-02-07T09:54:42.09+00:00

    Hi,

    Would you class this as a 'background task'.

    Users upload a video on our website. The video is sent via an API deployed via App Service.

    1. Users upload video on FE -> sent to Azure App Service Compute where my code processes it -> uploads to Azure Blob Storage.

    Videos can be up to 1 hour long, therefore the total processing time can be much longer than a typical HTTP request.

    Is WebJobs suitable for this, I really don't understand the documentation for Azure Web Jobs, my code is written in Python, and needs to be deployed via web jobs now?

    Thanks,

    Viraj