ARTIFACTORY: How to reduce the number and size of node_events tables

ARTIFACTORY: How to reduce the number and size of node_events tables

AuthorFullName__c
Yunzong Guo
articleNumber
000006290
ft:sourceType
Salesforce
FirstPublishedDate
2024-12-30T19:01:10Z
lastModifiedDate
2024-12-30
VersionNumber
1
Description

In a heavily loaded Artifactory cluster, the node_events table may be very large, such as 200 to 300 million rows of data, which may reach 200 to 300GB size and take up a lot of database disk space. This may cause the Artifactory's default SQL execution time for automatic node_events cleanup to be too long or even take several hours to complete, the database may issue an alarm due to this slow SQL, and it will affect Artifactory performance.

How can the number and size of node_events tables be reduced?


Resolution 

Before Artifactory version 7.49.3, node_events saves 60 days of data by default. In version 7.49.3 and above, it saves 3 days of data by default. You can control the retention values by setting artifactory.events.log.cleanup.age.of.entries.to.discard.days in artifactory.system.properties.

If your current Artifactory version is lower than 7.49.3 and you do not want to upgrade immediately, you can run the following SQL to clean up the previous data (It is recommended to back up the database before execution):

1. Query the node_events table to see how many rows there are:
mysql> select count(*) from node_events;
+----------+
| count(*) |
+----------+
| 279262030 |
+----------+

2. Change/add this parameter, and modify the value from 60 days to 3 days or less:
vim  $JFROG_HOME/artifactory/var/etc/artifactory/artifactory.system.properties:
artifactory.events.log.cleanup.age.of.entries.to.discard.days=3

3. Restart the Artifactory.

Notes:
The federated repositories are related to this table node_events, for example, if you have configured the Federated repositories, you upload a new file and it will take 1 day for the file to be synchronized to the target Artifactory, then you should set the above value to no less than 1 day. For more information about Federation repositories, refer to:
https://jfrog.com/help/r/jfrog-artifactory-documentation/federated-repository-best-practices