How to fix low disk space in Web App

SUSHI 0 Reputation points
2024-06-18T22:44:06.44+00:00

Can you please tell me, I have Azure Service App (Linux plan) Premium v3 P0V3.

In the plan description it says that they give 250G.

I have 1 Web App in this plan with 2 slots (prod/stage), running Web App Single Container from ACR. When I SSH into the Web App and see df -h

root@aidwn24nad2:/var/log# df -h
Filesystem Size Used Avail Use% Mounted on
overlay 49G 43G 3.8G 92% /
tmpfs 64M 0 64M 0% /dev
tmpfs 2.2G 0 2.2G 0% /sys/fs/cgroup
shm 62M 8.0K 62M 1% /dev/shm
/dev/sda3 63G 13G 47G 22% /var/ssl
/dev/sdb1 49G 43G 3.8G 92% /etc/hosts
devtmpfs 4.0M 0 4.0M 0% /dev/tty
tmpfs 2.2G 0 2.2G 0% /proc/acpi
tmpfs 2.2G 0 2.2G 0% /proc/scsi
tmpfs 2.2G 0 2.2G 0% /sys/firmware
If anything the image weighs about 1.5-2G.

Please tell me where to find what takes up most of the space. If I use ncdu/df -h on / it shows 2-3G occupied. As I understood these 250G are distributed somewhere else, but I did not understand how.

In general, if anyone knows how to clear or how this space works in general, could you give me a hint, please? I'm so confused...

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,174 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vlad Costa 615 Reputation points
    2024-06-18T23:15:02.8566667+00:00

    Hi Sushi,

    The Azure Service App (Linux plan) Premium v3 P0V3 provides 250GB of storage. However, this storage is not entirely allocated to your container's file system. It’s used by the underlying infrastructure and services that run your Web App, including the operating system, logs, temp files, etc.

    When you SSH into your Web App and run df -h, you’re seeing the file system of your Docker container, not the entire allocated storage. The overlay filesystem you’re seeing is the writable layer of your Docker container, and its size is not directly related to the storage provided by your App Service Plan.

    To find what’s taking up most of the space, you might also need to look into other directories. The command du -sh /* can be used to check the disk usage of all directories at the root level. This command can take a while to run on directories with many files.

    If you’re looking to clear up space, you might want to consider the following:

    • Logs: Ensure that your application does not generate excessive logs. Over time, these can consume a significant amount of space.
    • Temp files: Some applications create temporary files that are not always cleaned up properly. Check your temp directories and clean them up if necessary.
    • Old or unused files: Files can accumulate in your storage over time. Check for and remove any files that are no longer needed regularly.

    Remember, it’s important to understand what files you delete when cleaning up space. Removing the wrong files can cause your application to stop working.

    If you find this response helpful and it resolves your issue, please consider marking it as “Accepted” or giving it an upvote. This will help others in the community find the solution more easily.

    0 comments No comments