Skip to content

Commit a1f6a5e

Browse files
authored
deployment: add support for the LRU cache (#4981)
## Motivation This addition/backport of the LRU settings addition. This is the original PR : #4964 ## Test Plan Changes were tested on an ephemeral temporary network successfully. ## Release Plan - These changes ARE the backport and will follow the usual release cycle. ## Links Original PR: #4964 - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 7a9ef14 commit a1f6a5e

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

docker/docker-compose.indexer-test.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ services:
1010
environment:
1111
- LINERA_STORAGE_SERVICE_PORT=${LINERA_STORAGE_SERVICE_PORT:-1235}
1212
healthcheck:
13-
test: ["CMD-SHELL", "nc -z localhost ${LINERA_STORAGE_SERVICE_PORT:-1235}"]
13+
test:
14+
["CMD-SHELL", "nc -z localhost ${LINERA_STORAGE_SERVICE_PORT:-1235}"]
1415
interval: 5s
1516
timeout: 3s
1617
retries: 10
@@ -25,7 +26,9 @@ services:
2526
ports:
2627
- "${INDEXER_PORT:-8081}:${INDEXER_PORT:-8081}"
2728
command: >
28-
sh -c "set -ex; ./linera-indexer-grpc --port ${INDEXER_PORT:-8081} --database-path ${INDEXER_DATABASE_PATH:-/data/indexer.db}"
29+
sh -c "set -ex; ./linera-indexer-grpc
30+
--port ${INDEXER_PORT:-8081}
31+
--database-path ${INDEXER_DATABASE_PATH:-/data/indexer.db}
2932
environment:
3033
- INDEXER_PORT=${INDEXER_PORT:-8081}
3134
- INDEXER_DATABASE_PATH=${INDEXER_DATABASE_PATH:-/data/indexer.db}
@@ -127,7 +130,11 @@ services:
127130
linera-indexer:
128131
condition: service_healthy
129132
healthcheck:
130-
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:${EXPLORER_API_PORT:-3002}/api/health || exit 1"]
133+
test:
134+
[
135+
"CMD-SHELL",
136+
"wget --no-verbose --tries=1 --spider http://localhost:${EXPLORER_API_PORT:-3002}/api/health || exit 1",
137+
]
131138
interval: 30s
132139
timeout: 10s
133140
retries: 3
@@ -145,4 +152,5 @@ volumes:
145152

146153
networks:
147154
linera-network:
148-
driver: bridge
155+
driver: bridge
156+

kubernetes/linera-validator/templates/proxy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ spec:
9999
exec ./linera-proxy \
100100
--storage scylladb:tcp:scylla-client.scylla.svc.cluster.local:9042 \
101101
--storage-replication-factor {{ .Values.storageReplicationFactor | quote }} \
102+
--storage-max-cache-size {{ .Values.storageCacheConfig.maxCacheSize | int }} \
103+
--storage-max-cache-entries {{ .Values.storageCacheConfig.maxCacheEntries | int }} \
102104
--id "$ORDINAL" \
103105
/config/server.json
104106
env:

kubernetes/linera-validator/templates/shards.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ spec:
9393
--storage {{ .Values.storage | quote }} \
9494
--server /config/server.json \
9595
--shard $ORDINAL \
96-
--storage-replication-factor {{ .Values.storageReplicationFactor | quote }}
96+
--storage-replication-factor {{ .Values.storageReplicationFactor | quote }} \
97+
--storage-max-cache-size {{ .Values.storageCacheConfig.maxCacheSize | int }} \
98+
--storage-max-cache-entries {{ .Values.storageCacheConfig.maxCacheEntries | int }} \
9799
env:
98100
- name: RUST_LOG
99101
value: {{ .Values.logLevel }}

kubernetes/linera-validator/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ storage: "scylladb:tcp:scylla-client.scylla.svc.cluster.local:9042"
4040
# Storage replication factor
4141
storageReplicationFactor: 1
4242

43+
# LRU cache configuration for storage operations
44+
# These settings control memory usage for caching storage queries
45+
storageCacheConfig:
46+
# Maximum total cache size in bytes (default: 10MB)
47+
maxCacheSize: 10000000
48+
# Maximum number of entries in the cache (default: 1000)
49+
maxCacheEntries: 1000
50+
4351
# Dual storage mode (RocksDB + ScyllaDB)
4452
dualStore: false
4553

0 commit comments

Comments
 (0)