Skip to main content
Tune the selected cache engine and the application separately. Memory and eviction policy belong to the cache deployment. Pool limits, timeouts, retry behavior and miss protection belong to the client. Changing one layer cannot establish a missing command, module or durability contract. This guide covers Valkey and Redis. Read Trade-offs in AWS ElastiCache before changing engine or topology, and check the provisioned service profile for the selected target. An ElastiCache discovery call and a native RESP command take different paths. The settings below are native deployment or application controls, not t9:* tuning tags.

Identify the owner of each setting

Avoid temporary native changes that your deployment will immediately overwrite. Make the chosen setting durable in the owning configuration, then read it back from the target. Managed engines can reject CONFIG commands even though they expose the setting through their control plane.

Example: a read-through cache on Memorystore

A storefront caches product summaries for five minutes. PostgreSQL is authoritative, and a miss is safe as long as the database has spare capacity. Start with the Memorystore mapping, including its single-shard versus clustered product distinction. For a cache containing only disposable records, compare an all-keys eviction policy with a policy that only evicts expiring keys. The latter depends on the application assigning expiry to every disposable value. A missing TTL can turn a harmless implementation mistake into retained memory that policy will not evict. Do not apply all-keys eviction to a shared instance holding non-disposable streams or counters. Choose an initial working-set budget from measured key/value memory, not serialized value bytes alone. Add space for metadata, replication, temporary work and expected growth. Track evictions alongside hit rate and database load. A high hit rate can still hide a small, expensive set of misses that overwhelms the source database.
1

Establish the baseline

Use a dedicated cache and an application instance with representative product keys. Record the selected policy, capacity, TTL distribution, connection count, hit/miss rate, database requests per second and response percentiles. Run both a warm-cache interval and a cold-cache interval.
2

Change one control

Change eviction through the managed service’s supported Redis configuration, or increase capacity while leaving policy constant. Treat clustered Memorystore as a topology choice, not a setting that makes a classic instance acquire shards. Keep the same application workload for the comparison.
3

Check the complete result

Use the bounded pressure probe, then replay through the real database-backed path. Accept the setting only if the application returns correct values and stays inside both its latency and database-load budgets. Cache throughput alone is insufficient.
4

Restore and record

Restore the prior setting if rejection, misses or database load worsen beyond the agreed budget. Record the exact policy and workload alongside the result. Remove only the fixture’s keys and disposable infrastructure.
Google documents the control-plane surface in Memorystore Redis configurations. Use the options supported by the particular Memorystore product you selected; configuration surfaces differ across products.

Example: bound the client before buying more memory

Suppose latency increases when an application scales from a few workers to many workers while cache CPU and memory remain healthy. Investigate connections, queued work and retries before resizing the engine. Each process can otherwise create its own pool, so a modest per-process limit multiplied by hundreds of workers becomes a large server connection budget. This native-client example sets explicit connection and I/O bounds. Replace the test hostname, use the real TLS trust configuration, and supply the test identity. The values are illustrative workload settings, not Tensor9 defaults.
Compare 8 and 16 connections under the same bounded application concurrency. Measure time spent waiting for a pool slot separately from server response time. If queueing dominates, decide whether the application should admit less work or the server can handle more simultaneous work. Increasing retries while the pool is saturated can amplify the original overload. Treat timeouts on writes as uncertain outcomes where appropriate. Retrying an INCR is not equivalent to retrying a GET: the first attempt may have executed before the connection failed. Test retry behavior with the application’s idempotency rules instead of treating a timeout value as a correctness fix.

Example: module-backed search on Azure

With Azure Managed Redis, start from the actual module and clustering requirements. The Azure mapping describes why RediSearch constrains eviction and clustering. A no-eviction configuration must hold the intended data and indexes; it cannot free arbitrary records to make room for new writes. Build a representative document fixture, create its indexes and measure memory before and after index creation. Then update and delete documents while running the required queries. Include a rebuild or replacement index if your rollout uses one: temporarily holding two indexes can be the peak, not steady-state serving. Choose capacity for that peak plus growth and replication overhead. Set application admission limits so memory pressure produces controlled backpressure rather than unbounded retries. Exercise the write-error path in the isolated environment and verify that callers distinguish failed writes from successful updates. Changing the managed SKU is a deployment operation with cost and availability consequences. Record the chosen size and scaling path before applying it, including whether returning to the prior size requires migration. Do not substitute an arbitrary maxmemory command for a managed capacity change. Follow Azure Managed Redis scaling guidance for the current service controls.

Example: an operated Valkey or Dragonfly deployment

For Valkey, make the intended memory limit and eviction policy explicit in the deployment’s engine configuration. This fragment illustrates a cache-only instance; it does not configure TLS, replication or persistence and is not a complete deployment:
The container or VM needs additional memory for process overhead and operations that are not covered by the eviction limit. Setting both limits to the same value risks process termination before graceful eviction can protect the workload. Verify actual resident memory under replication and backup activity, not only the engine’s keyspace accounting. Dragonfly has a different capacity and cache-mode model. Evaluate its supported cache-mode setting and vertical CPU/memory shape instead of copying a Valkey policy name into its configuration. If you depend on a specific script, function, module or cluster operation, run that compatibility fixture before tuning concurrency. More resources cannot make an unsupported operation appear. In either operated deployment, include storage growth, snapshot transfer, restore credentials, replica placement and upgrade testing in the operating budget. A locally written snapshot is not an independent recoverable backup if the node and its disk fail together.

Managed alternatives and limits

DigitalOcean Managed Valkey, OCI Cache and Scaleway Managed Redis have different configuration surfaces and sizing units. Use the target’s supported capacity and backup controls rather than assuming an AWS node type, parameter group or snapshot window carries over literally. For Scaleway, inspect both the provisioned and serverless-origin mapping for the origin resource you use. For correctness-bearing state, require a recovery test before accepting a lower-cost setting. Write a uniquely identified record, confirm the application acknowledgment, exercise the approved failure or restore procedure in a disposable environment, and inspect what remains. Record actual lost or replayed work. Neither native replication nor a configuration label replaces that observation.

When tuning is the wrong next step

Return to adapter selection when the hard requirement is an unavailable module, incompatible multi-key topology, different loss semantics or an unmanageable recovery obligation. Stay with tuning when the chosen contract fits and the problem is measurable capacity, TTL, concurrency or backpressure. Use Debugging Your Adapters to separate endpoint-discovery failures from native engine failures. Explain describes the management path; native cache metrics and command-level application tests establish the behavior of direct RESP traffic.