Amazon ElastiCache
ElastiCache for Memcached User Guide (API Version 2015-02-02)

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 cannot 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 a Parameter Group.

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: 0

Type: boolean

Modifiable: Yes

Allowed_Values: 0,1

Changes Take Effect: At launch

An alias for disabling slab_reassign, slab_automove, lru_crawler, lru_maintainer, maxconns_fast commands. No modern also sets the hash_algorithm to jenkins and allows inlining of ASCII VALUE. Applicable to memcached 1.5 and higher. To revert to modern, which is now the default, you must re-launch.

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, 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.

cache_memlimit

Type: integer

Modifiable: Yes

Changes Take Effect: Immediately

If memory isn't being preallocated, allows dynamically increasing the memory limit of a running system. cache_memlimit N where N is a value in megabytes. Value can go up or down.

Range: 8 (MB) to the node type's maxmemory.

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 a 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 a 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: No

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 maxmemory client-output-buffer-limit-slave-hard-limit client-output-buffer-limit-slave-soft-limit
cache.t1.micro 142606336 14260633 14260633
cache.t2.micro 581959680 58195968 58195968
cache.t2.small 1665138688 166513868 166513868
cache.t2.medium 3461349376 346134937 346134937
cache.m1.small 943718400 943718400 943718400
cache.m1.medium 3093299200 309329920 309329920
cache.m1.large 7025459200 702545920 702545920
cache.m1.xlarge 14889779200 1488977920 1488977920
cache.m2.xlarge 17091788800 1709178880 1709178880
cache.m2.2xlarge 35022438400 3502243840 3502243840
cache.m2.4xlarge 70883737600 7088373760 7088373760
cache.m3.medium 2988441600 309329920 309329920
cache.m3.large 6501171200 650117120 650117120
cache.m3.xlarge 14260633600 1426063360 1426063360
cache.m3.2xlarge 29989273600 2998927360 2998927360
cache.m4.large 6892593152 689259315 689259315
cache.m4.xlarge 15328501760 1532850176 1532850176
cache.m4.2xlarge 31889126359 3188912636 3188912636
cache.m4.4xlarge 65257290629 6525729063 6525729063
cache.m4.10xlarge 166047614239 16604761424 16604761424
cache.m5.large 6854542746 685454275 685454275
cache.m5.xlarge 13891921715 1389192172 1389192172
cache.m5.2xlarge 27966669210 2796666921 2796666921
cache.m5.4xlarge 56116178125 5611617812 5611617812
cache.m5.12xlarge 168715971994 16871597199 16871597199
cache.m5.24xlarge 337500562842 33750056284 33750056284
cache.c1.xlarge 6501171200 650117120 650117120
cache.r3.large 14470348800 1468006400 1468006400
cache.r3.xlarge 30513561600 3040870400 3040870400
cache.r3.2xlarge 62495129600 6081740800 6081740800
cache.r3.4xlarge 126458265600 12268339200 12268339200
cache.r3.8xlarge 254384537600 24536678400 24536678400
cache.r4.large 13201781556 1320178155 1320178155
cache.r4.xlarge 26898228839 2689822883 2689822883
cache.r4.2xlarge 54197537997 5419753799 5419753799
cache.r4.4xlarge 108858546586 10885854658 10885854658
cache.r4.8xlarge 218255432090 21825543209 21825543209
cache.r4.16xlarge 437021573120 43702157312 43702157312
cache.r5.large 14037181030 1403718103 1403718103
cache.r5.xlarge 28261849702 2826184970 2826184970
cache.r5.2xlarge 56711183565 5671118356 5671118356
cache.r5.4xlarge 113609865216 11360986522 11360986522
cache.r5.12xlarge 341206346547 34120634655 34120634655
cache.r5.24xlarge 682485973811 68248597381 68248597381

Note

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