My container app is getting restarted on load requests

PU_A_MRAMAIA 0 Reputation points
2023-11-20T23:33:43.7866667+00:00

My container app is getting restarted on load requests which has one instance. When it uses more memory or cpu while running it get restarted with a new instance but the request get processed. I need a solution where it doesn't restart a new instance.

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
686 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Adam Zachary 2,936 Reputation points
    2023-11-22T03:40:39.4766667+00:00

    Hi,

    To prevent your container app from restarting on high CPU/memory load, ensure it is designed to handle shutdowns gracefully.

    Azure Container Apps support zero-downtime deployment when in single revision mode, which means they can handle automatic switches between revisions without downtime. However, since containers can restart regularly, you should not expect state to persist inside a container. Instead, use external caches for expensive in-memory cache requirements to avoid performance hits that might lead to restarts.

    Please note that proper application scaling settings and resource management can help to prevent unexpected restarts due to resource constraints​​​​.

    For a more tailored solution, you may need to adjust your container app's settings for scaling and resources or redesign the application's architecture to better manage resource utilization.

    Please review this Microsoft documentation for "Application lifecycle management in Azure Container Apps": https://learn.microsoft.com/en-us/azure/container-apps/application-lifecycle-management

    If you find the provided information helpful and it resolves your query, please consider accepting the answer. Your feedback is valuable and helps ensure the quality and relevance of the responses.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.