Yum hosted repository time to update repository



Since we migrate from Nexus 2 to Nexus 3, the time between an rpm upload and a client download has increased. For example, between the upload of an RPM in a yum hosted repo and the moment it becomes available (yum install on a client) is around 5s to 10s… How can we improve this duration ?



For your specific example, by default NXRM3 rebuilds the yum metadata 60 seconds after the last successful upload to the hosted repository.
We do have a system property that causes this to occur at a defined interval but I am curious to your use case. If you are expecting 5-10 second turnaround, it is unlikely this property will help you because it actually takes time for the metadata to rebuild, especially if you are pushing a large number of components at once.
Similarly curious what pains this is causing you. You have a CI that’s pushing and 5 seconds later requesting what was just pushed?


Yes we have a CI that upload and then deploy immediately the software to our customers around the world. Is it possible to change this property ?


It is. Configure nexus.yum.createrepo.interval in the nexus.properties file (in $data-dir) setting it equal to a time in milliseconds.
Again I caution you from setting it too low, this could cause performance issues. If you notice any dips in performance this is probably the first thing you should revert and see if it improves.

You can monitor your nexus.log (or could even look now to determine if this’ll help) by looking for regenerate statements like:
INFO [event- 11 -thread- 10 ] admin org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoFacetImpl - Rebuilding yum metadata for repository yum-hosted

You’ll need to wait for them to complete before things are available for your CI. You’ll also (obviously?) need to wait for them to kickoff=)

Hope that helps,