About Asset Download Counts
Nexus Repository Manger 3.3.0 introduced a feature that started to record download counts for repository assets.
It has been decided that as part of Nexus Repository Manager release 3.15.0 the feature will be disabled for all upgraded and new installs.
In a future release, we may remove all related data and code.
The feature stores counts per unique asset requested during 1hr periods in memory, before writing the counts to a database.
Count data contributes to the graphs for the optional repository health check feature. The daily aggregate count over 30 days is visible on the asset information panel.
During the life of this feature, it has been observed that tracking asset download counts can lead to performance issues affecting other non-related and more critical repository manager features. Given enough unique asset requests in a short period of time, a large amount of memory can be consumed tracking these counts. The memory consumption may in some cases lead to OutOfMemoryError of the Nexus JVM and contribute to server instability. Request processing and server throughput may appear to slow under high memory use and cause more frequent and longer garbage collection pauses. In an HA-C environment, keeping the asset download counts in sync across nodes is disproportionate overhead and may lead to database corruption in extreme cases.
Asset download count feature can be disabled by a setting a system property to disable recording download asset counts.
- Edit <data-dir>/etc/nexus.properties
- Add a new line at the end of that file that looks like this:
- Restart Nexus for the property change to have effect.
Note: Disabling asset downloads via this property only fully works in Nexus Repository Manager 3.9.0 or newer.
In severe cases, the database table that stores asset download counts may become corrupt or too large, causing errors. In such cases, the data can be manually removed.
Before proceeding review the instructions to connect to the OrientDB console. Also make sure you understand where your data directory is.
- Stop Nexus Repository Manager
- Make a backup of <data-dir>/db, in case something goes wrong.
- Connect to the OrientDB Console
- At the console prompt, run a command to connect to the component database.
Use a relative path from the installation directory or an absolute path pointing to the component database directory.
In the below example we use the default relative path to the component database directory.
connect plocal:sonatype-work/nexus3/db/component admin admin
- At the console prompt, execute commands to drop the database table and exit the console:
drop class assetdownloadcount
- Start Nexus Repository Manager. If the asset download count feature is still enabled, the assetdownloadcount table will be recreated automatically with no data.
NEXUS-13087 - (Nexus 3.3.0-3.3.2) caching asset download counts under high unique request volume can lead to OutOfMemoryError and instability
NEXUS-15579 - nexus.assetdownloads.enabled=false does not stop all download count updates
NEXUS-18617 - disable asset download count feature in all new/upgraded installations
NEXUS-17495 - remove asset download count feature entirely