skip to Main Content

I have three static web app services on Azure, each hosting a Svelte application. I am facing the same problem across all of these services. After a 10-15 minute pause in using the application, the first request takes between 6 and 12 seconds on average to complete. This delay only happens with the first request, and subsequent requests work well without any delays.
Application Insights shows operations for sk_render.

I am using the standard hosting plan for all services, and I also activated enterprise-grade edge for one application, but this did not change the situation.

screen from insights

2

Answers


    • The issue is caused by the "cold start" problem. This is common in serverless or auto-scaling environments like Azure Static Web Apps.
    • When the application is idle for a certain period, the infrastructure may scale down to save resources.
    • The first request after this idle period triggers the infrastructure to "wake up."
      This "wake-up" process can cause a delay in response time.
    Login or Signup to reply.
  1. I solved the problem by creating an Azure Logic App (as proposed by @phantom) that calls every 1 minute an endpoint.
    Every 3 minutes (default value for Recurrence) is not enough! Even then my app was hibernated from every 5 tot 15 minutes, but with 1 minute it seems to work!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search