ARTIFACTORY: Determining the Right Cache-FS Size

ARTIFACTORY: Determining the Right Cache-FS Size

AuthorFullName__c
Daniel Milman
articleNumber
000006173
ft:sourceType
Salesforce
FirstPublishedDate
2024-08-27T11:45:49Z
lastModifiedDate
2024-08-27
VersionNumber
2

There isn’t a one-size-fits-all approach to allocating storage for the cache-fs in Artifactory. The optimal size depends on how Artifactory is used in your specific environment. While we can't define an exact amount, we can make an educated estimate based on the average traffic to Artifactory. Ideally, the cache should be large enough to store data from a full day’s operations for maximum efficiency.
To accurately determine the optimal cache size, you can calculate the cache hit rate by following these steps:


1. Enable Open Metrics by setting in the system.yaml:
shared:
    metrics:
        enabled: true

artifactory:
    metrics:
        enabled: true
Requires a restart to Artifactory.

2. Locate Metrics:
In Open Metrics, find “jfsh_binaries_not_found_total{id=”cache-fs”,name=”cache-fs”}” and “jfsh_binaries_download_total{id=”cache-fs”,name=”cache-fs”}”

For example:
jfsh_binaries_not_found_total{id=”cache-fs”,name=”cache-fs”} : 75645 1721136023682
jfsh_binaries_download_total{id=”cache-fs”,name=”cache-fs”} : 890172 1721136023682

3. Calculate Cache Efficiency:
Use the following formula to calculate the percentage of binaries pulled from the cache:
Cache Hit Rate = (jfsh_binaries_download_total / (jfsh_binaries_download_total + jfsh_binaries_not_found_total)) * 100%

The closer this percentage is to 100%, the more effectively Artifactory is pulling binaries from the cache. If the percentage is low, consider increasing the cache size in the binarystore.xml, and then reevaluate the cache hit rate after the modification.