Search code examples
nexus3

nexus3 size used by repositories does not match database size on disk


I'm analyzing the disk usage of our nexus3 instance. I used this question and answers to get the disk space used by all repositories:

cd /opt/nexus
java -jar ./lib/support/nexus-orient-console.jar
> CONNECT PLOCAL:/opt/sonatype-work/nexus3/db/component admin admin
> select bucket.repository_name as repository,sum(size) as bytes from asset group by bucket.repository_name order by bytes desc;

Then by summing all results I get approximately 200GiB. When I move around on the disk however, I get a disk usage of 378BiB:

> du -sh /opt/sonatype-work/nexus3/blobs
378G     blobs/

Where does this difference come from? Is this normal, or are there some manipulations I could or should do to clean this up?


Solution

  • apparently artifacts are not removed from disk when deleted in the interface. Therefor one needs to run the Compact Blob Store task. After running this task, my disk usage is 180G.