Memcached specific parameters - Amazon ElastiCache (Redis OSS)
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Memcached specific parameters

If you do not specify a parameter group for your Memcached cluster, then a default parameter group appropriate to your engine version will be used. You can't change the values of any parameters in a default parameter group. However, you can create a custom parameter group and assign it to your cluster at any time. For more information, see Creating an ElastiCache parameter group.

Memcached 1.6.17 changes

From Memcached 1.6.17, we no longer support these administrative commands: lru_crawler, lru, and slabs. With these changes, you will not be able to enable/disable lru_crawler at runtime via commands. Please enable/disable lru_crawler by modifying your custom parameter group.

Memcached 1.6.6 added parameters

For Memcached 1.6.6, no additional parameters are supported.

Parameter group family: memcached1.6

Memcached 1.5.10 parameter changes

For Memcached 1.5.10, the following additional parameters are supported.

Parameter group family: memcached1.5

Name Details Description
no_modern

Default: 1

Type: boolean

Modifiable: Yes

Allowed_Values: 0,1

Changes Take Effect: At launch

An alias for disabling slab_reassign, lru_maintainer_thread, lru_segmented, andmaxconns_fast commands.

When using Memcached 1.5 and higher, no_modern also sets the hash_algorithm to jenkins.

In addition, when using Memcached 1.5.10, inline_ascii_reponse is controlled by the parameter parallelly. This means that if no_modern is disabled then inline_ascii_reponse is disabled. From Memcached engine 1.5.16 onward the inline_ascii_response parameter no longer applies, so no_modern being abled or disabled has no effect on inline_ascii_reponse.

If no_modern is disabled, then slab_reassign, lru_maintainer_thread, lru_segmented, and maxconns_fast WILL be enabled. Since slab_automove and hash_algorithm parameters are not SWITCH parameters, their setting is based on the configurations in the parameter group.

If you want to disable no_modern and revert to modern, you must configure a custom parameter group to disable this parameter and then reboot for these changes to take effect.

Note

The default configuration value for this parameter has been changed from 0 to 1 as of August 20, 2021. The updated default value will get automatically picked up by new ElastiCache users for each regions after August 20th, 2021. Existing ElastiCache users in the regions before August 20th, 2021 need to manually modify their custom parameter groups in order to pick up this new change.

inline_ascii_resp

Default: 0

Type: boolean

Modifiable: Yes

Allowed_Values: 0,1

Changes Take Effect: At launch

Stores numbers from VALUE response, inside an item, using up to 24 bytes. Small slowdown for ASCII get, faster sets.

For Memcached 1.5.10, the following parameters are removed.

Name Details Description
expirezero_does_not_evict

Default: 0

Type: boolean

Modifiable: Yes

Allowed_Values: 0,1

Changes Take Effect: At launch

No longer supported in this version.

modern

Default: 1

Type: boolean

Modifiable: Yes (requires re-launch if set to no_modern)

Allowed_Values: 0,1

Changes Take Effect: At launch

No longer supported in this version. Starting with this version, no-modern is enabled by default with every launch or re-launch.

Memcached 1.4.34 added parameters

For Memcached 1.4.34, no additional parameters are supported.

Parameter group family: memcached1.4

Memcached 1.4.33 added parameters

For Memcached 1.4.33, the following additional parameters are supported.

Parameter group family: memcached1.4

Name Details Description
modern

Default: enabled

Type: boolean

Modifiable: Yes

Changes Take Effect: At launch

An alias to multiple features. Enabling modern is equivalent to turning following commands on and using a murmur3 hash algorithm: slab_reassign, slab_automove, lru_crawler, lru_maintainer, maxconns_fast, and hash_algorithm=murmur3.

watch

Default: enabled

Type: boolean

Modifiable: Yes

Changes Take Effect: Immediately

Logs can get dropped if user hits their watcher_logbuf_size and worker_logbuf_size limits.

Logs fetches, evictions or mutations. When, for example, user turns watch on, they can see logs when get, set, delete, or update occur.

idle_timeout

Default: 0 (disabled)

Type: integer

Modifiable: Yes

Changes Take Effect: At Launch

The minimum number of seconds a client will be allowed to idle before being asked to close. Range of values: 0 to 86400.

track_sizes

Default: disabled

Type: boolean

Modifiable: Yes

Changes Take Effect: At Launch

Shows the sizes each slab group has consumed.

Enabling track_sizes lets you run stats sizes without the need to run stats sizes_enable.

watcher_logbuf_size

Default: 256 (KB)

Type: integer

Modifiable: Yes

Changes Take Effect: At Launch

The watch command turns on stream logging for Memcached. However watch can drop logs if the rate of evictions, mutations or fetches are high enough to cause the logging buffer to become full. In such situations, users can increase the buffer size to reduce the chance of log losses.

worker_logbuf_size

Default: 64 (KB)

Type: integer

Modifiable: Yes

Changes Take Effect: At Launch

The watch command turns on stream logging for Memcached. However watch can drop logs if the rate of evictions, mutations or fetches are high enough to cause logging buffer get full. In such situations, users can increase the buffer size to reduce the chance of log losses.

slab_chunk_max

Default: 524288 (bytes)

Type: integer

Modifiable: Yes

Changes Take Effect: At Launch

Specifies the maximum size of a slab. Setting smaller slab size uses memory more efficiently. Items larger than slab_chunk_max are split over multiple slabs.

lru_crawler metadump [all|1|2|3]

Default: disabled

Type: boolean

Modifiable: Yes

Changes Take Effect: Immediately

if lru_crawler is enabled this command dumps all keys.

all|1|2|3 - all slabs, or specify a particular slab number

Memcached 1.4.24 added parameters

For Memcached 1.4.24, the following additional parameters are supported.

Parameter group family: memcached1.4

Name Details Description
disable_flush_all

Default: 0 (disabled)

Type: boolean

Modifiable: Yes

Changes Take Effect: At launch

Add parameter (-F) to disable flush_all. Useful if you never want to be able to run a full flush on production instances.

Values: 0, 1 (user can do a flush_all when the value is 0).

hash_algorithm

Default: jenkins

Type: string

Modifiable: Yes

Changes Take Effect: At launch

The hash algorithm to be used. Permitted values: murmur3 and jenkins.
lru_crawler

Default: 0 (disabled)

Type: boolean

Modifiable: Yes

Changes Take Effect: After restart

Note

You can temporarily enable lru_crawler at runtime from the command line. For more information, see the Description column.

Cleans slab classes of items that have expired. This is a low impact process that runs in the background. Currently requires initiating a crawl using a manual command.

To temporarily enable, run lru_crawler enable at the command line.

lru_crawler 1,3,5 crawls slab classes 1, 3, and 5 looking for expired items to add to the freelist.

Values: 0,1

Note

Enabling lru_crawler at the command line enables the crawler until either disabled at the command line or the next reboot. To enable permanently, you must modify the parameter value. For more information, see Modifying an ElastiCache parameter group.

lru_maintainer

Default: 0 (disabled)

Type: boolean

Modifiable: Yes

Changes Take Effect: At launch

A background thread that shuffles items between the LRUs as capacities are reached. Values: 0, 1.

expirezero_does_not_evict

Default: 0 (disabled)

Type: boolean

Modifiable: Yes

Changes Take Effect: At launch

When used with lru_maintainer, makes items with an expiration time of 0 unevictable.

Warning

This can crowd out memory available for other evictable items.

Can be set to disregard lru_maintainer.

Memcached 1.4.14 added parameters

For Memcached 1.4.14, the following additional parameters are supported.

Parameter group family: memcached1.4

Parameters added in Memcached 1.4.14
Name Details Description
config_max

Default: 16

Type: integer

Modifiable: No

The maximum number of ElastiCache configuration entries.
config_size_max

Default: 65536

Type: integer

Modifiable: No

The maximum size of the configuration entries, in bytes.
hashpower_init

Default: 16

Type: integer

Modifiable: No

The initial size of the ElastiCache hash table, expressed as a power of two. The default is 16 (2^16), or 65536 keys.
maxconns_fast

Default: 0 (false)

Type: Boolean

Modifiable: Yes

Changes Take Effect: After restart

Changes the way in which new connections requests are handled when the maximum connection limit is reached. If this parameter is set to 0 (zero), new connections are added to the backlog queue and will wait until other connections are closed. If the parameter is set to 1, ElastiCache sends an error to the client and immediately closes the connection.
slab_automove

Default: 0

Type: integer

Modifiable: Yes

Changes Take Effect: After restart

Adjusts the slab automove algorithm: If this parameter is set to 0 (zero), the automove algorithm is disabled. If it is set to 1, ElastiCache takes a slow, conservative approach to automatically moving slabs. If it is set to 2, ElastiCache aggressively moves slabs whenever there is an eviction. (This mode is not recommended except for testing purposes.)
slab_reassign

Default: 0 (false)

Type: Boolean

Modifiable: Yes

Changes Take Effect: After restart

Enable or disable slab reassignment. If this parameter is set to 1, you can use the "slabs reassign" command to manually reassign memory.

Memcached 1.4.5 supported parameters

Parameter group family: memcached1.4

For Memcached 1.4.5, the following parameters are supported.

Parameters added in Memcached 1.4.5
Name Details Description
backlog_queue_limit

Default: 1024

Type: integer

Modifiable: No

The backlog queue limit.
binding_protocol

Default: auto

Type: string

Modifiable: Yes

Changes Take Effect: After restart

The binding protocol.

Permissible values are: ascii and auto.

For guidance on modifying the value of binding_protocol, see Modifying an ElastiCache parameter group.

cas_disabled

Default: 0 (false)

Type: Boolean

Modifiable: Yes

Changes Take Effect: After restart

If 1 (true), check and set (CAS) operations will be disabled, and items stored will consume 8 fewer bytes than with CAS enabled.
chunk_size

Default: 48

Type: integer

Modifiable: Yes

Changes Take Effect: After restart

The minimum amount, in bytes, of space to allocate for the smallest item's key, value, and flags.
chunk_size_growth_factor

Default: 1.25

Type: float

Modifiable: Yes

Changes Take Effect: After restart

The growth factor that controls the size of each successive Memcached chunk; each chunk will be chunk_size_growth_factor times larger than the previous chunk.
error_on_memory_exhausted

Default: 0 (false)

Type: Boolean

Modifiable: Yes

Changes Take Effect: After restart

If 1 (true), when there is no more memory to store items, Memcached will return an error rather than evicting items.
large_memory_pages

Default: 0 (false)

Type: Boolean

Modifiable: No

If 1 (true), ElastiCache will try to use large memory pages.
lock_down_paged_memory

Default: 0 (false)

Type: Boolean

Modifiable: No

If 1 (true), ElastiCache will lock down all paged memory.
max_item_size

Default: 1048576

Type: integer

Modifiable: Yes

Changes Take Effect: After restart

The size, in bytes, of the largest item that can be stored in the cluster.
max_simultaneous_connections

Default: 65000

Type: integer

Modifiable: No

The maximum number of simultaneous connections.
maximize_core_file_limit

Default: 0 (false)

Type: Boolean

Modifiable:

Changes Take Effect: After restart

If 1 (true), ElastiCache will maximize the core file limit.
memcached_connections_overhead

Default: 100

Type: integer

Modifiable: Yes

Changes Take Effect: After restart

The amount of memory to be reserved for Memcached connections and other miscellaneous overhead. For information about this parameter, see Memcached connection overhead.
requests_per_event

Default: 20

Type: integer

Modifiable: No

The maximum number of requests per event for a given connection. This limit is required to prevent resource starvation.

Memcached connection overhead

On each node, the memory made available for storing items is the total available memory on that node (which is stored in the max_cache_memory parameter) minus the memory used for connections and other overhead (which is stored in the memcached_connections_overhead parameter). For example, a node of type cache.m1.small has a max_cache_memory of 1300MB. With the default memcached_connections_overhead value of 100MB, the Memcached process will have 1200MB available to store items.

The default values for the memcached_connections_overhead parameter satisfy most use cases; however, the required amount of allocation for connection overhead can vary depending on multiple factors, including request rate, payload size, and the number of connections.

You can change the value of the memcached_connections_overhead to better suit the needs of your application. For example, increasing the value of the memcached_connections_overhead parameter will reduce the amount of memory available for storing items and provide a larger buffer for connection overhead. Decreasing the value of the memcached_connections_overhead parameter will give you more memory to store items, but can increase your risk of swap usage and degraded performance. If you observe swap usage and degraded performance, try increasing the value of the memcached_connections_overhead parameter.

Important

For the cache.t1.micro node type, the value for memcached_connections_overhead is determined as follows:

  • If you cluster is using the default parameter group, ElastiCache will set the value for memcached_connections_overhead to 13MB.

  • If your cluster is using a parameter group that you have created yourself, you can set the value of memcached_connections_overhead to a value of your choice.

Memcached 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 max_cache_memory and num_threads parameters for each node type. The values on these parameters cannot be modified.

Node type max_cache_memory (in megabytes) num_threads
cache.t1.micro 213 1
cache.t2.micro 555 1
cache.t2.small 1588 1
cache.t2.medium 3301 2
cache.t3.micro 512 2
cache.t3.small 1402 2
cache.t3.medium 3364 2
cache.t4g.micro 512 2
cache.t4g.small 1402 2
cache.t4g.medium 3164 2
cache.m1.small 1301 1
cache.m1.medium 3350 1
cache.m1.large 7100 2
cache.m1.xlarge 14600 4
cache.m2.xlarge 33800 2
cache.m2.2xlarge 30412 4
cache.m2.4xlarge 68000 16
cache.m3.medium 2850 1
cache.m3.large 6200 2
cache.m3.xlarge 13600 4
cache.m3.2xlarge 28600 8
cache.m4.large 6573 2
cache.m4.xlarge 11496 4
cache.m4.2xlarge 30412 8
cache.m4.4xlarge 62234 16
cache.m4.10xlarge 158355 40
cache.m5.large 6537 2
cache.m5.xlarge 13248 4
cache.m5.2xlarge 26671 8
cache.m5.4xlarge 53516 16
cache.m5.12xlarge 160900 48
cache.m5.24xlarge 321865 96
cache.m6g.large 6537 2
cache.m6g.xlarge 13248 4
cache.m6g.2xlarge 26671 8
cache.m6g.4xlarge 53516 16
cache.m6g.8xlarge 107000 32
cache.m6g.12xlarge 160900 48
cache.m6g.16xlarge 214577 64
cache.c1.xlarge 6600 8
cache.r3.large 13800 2
cache.r3.xlarge 29100 4
cache.r3.2xlarge 59600 8
cache.r3.4xlarge 120600 16
cache.r3.8xlarge 120600 32
cache.r4.large 12590 2
cache.r4.xlarge 25652 4
cache.r4.2xlarge 51686 8
cache.r4.4xlarge 103815 16
cache.r4.8xlarge 208144 32
cache.r4.16xlarge 416776 64
cache.r5.large 13387 2
cache.r5.xlarge 26953 4
cache.r5.2xlarge 54084 8
cache.r5.4xlarge 108347 16
cache.r5.12xlarge 325400 48
cache.r5.24xlarge 650869 96
cache.r6g.large 13387 2
cache.r6g.xlarge 26953 4
cache.r6g.2xlarge 54084 8
cache.r6g.4xlarge 108347 16
cache.r6g.8xlarge 214577 32
cache.r6g.12xlarge 325400 48
cache.r6g.16xlarge 429154 64
cache.c7gn.large 3164 2
cache.c7gn.xlarge 6537 4
cache.c7gn.2xlarge 13248 8
cache.c7gn.4xlarge 26671 16
cache.c7gn.8xlarge 53516 32
cache.c7gn.12xlarge 325400 48
cache.c7gn.16xlarge 108347 64
Note

All T2 instances are created in an Amazon Virtual Private Cloud (Amazon VPC).