I have a small Discourse instance on a server with 25GB of space. Presently it only has 3.4 GB free, and I’m not sure why. This is preventing me from running updates.
There are no services running on this instance besides Discourse, nor have there ever been
So far to free up space I’ve:
deleted every log I could find both from Discourse and from /var/log/journal
deleted all but one of my Discourse backups
pruned all old docker images
ran apt-get autoclean and apt-get autoremove
ensured I didn’t have old kernals
I considered moving my postgres data to an external drive, but it’s less then a GB right now so I don’t think that will help enough.
/dev/vda1 is using 20 GB of space.
Is there anything else I can do? Is 25GB no longer a reasonable amount of disc space to run Discourse on?
It depends on mostly your uploads but also backups and postgres if your site is very large (which it sounds like is not the problem). How large are your uploads? The admin dashboard should say at the bottom.
It’s less then 50MB, this isn’t a big or old instance at all. As I mentioned, I considered moving it off the main drive but I don’t think that’s the major issue here.
If your uploads are ~25MB and your postgres is ~1GB I would suspect that Discourse is making backups you don’t need. I would check your backup retention settings (Admin > Settings > Backups) and look at your current backups (Admin > Backups) and delete any you don’t need.
Nevermind. Would help if I remembered you already cleared them.
You can check what’s using the space in the common places:
du -sh /shared/*
du -sh /var/www/discourse/*
du -sh /var/www/discourse/public/*
The biggest use of space in the file system are /var/lib/containerd/io.containerd.content.v1.content at 2.4 GB and /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs at a whooping 12 GB
Sorry, forgot to mention you needed to be in the container. The file you mentioned is from Docker. You can check what it’s being used by with docker system df and do a global prune with docker system prune if required, just make sure Discourse is running when you do so.
In the container, the only thing is larger then a GB is /var/www/discourse/vendor/bundle/ruby/ at 2.1 GB
I will add if I prune the image the update pulls, I have enough space, but when I attempt to update and it pulls it again, I lose it. So almost 5GB of space is the new image.
Indeed, please show all your outputs. I wouldn’t recommend looking around inside the container - your problem is at system level, and that’s where to start looking. And don’t look where you think there might be a problem, but look at the whole picture.
First, reboot. You want a clean filesystem and a fresh system.
Next, see this previous thread for detailed advice:
my forum is a small forum (really mostly just me) and I use a VPS with 40gb just to be safe and not have to worry about updates causing heart ache
It is the only one out of my 3 VPSs that I don’t use 20gb - the others are an http server with MySQL and PHP back end and an rtmp server. The one running discourse also runs docker-mailserver but I have digest mail turned off and dms has a tiny footprint
Thank you for your responses! Sorry for vanishing, life came up and I didn’t have time yesterday to do more troubleshooting.
The TLDR is I noticed how many threads there are on this exact problem and figured that even if I resolve it this time it will come up again, so I moved my instance to a slightly larger server with 35GB of space on it.
For anyone looking here for help with this exact issue who doesn’t want to upgrade:
./launcher cleanup was something I had already tried, it didn’t clear up enough space. I had also already done
And again, it wasn’t enough. There was a lot (for a 25GB machine) of logs in journalctl, so absolutely check if that’s true for you, but for me it didn’t help enough.