Nexus Pro Performance

Hi all!
I noticed that my nexus pro repository instance at version 3.77.1-01 that I also use as a proxy to maven central, is too slow in resolving dependencies (I use maven) using the mirror instead of not using it (going directly to the download from maven central). To give an idea of ​​the times, the same module of which the command I launch is:

time mvn -B -U --fail-never dependency:go-offline -Dsilent=true (I only do dependency resolution):

Time results:

maven central: ~8 mintues
nexus pro: ~1.5 minutes

My nexus pro installation resides on ec2 amazon machine. I’m sure that the bottleneck is not the machines because from the statistics I have not noticed any cpu/ram or network bottlenecks (they are quite powerful machines). Furthermore, the machine from which I launch the command is within the same network of nexus host. From logs it seems that the transfer rate and also the speed with which the log flows are significantly lower than running without a mirror. I also double checked the nexus configuration, and:

  1. the maven central package retention is 1440 minutes
  2. the proxy repository is part of a group, but it is the first in the group list

Can you help me understand how to improve the performance so that I can have maven central-like performance but with my nexus pro?

Thanks

The first thing I would check is to make sure you have set the correct heap parameters for you the Nexus Repository JVM. By default it only uses 2.7GB which might be why you don’t see any high memory utilisation.

Example Maximum Memory Configurations

If maven central is the primary source you wish to pull from the I would recommend putting it to the top of the group list.

Did you check the performance directly towards the URL of the actual maven proxy on Nexus Repo manager (so not using the group repo)?

Maybe adding to this issue, for a proxy to reach similar performance as actual maven-central is almost impossible. To achieve that you can enable concurrency to download multiple files at once, this way you alleviate latency introduced when using a proxy on Nexus Repo. These maven options can greatly improve maven speed as it almost removes slowness introduced by latency introduced by downloading files one-by-one (with this multiple downloads are done at once): -Daether.dependencyCollector.impl=bf -Daether.dependencyCollector.bf.threads=10 -Daether.dependencyCollector.pool.artifact=hard -Daether.dependencyCollector.pool.dependency=hard
(be aware to investigate what each one means, as it is important to understand what you are doing!)

1 Like