Usage metrics counts are much higher than blob counts - Sonatype Nexus Repository - Sonatype Community
Usage metrics counts are much higher than blob counts
post by Maximilian_Raab on Mar 12, 2025
Hello, I am running a Nexus OSS v3.78.1-02 installation. Since last week, I’ve been getting a banner saying that my instance is getting too big, and I need to add a licence or reduce the number of artefacts.
I have decided in favour of the latter. I was able to delete many artefacts (most of them from a NuGet.org proxy). However, the usage metrics are not reduced.
My blob stores are actually small, and if I roughly check the number of *.bytes files on the hard disc, then both the displayed sizes and the quantity are correct.
I have deleted all the old files using clean-up policies, and I have also been working for several days, but the statistics remain the same.
These are my tasks. From my point of view, I have taken all the relevant steps from the documentation.
I don’t understand where all the artefacts come from that are counted. It would be nice if someone could give me an explanation or solution to the problem.
Yours sincerely,
Max
post by jboss-04 on Mar 12, 2025
Did you try to reindex the repositories? I would try that if I were you. A lot of information gets taken from the index.
post by jzora on Mar 12, 2025
Hi, Max,
All the advice we have about managing/reducing usage is in our documentation:
Based off your explanation, the issue may be that you haven’t run the compact blob store task. Cleanup policies only soft-delete components. The compact blob store task is necessary to fully remove them. I’d start there.
Also note that usage metrics update hourly, not immediately, so there’s a delay between removing components and seeing that reflected in your usage metrics.
post by Maximilian_Raab on Mar 12, 2025
Hey, thanks for the answers.
I have re-indexed all NuGet repos. I also ran these Compact Blob Stores jobs and they run automatically every night. To show this I have attached the extra screenshot.
I am aware that the statistics only update every hour. However, it has not moved significantly since last Thursday.
From my point of view, the data on the hard disk is correct and matches the information in the blob stores - see pictures.
post by Maximilian_Raab on Mar 14, 2025
Hello again,
what else can I do? Any recommendations other than the given ones?
In the meantime, we’ve created a script which consults the Nexus API to list all artifacts in all versions. This script also confirms, that we do not hit the artifacts limit.
Can I trigger a VACUUM or clean-up for the database?
post by glee on Mar 14, 2025
Hi Max,
Thanks for bringing this to our awareness. Have you tried restarting your Nexus repository instance?
post by Maximilian_Raab on Mar 14, 2025
Hi Grace,
yes multiple times. We are shutting down the instance every night to backup the blobs-directory to prevent file access during this time.
post by glee on Mar 19, 2025
Hi Max,
Our team has looked into this. This is not a counting issue, but a database corruption issue. Our recommendation is to delete and re-create your NuGet proxy repositories to fix the data corruption issues found in your database. Hope this helps!
Best regards,
Grace
post by Maximilian_Raab on Mar 20, 2025
Hi Grace,
deleting and recreating did indeed fix this issue. The banner is also gone now.
Thanks a lot!
Kind regards,
Max.