About Asset Download Counts
Nexus Repository 3.3.0 introduced a feature that started to record download counts for repository assets. As part of Nexus Repository release 3.15.0 the feature was disabled for all upgraded and new installs. The feature was removed entirely in the 3.16.0 release.
The feature stored 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 lead to performance issues affecting other non-related and more critical 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 Repository 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.
The asset download count feature can be disabled by 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 Repository 3 for the property change to take 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
- 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. 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