App Service Linux restarted due to low swap space

Personaify 10 Reputation points
2023-07-14T19:54:46.2133333+00:00

Hi,

I'm running into a problem where my Linux app service is being restarted in the middle of running through its work queue. From the diagnostic tool, it says due to LowSwapSpace.

Here's the swap space chart, he uptick at the end is after it got restarted.

User's image

Here's the memory usage, looks fine:

User's image

Disk space usage is also fine:

User's image

The app service is running a docker container that contains my python app. This is the only app running on the App Service Plan and I'm on a B2 instance which should have 3.5gb of ram and 10gb of disk space. Which should be plenty.

How do I resolve this?

  1. How do I increase the swap space available to the VM?

It doesn't seem like scaling up would resolve this issue?

Thanks!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,964 questions
{count} vote

2 answers

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 15,491 Reputation points MVP Volunteer Moderator
    2023-07-15T08:58:00.2066667+00:00

    Hello @Personaify

    Thanks for posting in Q & A forum.Please verify that recycling events are occurring as a result of memory auto-healing in EventLog.xml.

    Thanks for posting in Q & A forum.Please verify that recycling events are occurring as a result of memory auto-healing in EventLog.xml.

    Thanks for posting in Q & A forum.Please verify that recycling events are occurring as a result of memory auto-healing in EventLog.xml.

    With auto healing, the worker process that is hosting your web application can be recycled automatically. When that occurs, an event will also be recorded in the eventlog.xml file. (found in Logfiles folder of your web root directory).

    Please turn on Always On from Azure Portal if it's not already.Select Configuration>Select General settings>For Always On, select On.Screenshot 2023-07-15 164121

    Fetch more details about the issue in app service diagnostics



  2. TP 125.8K Reputation points Volunteer Moderator
    2023-07-17T14:16:00.4033333+00:00

    Hi,

    Please test with B3 instance to see if the issue is resolved. With default container B3 has 4 GiB swap space and 7 GiB RAM as compared to 2 GiB swap space and 3.5 GiB RAM with B2 instance.

    Are you using custom container for your app? If yes, how did you create it?

    Please click Accept Answer if the above was useful.

    Thanks.

    -TP


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.