Is it normal for /var/lib and /var/log to each take over 5G space?

AI-generated summary

The user snakeninny is concerned about the large disk usage of /var/lib and /var/log, each exceeding 5GB, after a Discourse update. The discussion clarifies that /var/lib/docker/aufs contains the Docker image’s filesystem, which is normal. The /var/log/nginx logs, which are part of the Discourse setup, are stored in /var/discourse/shared/standalone/log/var-log on the host, and their size depends on traffic. Falco explains the log rotation, while mpalmer notes that the logs are not standard and may be from another service. Falco confirms the log mounting setup, and mpalmer clarifies that the logs are within the Discourse directory, suggesting another site may be responsible for the high log volume.

After running:

cd /var/discourse
git pull
./launcher rebuild app

ncdu returns:

ncdu 1.10 ~ Use the arrow keys to navigate, press ? for help                                                                                                                                                        
--- /var -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    7.8GiB [##########] /lib                                                                                                                                                                                        
    5.5GiB [######    ] /log
    3.4GiB [####      ] /discourse
  449.0MiB [          ] /cache
    8.7MiB [          ] /backups
   28.0KiB [          ] /spool
   24.0KiB [          ] /www
    8.0KiB [          ] /mail
    4.0KiB [          ] /tmp
e   4.0KiB [          ] /opt
e   4.0KiB [          ] /local
@   0.0  B [          ]  lock
@   0.0  B [          ]  run
ncdu 1.10 ~ Use the arrow keys to navigate, press ? for help                                                                                                                                                        
--- /var/lib/docker/aufs -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                        /..                                                                                                                                                                                         
    5.1GiB [##########] /diff
    1.8GiB [###       ] /mnt
   48.0KiB [          ] /layers
ncdu 1.10 ~ Use the arrow keys to navigate, press ? for help                                                                                                                                                        
--- /var/log/nginx -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                        /..
    4.5GiB [##########]  access.log.1                                                                                                                                                                               
  870.1MiB [#         ]  access.log.2.gz
   10.6MiB [          ]  error.log.1
    6.8MiB [          ]  error.log.4.gz
    5.7MiB [          ]  error.log.5.gz
    5.2MiB [          ]  error.log.8.gz
...

Seems to me that the diff and log are taking too much space. Is that normal?

/var/lib/docker/aufs holds the disk of your docker image, so yes, that is normal, there is an entire linux there.

/var/log/nginx hold every request that hits your forum, so it will be bigger the more access you have. However it rotates for you.

That’s /var/log/nginx on the host (I presume), that isn’t a standard setup, so it’s outside the scope of what we can offer suggestions on.

We are mounting nginx log to /var/log now:

That’s /var/log in the guest, and it gets mounted to /var/discourse/shared/standalone/log/var-log in the host, so the Discourse nginx logs are part of the 3.4GiB shown for /var/discourse. Some other site is on the machine that’s generating so many logs.

Oh, true, it’s the inverse :smile: