App Service disk usage on appsvctmp increases sharply with no way to clean up.

Rishi Maker 0 Reputation points
2025-02-11T21:03:30.62+00:00

We have two app services framez-api-prod and framez-api-dev. Occasionally both the services go completely down with error - "disk is full". Restart or re-install does not help.

The last such outage occurred on 2/1/2025 PST. Whenever such an outage occurs, the App service gets restored the next day automagically.

Since the last outage we have been monitoring the disk utilization of the container.

It is observed that /appsvctmp utilization has increased from being consistently 45GB (74%) utilization to 56GB at 93% utilization.

Disk utilzation on 2/3 - Size (63GB) Used (45GB) Available (16 GB)
Disk Utilization on 2/11 - Size (63GB) Used (56GB) Available (4.1 GB)

The issue is that I have no way to cleanup or find what is consuming /appsvctmp .
I have done a complete ls -alh and find on all files in this directory and I dont see any large files and overall utililzation from the mounted file system point of view is in order of few MBs.

Can you explain why my disk utilization has gone up .. The unix mount points are not sufficient to view what caused the spur and how can I clean up these temp files.

This is critical as we suspect that this will cause the next downtime

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

1 answer

Sort by: Most helpful
  1. Laxman Reddy Revuri 3,655 Reputation points Microsoft External Staff
    2025-02-11T23:58:32.6833333+00:00

    Hi @Rishi Maker
    Thanks for the question and using MS Q&A platform.
    apologize for any inconvenience caused on this.
    Azure App Services store temporary files in directories like D:\local\Temp, which can accumulate and consume space.

    Excessive or verbose logging can rapidly fill up disk space.

    If using containers, the images and any runtime-generated files also occupy temporary storage.

    Persistent application files stored in D:\home\site\wwwroot can contribute to high disk usage.

    Some files or directories may not be visible using standard commands.

    The reported disk usage may differ from the apparent file sizes due to system constraints.

     Kudu may not always display a complete view of disk utilization.

    Access Kudu: Navigate to https://yoursite.scm.azurewebsites.net/.

    1. Check Environment Variables: Examine %TEMP% and %TMP% to identify temporary file locations.
    2. Browse the File System: Use the Kudu debug console to inspect large or unexpected files.

    Additional Diagnostic Tools

    Azure Portal "Diagnose and Solve Problems"

    Open your App Service on the Azure portal. Search for "Temp File Usage on Workers" to analyze temporary file consumption.

    Azure Web Apps Disk Usage Extension: Install and use this extension via the Kudu console to identify space-consuming applications.

     Use Kudu to delete unnecessary files from temporary directories.

    ·       This clears temporary storage but may disrupt active processes.

    ·       Implement scripts or scheduled tasks to periodically remove temporary files.

    ·       Reduce logging verbosity and enable log rotation to prevent excessive file growth.

    ·       Avoid writing large files to temporary directories. Instead, use /home.

    ·       Use a .dockerignore file to exclude unnecessary files from your container images.

    ·       If disk space issues persist, consider upgrading your App Service Plan for more storage.

    references:
    https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/temporary-storage-for-azure-app-service#how-to-troubleshoot-temporary-storage-on-azure-app-service

    https://puneet-gupta.github.io/puneetgupta/2017/06/06/azure-app-service-what-is-taking-my-disk-space-for-my-azure-web-app/

    https://feng.lu/2017/02/23/Review-and-manage-your-web-site-space-in-Azure/

    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.