Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Panel | ||
---|---|---|
| ||
vgcreate swarmspool /dev/sdb Persist it by adding at the end of /etc/fstab /dev/mapper/swarmspool-diskcache /var/spool/caringo xfs defaults 0 0 |
How to Enable Listing Cache
The procedure to enable Listing Cache in Swarm is outlined below:
Add in the /etc/caringo/cloudgateway/gateway.cfg.
Code Block |
---|
[storage_cluster]
disableListingCache=false |
After testing in a staging environment, roll out the Listing Cache to production by deploying the necessary configurations and code changes.
Monitor performance impact closely during the rollout phase.
Optional. Pre-warm the cache with commonly accessed listings before enabling it in production, so the initial requests are served from the cache.
How Does Listing Cache Work
Ensure Sufficient Disk Space: Listing Cache stores each folder in a separate SQLite database, which consumes disk space. Provide ample disk space to avoid frequent evictions of folder databases, as this impacts performance.
Automatic Folder Detection: Listing Cache automatically learns about folders through ongoing list, write, and delete requests. No manual intervention is required to create or manage databases for each folder.
Monitor Cache Population: Initially, for any new folder, the cache starts with an "infinite gap," meaning it has no data cached and queries Elasticsearch. Over time, as more listings are cached, the gap reduces until the folder is fully cached and can be served without querying Elasticsearch.
Real-Time Cache Updates: Ongoing write and delete requests are intercepted and used to keep the folder databases updated, ensuring the cache remains consistent with the actual data.
LRU-Based Eviction: The system automatically evicts the least recently used (LRU) databases when disk space is full. If a folder's database is evicted and later requested, the cache process restarts for that folder.
Disk Space Directly Impacts Performance: The more disk space available, the fewer evictions occur, allowing more folders to remain fully cached and reducing the need for frequent Elasticsearch queries.
Prepare for Elasticsearch Querying: In case of cache misses or folder database evictions, Elasticsearch will be queried. Ensure that Elasticsearch is properly configured to handle such requests, especially during periods of high cache turnover.
How to Enable Listing Cache
The procedure to enable Listing Cache in Swarm is outlined below:
Add in the /etc/caringo/cloudgateway/gateway.cfg.
Code Block |
---|
[storage_cluster]
disableListingCache=false |
...
After testing in a staging environment, roll out the Listing Cache to production by deploying the necessary configurations and code changes.
...
Monitor performance impact closely during the rollout phase.
...
.
How to Determine if the Listing Cache is Working Correctly
...