Add cleaning mechanism for runners-cache-X machines
We've received today an alert:
Really low disk space left on /opt/gitlab on runners-cache-5.gitlab.com: 1.293%
after checking the machine it's indeed a 1% left, but this 1% is really big
root@runners-cache-5:/opt/gitlab# df -h /opt/gitlab
Filesystem Size Used Avail Use% Mounted on
/dev/md0 3.9T 3.6T 51G 99% /opt/gitlab
The usage is quite high:
It's ~667GB in last 30 days! Looking on what uses the space:
root@runners-cache-5:/opt/gitlab# du -hsc *
3.6T cache
81G registry
3.6T total
So the most of available space is used by cache.
I remember we had in the past a mechanism that was clearing the old data, but I can't find any. We should prepare a new one immediately. For cache it should be quite easy - remove files that were not used for more than N days (14?).
But I'm not quite sure how to handle registry data and if we should think about this while it's using only <100GB from a 3.9TB filesystem. @ayufan any suggestions?
