Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/var/lib/docker/overlay2 -> Disk full #271

Open
Martiix opened this issue Oct 3, 2023 · 6 comments
Open

/var/lib/docker/overlay2 -> Disk full #271

Martiix opened this issue Oct 3, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@Martiix
Copy link

Martiix commented Oct 3, 2023

Description
We recently started using docuum on a few hosts and are seeing that the hosts quickly run out of disk space. We have set the docker usage limit to 500GB as we are hoping to keep some cached images. However, our main problem seems to be with the /var/lib/docker/overlay2 folder which seems to grow out of hand. When I ran docker system prune -a -f on a host, a ton was cleaned(a lot more than 500GB). So the question is, does docuum also clean up /var/lib/docker/overlay2 and is the content considered part of the threashold? The host has a 2TB disk which contains 357GB of other stuff, and the remaining was removed by running docker system prune -a -f.

Instructions to reproduce the bug

Environment information:

  • Docuum version: v21.0
  • Docker version: 24.0.5, build 24.0.5-0ubuntu1~22.04.1
  • OS: Ubuntu:22.04
  • Service command: /usr/bin/docuum --threshold "500 GB" --deletion-chunk-size 100

Additional context
Add any other context about the problem here.

@Martiix Martiix added the bug Something isn't working label Oct 3, 2023
@stepchowfun
Copy link
Owner

Hello, thanks for asking this question. Docuum only cleans up images. My understanding is that /var/lib/docker/overlay2 is used for containers, not images. So my expectation is that this directory is not touched by Docuum or counted against the storage limit.

Perhaps you can check to see if your machines have old containers lying around (e.g., with docker container ls --all)? If so, you can hopefully fix your issue with a cron job to clean them up (or perhaps just start them with docker run --rm in the first place). If the problem doesn't seem to be leftover containers, it could be a bug in Docker.

Unfortunately this does not seem related to Docuum in any way, so I will have to close this issue. But feel free to share an update in this thread in case it's helpful for anyone else! In the future, I think it could be nice for Docuum to clean up containers, volumes, etc. (contributions welcome)—but for now it only cleans up images.

@stepchowfun
Copy link
Owner

I think I may have spoke too soon. I saw some articles online saying conflicting things about what /var/lib/docker/overlay2 is used for, and now I'm less sure. I'll re-open this issue for now. I should mention that Docuum just runs Docker commands like docker image rm ... and doesn't directly touch the filesystem, so any effect on /var/lib/docker/overlay2 would be indirectly through Docker.

One thing that might be worth looking into is which Docker builder you are using (e.g., buildx?). Docker might be using that directory for the build cache.

@stepchowfun stepchowfun reopened this Oct 3, 2023
@stepchowfun
Copy link
Owner

I think docker system df should reveal what is using up all that space (containers, volumes, images, or build cache). Can you tun that command on one of the machines that is running out of disk to find out?

@Martiix
Copy link
Author

Martiix commented Oct 3, 2023

This can then maybe be a feature request instead of a bug. Would be nice to have one good way to clean up everything :) Thanks for investigating. We will go back to our old ways of cleaning up docker for now, but docuum does seem very intersting and promising!

@RMPR
Copy link

RMPR commented Oct 3, 2023

How much effort would it be to implement that, do you think? Can you point me to relevant parts of the code I can look at and need to potentially modify if needed?

@stepchowfun
Copy link
Owner

Hi @RMPR, if we just want Docuum to run Docker's built-in pruning commands on a schedule, it would not be that much work (just start a new thread from main). If we want it to do something smarter (like LRU), I imagine it could be a lot more work.

@stepchowfun stepchowfun added enhancement New feature or request and removed bug Something isn't working labels Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants