How to compact disk space for nexus blob repository

Reading Time: 1 minute


This post is about how to do periodic cleanup of Nexus blob repository.


Nexus is web application that manages repositories of artifacts. Artifact could be .jar or .zip archive, in my context this is .zip archive. Usual context is:

Create artifact


Get that artifact.

In Nexus configuration, I chose blog type repository storage.

The problem?

Disk space of host where Nexus was installed filled up very quickly. In our context, very quickly was one week for upload rate of one repo per day. What troubled me was the fact that we kept only two versions of artifact, current and previous one. However, space depleted at same rate.

The context

Working with great database  administrators, I learned that every database is actually a number of files. Files work with data chunks, which means that after record delete file becomes fragmented and there are parts of file that can not be used anymore for data storage. The notorious fragmentation problem! File needs to be defragmented.

Connecting that with my problem, I searched Nexus documentation for space issues and found compact feature!

The solution

Log in to nexus as admin, and select System/tasks.

Create compact blob for your repository, schedule job and you are done.

Observe your disk space with

df -kh

You can always run your task manually.

Also published on Medium.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Karlo Smid

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.