Explaining slow performance resolving artifacts

When you request maven-metadata.xml files from a group repository, Nexus 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 will always look for these files. In proxy repositories this can be quite expensive, since Nexus needs to go remote. To prevent poor performance Nexus 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 which 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:

 https://books.sonatype.com/nexus-book/reference/confignx-sect-managing-routes.html

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

If using Nexus Professional is an option you can solve this problem very effectively by setting up smart proxy communication between the two instances. See here for an explanation of this:

http://www.sonatype.com/people/2012/02/nexus-pro-2-0-support-distributed-teams-with-smart-proxy/

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk