If you're experiencing NuGet (proxy ,hosted, group) repository performance problems in Nexus Repository 3 there are a few things you can check.
Configuration
Make sure your instance is meeting our system requirements outlined here:
Be sure to upgrade to the latest version, performance improvements have been made in newer versions.
Use NuGet v3 Protocol
If you are running Nexus Repository 3.25 or higher configure NuGet clients to retrieve components using the v3 version URL's, these are much more efficient than the old-style v2 URL's.
https://help.sonatype.com/en/grouping-nuget-repositories.html
Migrate to Postgres Database
The performance issue described in this article only occurs when OrientDb database is used in Nexus Repo 3. So the migration to a Postgres database is another way to resolve this:
https://help.sonatype.com/en/migrating-to-a-new-database.html
Excessive Memory Consumption in 3.23.0 and Higher
To better support package installation via Powershell we fixed an issue in 3.23.0 where multiple versions of the same package could be identified as the "latest" (NEXUS-20349).
That fix can cause increased memory consumption when old-style NuGet v2 URL's are used for package retrieval.
If you meet these conditions:
- are experiencing excessive memory use related to highly active NuGet V2 API requests
- are using Nexus Repository 3.23.0 and newer
- you can't switch to NuGet v3 for all repositories yet
- do not rely on proxying Powershell Gallery
You can disable the changes by doing the following:
- upgrade to NXRM 3.25.0 or newer
- Edit
$data-dir/etc/nexus.properties
and add the following lines :# Limit NuGet V2 API memory issues - https://support.sonatype.com/hc/en-us/articles/360054068493 nexus.nuget.allow.multiple.latest=false
The official Powershell Gallery does not offer a NuGet API v3 endpoint still as of Apr 2021, thus if you use a proxy repository to the official Powershell Gallery and also use other NuGet proxy repositories to remote NuGet API v2 endpoints, then setting this property to false may not be advisable.
Important Documentation Change April 2021
Prior to April 2021, this article documented that the property to disable changes was:
# THIS PROPERTY HAS NO EFFECT - DO NOT USE
nexus.nuget.multiple.latest.fix=false
That property name was not correct and has no effect. If still required, it should be changed to the correct property setting.