Configure Caching
Note
This page is a work in progress. It may contain incomplete or incorrect information.
Configure Caching
Ledger API Caches
The max-contract-state-cache-size and max-contract-key-state-cache-size parameters control the size of the
Ledger API contract and contract key caches, respectively. Modifying these parameters changes the likelihood that a
transaction using a contract or a contract key that was recently accessed (created or read) can still find it in the
memory, rather than needing to query it from the database. Larger caches might be of interest when there is a big pool of
ambient contracts that are consistently fetched or used for non-consuming exercises. Larger caches can also benefit
use cases where a big pool of contracts rotates through a create -> archive -> create-successor cycle.
Consider adjusting these parameters explicitly if the performance of your specific workflow depends on large caches.
canton.participants.participant.ledger-api.index-service {
max-contract-state-cache-size = 100000 // default 1e4
max-contract-key-state-cache-size = 100000 // default 1e4
}