Troubleshooting slow maven-metadata.xml download speeds

When maven-metadata.xml files are downloaded through a group repository Nexus will periodically need to check all the repositories in the group for the requested file.  The reason for this is the same GA or GAV may exist in multiple repositories, and all of the maven-metadata.xml files must be merged from all potential locations to get the complete group level file.


How often Nexus does these checks is controlled by a few factors.

  1. For hosted repositories it will always check since this is a very cheap operation
  2. For proxy repositories this is controlled by two settings, "metadata max age" and "not found cache ttl".  The former controls how long to wait before checking for updates to files which have already been downloaded, the latter how long to wait to check and see if a file that wasn't there previously is now present. The default for both of these is 24 hours.


So the most likely cause of slow downloads for maven-metadata.xml files is that one of your proxy repositories has a very slow remote.  This problem will be compounded if either of the above two settings is set too low.

You can optimize the way Nexus searches through group repositories by adding routing rules.  Information about this can be found here:

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

Tip:  On Nexus 2.7.x and later go to "administration/logging" and add a DEBUG level logger for "remote.storage.outbound".  This will allow you to see the processing times of all outbound requests.  With this information you can see which proxy repository is causing the problem.

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk