Menu
Amazon ElastiCache
User Guide (API Version 2015-02-02)

Redis Specific Parameters

If you do not specify a parameter group for your Redis cluster, then a default parameter group will be used (either default.redis2.6 or default.redis2.8). You cannot change the values of any parameters in the default parameter group; however, you can create a custom parameter group and assign it to your cluster at any time as long as the values of conditionally modifiable parameters are the same in both parameter groups.

Note

Because the newer Redis versions provide a better and more stable user experience, Redis versions 2.6.13, 2.8.6, and 2.8.19 are deprecated from the ElastiCache Management Console. While we recommend against it, if you must use one of these older Redis versions, you can use the AWS CLI or ElastiCache API.

For more information see the following topics:


Redis 2.8.24 Added Parameters

For Redis 2.8.24, there are no additional parameters supported.

Redis 2.8.23 Added Parameters

For Redis 2.8.23, the following additional parameter is supported.

Name Details Description
close-on-slave-write

Default: yes

Type: string (yes/no)

Modifiable: Yes

Changes Take Effect: Immediately

If enabled, clients who attempt to write to a read-only replica will be disconnected.


close-on-slave-write

The close-on-slave-write parameter is introduced by ElastiCache to give you more control over how your cache responds when a primary cluster and a read replica cluster swap roles due to promoting a read replica to primary.

Image: close-on-slave-write, everything working fine

If the read-replica cluster is promoted to primary for any reason other than a Multi-AZ enabled replication group failing over, the client will continue trying to write to endpoint A. Because endpoint A is now the endpoint for a read-replica, these writes will fail. This is the behavior for Redis prior to ElastiCache introducing close-on-slave-write and the behavior if you disable close-on-slave-write.

Image: close-on-slave-write, writes failing

With close-on-slave-write enabled, any time a client attempts to write to a read-replica, the client connection to the cluster is closed. Your application logic should detect the disconnection, check the DNS table, and reconnect to the primary endpoint, which now would be endpoint B.

Image: close-on-slave-write, writing to new primary cluster

Why disable close-on-slave-write?

If disabling close-on-slave-write results in writes to the cluster failing, why would you want to disable close-on-slave-write?

As previously mentioned, with close-on-slave-write enabled, any time a client attempts to write to a read-replica the client connection to the cluster is closed. Since establishing a new connection to the node takes time, disconnecting and reconnecting as a result of a write request to the replica would also impact the latency of read requests that were served through the same connection, until a new connection is established. Therefore, if your application is especially read-heavy or very latency-sensitive, you my prefer to keep your clients connected so as to not degrade read performance.

Redis 2.8.22 Added Parameters

For Redis 2.8.22, there are no additional parameters supported.

Important

  • Beginning with Redis version 2.8.22, repl-backlog-size applies to the primary cluster as well as to replica clusters.

  • Beginning with Redis version 2.8.22, the repl-timeout parameter is not supported. If it is changed, ElastiCache will overwrite with the default (60s), as we do with appendonly.

The following parameters are no longer supported.

  • appendonly

  • appendfsync

  • repl-timeout

Redis 2.8.21 Added Parameters

For Redis 2.8.21, there are no additional parameters supported.

Redis 2.8.19 Added Parameters

For Redis 2.8.19, there are no additional parameters supported.

Redis 2.8.6 Added Parameters

For Redis 2.8.6, the following additional parameters are supported.

Name Details Description
min-slaves-max-lag

Default: 10

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

The number of seconds within which the primary node must receive a ping request from a read replica. If this amount of time passes and the primary does not receive a ping, then the replica is no longer considered available. If the number of available replicas drops below min-slaves-to-write, then the primary will stop accepting writes at that point.

If either this parameter or min-slaves-to-write is 0, then the primary node will always accept writes requests, even if no replicas are available.

min-slaves-to-write

Default: 0

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

The minimum number of read replicas which must be available in order for the primary node to accept writes from clients. If the number of available replicas falls below this number, then the primary node will no longer accept write requests.

If either this parameter or min-slaves-max-lag is 0, then the primary node will always accept writes requests, even if no replicas are available.

notify-keyspace-events

Default: (an empty string)

Type: string

Modifiable: Yes

Changes Take Effect: Immediately

The types of keyspace events that Redis can notify clients of. Each event type is represented by a single letter:

  • K — Keyspace events, published with a prefix of __keyspace@<db>__

  • E — Key-event events, published with a prefix of __keyevent@<db>__

  • g — Generic, non-specific commands such as DEL, EXPIRE, RENAME, etc.

  • $ — String commands

  • l — List commands

  • s — Set commands

  • h — Hash commands

  • z — Sorted set commands

  • x — Expired events (events generated every time a key expires)

  • e — Evicted events (events generated when a key is evicted for maxmemory)

  • A — An alias for g$lshzxe

You can have any combination of these event types. For example, AKE means that Redis can publish notifications of all event types.

Do not use any characters other than those listed above; attempts to do so will result in error messages.

By default, this parameter is set to an empty string, meaning that keyspace event notification is disabled.

repl-backlog-size

Default: 1048576

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

The size, in bytes, of the primary node backlog buffer. The backlog is used for recording updates to data at the primary node. When a read replica connects to the primary, it attempts to perform a partial sync (psync), where it applies data from the backlog to catch up with the primary node. If the psync fails, then a full sync is required.

The minimum value for this parameter is 16384.

Note

Beginning with Redis 2.8.22, this parameter applies to the primary cluster as well as the read replicas.

repl-backlog-ttl

Default: 3600

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

The number of seconds that the primary node will retain the backlog buffer. Starting from the time the last replica node disconnected, the data in the backlog will remain intact until repl-backlog-ttl expires. If the replica has not connected to the primary within this time, then the primary will release the backlog buffer. When the replica eventually reconnects, it will have to perform a full sync with the primary.

If this parameter is set to 0, then the backlog buffer will never be released.

repl-timeout

Default: 60

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

Represents the timeout period, in seconds, for:
  • Bulk data transfer during synchronization, from the read replica's perspective

  • Primary node timeout from the replica's perspective

  • Replica timeout from the primary node's perspective


Redis 2.6.13 Parameters

Redis 2.6.13 was the first version of Redis supported by ElastiCache. The following table shows the Redis 2.6.13 parameters that ElastiCache supports.

Name Details Description
activerehashing

Default: yes

Type: string (yes/no)

Modifiable: At Creation

Determines whether to enable Redis' active rehashing feature. The main hash table is rehashed ten times per second; each rehash operation consumes 1 millisecond of CPU time.

This value is set when you create the parameter group. When assigning a new parameter group to a cluster, this value must be the same in both the old and new parameter groups.

appendonly

Default: no

Type: string

Modifiable: Yes

Changes Take Effect: Immediately

Enables or disables Redis' append only file feature (AOF). AOF captures any Redis commands that change data in the cache, and is used to recover from certain node failures.

The default value is no, meaning AOF is turned off. Set this parameter to yes to enable AOF.

For more information, see Mitigating Failures.

Note

Append Only Files (AOF) is not supported for cache.t1.micro and cache.t2.* nodes. For nodes of this type, the appendonly parameter value is ignored.

Note

For Multi-AZ replication groups, AOF is not allowed.

appendfsync

Default: everysec

Type: string

Modifiable: Yes

Changes Take Effect: Immediately

Controls how often the AOF output buffer is written to disk:
  • no — the buffer is flushed to disk on an as-needed basis.

  • everysec — the buffer is flushed once per second. This is the default.

  • always — the buffer is flushed every time that data in the cache is modified.

client-output-buffer-limit-normal-hard-limit

Default: 0

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

If a client's output buffer reaches the specified number of bytes, the client will be disconnected. The default is zero (no hard limit).

client-output-buffer-limit-normal-soft-limit

Default: 0

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

If a client's output buffer reaches the specified number of bytes, the client will be disconnected, but only if this condition persists for client-output-buffer-limit-normal-soft-seconds. The default is zero (no soft limit).
client-output-buffer-limit-normal-soft-seconds

Default: 0

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

If a client's output buffer remains at client-output-buffer-limit-normal-soft-limit bytes for longer than this number of seconds, the client will be disconnected. The default is zero (no time limit).
client-output-buffer-limit-pubsub-hard-limit

Default: 33554432

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

For Redis publish/subscribe clients: If a client's output buffer reaches the specified number of bytes, the client will be disconnected.

client-output-buffer-limit-pubsub-soft-limit

Default: 8388608

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

For Redis publish/subscribe clients: If a client's output buffer reaches the specified number of bytes, the client will be disconnected, but only if this condition persists for client-output-buffer-limit-pubsub-soft-seconds.
client-output-buffer-limit-pubsub-soft-seconds

Default: 60

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

For Redis publish/subscribe clients: If a client's output buffer remains at client-output-buffer-limit-pubsub-soft-limit bytes for longer than this number of seconds, the client will be disconnected.
client-output-buffer-limit-slave-hard-limit

Default: For values see Redis Node-Type Specific Parameters

Type: integer

Modifiable: No

For Redis read replicas: If a client's output buffer reaches the specified number of bytes, the client will be disconnected.
client-output-buffer-limit-slave-soft-limit

Default: For values see Redis Node-Type Specific Parameters

Type: integer

Modifiable: No

For Redis read replicas: If a client's output buffer reaches the specified number of bytes, the client will be disconnected, but only if this condition persists for client-output-buffer-limit-slave-soft-seconds.
client-output-buffer-limit-slave-soft-seconds

Default: 60

Type: integer

Modifiable: No

For Redis read replicas: If a client's output buffer remains at client-output-buffer-limit-slave-soft-limit bytes for longer than this number of seconds, the client will be disconnected.
databases

Default: 16

Type: integer

Modifiable: At Creation

The number of logical partitions the databases is split into. We recommend keeping this value low.

This value is set when you create the parameter group. When assigning a new parameter group to a cluster, this value must be the same in both the old and new parameter groups.

hash-max-ziplist-entries

Default: 512

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

Determines the amount of memory used for hashes. Hashes with fewer than the specified number of entries are stored using a special encoding that saves space.
hash-max-ziplist-value

Default: 64

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

Determines the amount of memory used for hashes. Hashes with entries that are smaller than the specified number of bytes are stored using a special encoding that saves space.
list-max-ziplist-entries

Default: 512

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

Determines the amount of memory used for lists. Lists with fewer than the specified number of entries are stored using a special encoding that saves space.
list-max-ziplist-value

Default: 64

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

Determines the amount of memory used for lists. Lists with entries that are smaller than the specified number of bytes are stored using a special encoding that saves space.
lua-time-limit

Default: 5000

Type: integer

Modifiable: No

The maximum execution time for a Lua script, in milliseconds, before ElastiCache takes action to stop the script.

If lua-time-limit is exceeded, all Redis commands will return an error of the form ____-BUSY. Since this state can cause interference with many essential Redis operations, ElastiCache will first issue a SCRIPT KILL command. If this is unsuccessful, ElastiCache will forcibly restart Redis.

maxclients

Default: 65000

Type: integer

Modifiable: No

The maximum number of clients that can be connected at one time.
maxmemory-policy

Default: volatile-lru

Type: string

Modifiable: Yes

Changes Take Effect: Immediately

The eviction policy for keys when maximum memory usage is reached.

Valid values are: volatile-lru | allkeys-lru | volatile-random | allkeys-random | volatile-ttl | noeviction

For more information, see What eviction policies do you support? at RedisLabs.

maxmemory-samples

Default: 3

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

For least-recently-used (LRU) and time-to-live (TTL) calculations, this parameter represents the sample size of keys to check. By default, Redis chooses 3 keys and uses the one that was used least recently.
reserved-memory

Default: 0

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

The total memory reserved for non-cache usage. By default, the Redis cache will grow until it consumes the node's maxmemory (see Redis Node-Type Specific Parameters). If this occurs, then node performance will likely suffer due to excessive memory paging. By reserving memory you can set aside some of the available memory for non-Redis purposes to help reduce the amount of paging.

For example, suppose you have a cache.m1.small node, with a maxmemory of 900MB bytes. If you set aside 180 MB, then Redis will never consume this memory; instead, this 180 MB is reserved for the operating system and other background processes on the cache node.

Consider increasing the value of the reserved-memory parameter if you are using read replicas, append-only files (AOF), or other Redis features that consume more memory.

This parameter is specific to ElastiCache, and is not part of the standard Redis distribution.

For more information, see Ensuring You Have Sufficient Memory to Create a Redis Snapshot.

set-max-intset-entries

Default: 512

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

Determines the amount of memory used for certain kinds of sets (strings that are integers in radix 10 in the range of 64 bit signed integers). Such sets with fewer than the specified number of entries are stored using a special encoding that saves space.
slave-allow-chaining

Default: no

Type: string

Modifiable: No

Determines whether a read replica in Redis can have read replicas of its own.
slowlog-log-slower-than

Default: 10000

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

The maximum execution time, in microseconds, for commands to be logged by the Redis Slow Log feature.
slowlog-max-len

Default: 128

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

The maximum length of the Redis Slow Log.
tcp-keepalive

Default: 0

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

If this is set to a nonzero value (N), node clients are polled every N seconds to ensure that they are still connected. With the default setting of 0, no such polling occurs.
timeout

Default: 0

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

If this is set to a nonzero value (N), the node closes a connection if the client is idle for N seconds. With the default setting of 0, the node does not disconnect idle clients.
zset-max-ziplist-entries

Default: 128

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

Determines the amount of memory used for sorted sets. Sorted sets with fewer than the specified number of elements are stored using a special encoding that saves space.
zset-max-ziplist-value

Default: 64

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

Determines the amount of memory used for sorted sets. Sorted sets with entries that are smaller than the specified number of bytes are stored using a special encoding that saves space.

Note

If you do not specify a parameter group for your Redis 2.6.13 cluster, then a default parameter group (default.redis2.6) will be used. You cannot change the values of any parameters in the default parameter group; however, you can always create a custom parameter group and assign it to your cluster at any time.

Redis Node-Type Specific Parameters

Although most parameters have a single value, some parameters have different values depending on the node type used. The following table shows the default values for the maxmemory parameter for each node type. The value of maxmemory is the maximum number of bytes available to you for use, data and other uses, on the node.

Note

The maxmemory parameter cannot be modified.

Node Type maxmemory client-output-buffer-limit-slave-hard-limitclient-output-buffer-limit-slave-soft-limit
cache.t1.micro1426063361426063314260633
cache.t2.micro5819596805819596858195968
cache.t2.small1665138688166513868166513868
cache.t2.medium3461349376346134937346134937
cache.m1.small943718400943718400943718400
cache.m1.medium3093299200309329920309329920
cache.m1.large7025459200702545920702545920
cache.m1.xlarge1488977920014889779201488977920
cache.m2.xlarge1709178880017091788801709178880
cache.m2.2xlarge3502243840035022438403502243840
cache.m2.4xlarge7088373760070883737607088373760
cache.m3.medium2988441600309329920309329920
cache.m3.large6501171200650117120650117120
cache.m3.xlarge1426063360014260633601426063360
cache.m3.2xlarge2998927360029989273602998927360
cache.c1.xlarge6501171200650117120650117120
cache.r3.large1447034880014680064001468006400
cache.r3.xlarge3051356160030408704003040870400
cache.r3.2xlarge6249512960060817408006081740800
cache.r3.4xlarge1264582656001226833920012268339200
cache.r3.8xlarge2543845376002453667840024536678400

Note

t2 instances do not support Redis backup/restore.

t1 and t2 instances do not support Redis AOF or Multi-AZ.