Search code examples
node.jsazurecrashhealth-check

Why is my Azure node.js app becoming unresponsive?


I recently deployed a Node.js Backend Service to Azure and have the following problem. The service becomes unresponsive after a certain amount of time, and only comes back to life if a external request is sent. The problem is, that it takes about 3 minutes for the Container to start back up and actually return the request. I'm running Node 14 LTS. I also added a health check yesterday, but azure simply doesn't bother actually keeping the app alive, here is the metric off azureenter image description here

I verified azure is actually trying to reach the correct endpoint, and it does. I also have "Always On" enabled. I also verified that the app itself, is not crashing. I log every request and all of a sudden requests are no longer received, which means the health endpoint doesn't respond either, but it does not result in a container restart. It just waits for an external request to appear and then decides to start everything back up, which takes too long.

I feel like it's some kind of configuration issue, because the app itself is not very complex and I never experienced crashes when doing local development.


Solution

  • The official document tells us that the Free pricing tier you are currently using, Always on does not take effect.

    How do I decrease the response time for the first request after idle time?

    pic