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

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.

4 Likes

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.

2 Likes

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

https://github.com/discourse/discourse_docker/blob/master/samples/standalone.yml#L77-L79

1 Like

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.

6 Likes

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

1 Like