Expiring Cache on a rubygems proxy repository can cause Nexus to make a single HEAD and GET request for every gem and dependency gem referenced by a single request listing gems to /api/v1/dependencies?gems=<list-of-gems>.
Before the Expire cache task is run, Nexus will not do this. Instead it passes the request to the remote as received.
- request /api/v1/dependencies?gems=foo,bar
- Nexus passes this single request as is, to any remote repository it is proxying
- Expire Cache on the Nexus repository
- sending the same request to Nexus causes Nexus to send both a HEAD and a GET as follows:
For long lists of gems, the many additional outbound requests can lead to a significant drop in response time as compared to when the single request is passed through to the remote 'as is'.
I've attached a jmeter test one can use the reproduce the issue. The attachment also contains a nexus log, conf directory, and csv format of performance data before and after expiring cache.
The key log lines in the attached nexus.log are as follows:
As you can see, it takes 3m47s for the first run, the second run takes 6m33 seconds for the same set of 20 requests repeated 10 times.