Linux App Service (B1) moved to a new worker every 1–2 days after a daily memory spike

Colin McAllister 0 Reputation points
2026-11-20T18:29:18.3966667+00:00

One B1 Linux plan in Canada Central runs two .NET 8 sites (built-in image), one instance, with Always On enabled.

Since October 24 the plan has moved to a new worker 19 times; host names change in the LinuxContainerRecycle detector. Each move causes 5 to 22 minutes of downtime.

Before each move, plan memory jumps from about 77% to 95–99%. Both sites are idle at the time, steady at 110–160 MB each. The worker then stops reporting metrics for 2 to 5 minutes, and the sites start on a new worker.

The moves come about 25 hours apart, so the time drifts about one hour later each occurrence.

A second B1 Linux plan in the same region runs the same app as one site. It gets the same daily spike, peaking at 94–97%, and has stayed on one worker since November 15.

There are no Service Health notices and no changes from us in the activity log.

  1. What platform process causes the daily memory spike?
  2. Is the worker replaced because it crossed a memory or swap limit?
  3. Is there a supported way to prevent this on a single-instance B1 plan?
Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

1 answer

Sort by: Oldest
  1. AI answer

    2026-11-20T18:30:29.3766667+00:00

    The roughly 25-hour LinuxContainerRecycle cadence is consistent with App Service on Linux’s periodic platform recycle, but the available customer-visible telemetry cannot identify the specific system process behind the preceding memory spike or prove that a memory/swap threshold caused the worker replacement.^1^

    What the evidence supports

    • Daily spike: App Service runs platform processes for security updates, Kudu/SCM, monitoring, authentication, and other features. Their memory is included at plan level even when application activity is low.^2^ However, public diagnostics do not expose enough host-level process information to name which platform process produced this particular spike.
    • Worker change: During maintenance, App Service can replace an assigned worker with an updated worker. That produces a restart on a different machine without requiring a deployment or customer-initiated Activity Log event.^3^
    • Memory limit: A graph reaching 95–99% does not by itself prove enforcement of a hard memory or swap threshold. On Linux, high memory utilization alone is not equivalent to memory pressure; stronger indicators are low available memory, swapping, or an OOM-kill event.^4^ The documented “Percent Memory limit” recycle applies to 32-bit worker processes, whereas Linux App Service runs 64-bit by default, so it should not be applied to this case without that exact detector message.^5^
    • The second B1 plan surviving a similar spike also argues against treating the displayed percentage alone as a deterministic replacement threshold.

    The ordering remains important: because memory rises before the recorded move, it cannot safely be described as merely post-recycle warm-up. It could be platform work associated with the recycle, host memory pressure, or another worker-level event; only Microsoft’s internal host telemetry can distinguish those possibilities.

    Capture the next occurrence

    For each app, open Azure portal → App Service → Diagnose and solve problems and preserve results around the event from:

    1. Availability and Performance → Memory Usage
    2. Linux Swap Space Low
    3. Process List and Process Fill List
    4. Web App Restarted
    5. Search for Web App Slow, then inspect:
      • Worker Process Events
      • Instance Allocation Events
      • Platform Observations

    Those detectors are supported for Linux and can distinguish app-process growth, swap pressure, container recycling, VM failover, and update-domain movement.^6^^7^

    Record the following for escalation:

    • UTC start and end of the memory spike.
    • Old and new worker hostnames.
    • LinuxContainerRecycle and SiteStarted timestamps.
    • Plan-level memory and swap results.
    • Per-app/process memory immediately before the gap.
    • HTTP failure interval and startup/warm-up duration.
    • Whether the detector reports an allocation event, maintenance, OOM, or Auto-Heal action.

    Also inspect Diagnose and solve problems → Auto-Heal. Auto-Heal supports memory-based rules on Linux; if no rule is configured, do not enable one merely to address a platform worker move because it can add another restart.^8^

    Preventing the downtime

    There is no documented control on a multitenant B1 plan that pins the app to one worker, disables platform recycling, or selects its maintenance window. Maintenance timing control is limited to App Service Environment v3.^3^

    For supported availability mitigation:

    1. Scale out to at least two active instances.
    2. Add a lightweight endpoint that returns 200 only when startup dependencies are ready.
    3. Configure it under App Service → Health check.
    4. Set WEBSITE_WARMUP_PATH to an appropriate initialization endpoint if startup readiness is contributing to the 5–22 minute interruption.

    Health Check on one instance only monitors it; the load balancer cannot remove the sole unhealthy instance without taking the application down. Its traffic-rerouting benefit requires at least two active instances and sufficient plan capacity.^9^

    Because 5–22 minutes is substantially longer than a simple container restart, submit an Azure support case if the detectors do not identify the trigger. Include several exact UTC windows and request correlation of host memory/swap pressure, worker-reallocation reason, and platform process consumption. That internal telemetry is required to identify the process and determine whether memory pressure initiated the replacement.


    References

    1. FAQ - Azure App Service on Linux - Azure | Microsoft Learn
    2. Web apps performance, availability, and application issues for Azure App Service
    3. Routine maintenance for Azure App Service, restarts, and downtime
    4. Troubleshoot performance issues and isolate bottlenecks in Linux
    5. "Worker Process requested recycle due to 'Percent Memory' limit" message
    6. Diagnostics in Azure App Service
    7. Troubleshoot slow web app performance in Azure App Service
    8. Best practices for Azure App Service
    9. Monitor App Service instances by using Health check
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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