Explaining slow performance resolving artifacts in Nexus Repository 2

Visit my.sonatype.com for documentation on Nexus Repository version 2.

When you request maven-metadata.xml files from a group repository, Nexus Repository 2 needs to traverse all of the contained repositories. This is because the same GA or GAV may exist in multiple repositories. And if it does, all of the metadata files must be merged together.

In hosted repositories, this is a cheap operation, so Nexus Repository 2 will always look for these files. In proxy repositories, this can be quite expensive, since Nexus Repository 2 needs to go remote. To prevent poor performance Nexus Repository 2 caches previous responses. How long it caches these is determined by two settings:

Metadata Max Age: How often to look for updates
Item Not Found TTL: How often to check for files that were not previously found.

Both of these default to 24 hours.

If you lower these timeouts you will receive more frequent updates, but at the expense of performance. Adding good routing rules can help considerably with this.

However, there are cases where the only reasonable value for these is zero. Typically, these will be proxy repositories whose remotes contain snapshots. In this case, there isn't really a good way to solve this problem using Nexus Repository 2 OSS edition.

If using Nexus Repository 2 Professional is an option you can solve this problem very effectively by setting up smart proxy communication between the two instances. 


Have more questions? Submit a request


Article is closed for comments.