Memcached configurations

This page provides a list of Memorystore for Memcached's modifiable and unmodifiable Memcached configuration parameters, as well as the default values for the parameters.

Modifiable configuration parameters

You can modify the following parameters when creating or updating a Memorystore for Memcached instance. Updating parameters requires you to change and apply parameters in two separate steps. For more information about how to change these configurations, see Configuring Memcached instances.

Parameter Acceptable values Default value Description
listen-backlog (-b) 1-10000 1024 Adjustable length of the connection backlog queue. The backlog is the number of network connection requests queued up to be processed by Memcached.
disable-flush-all (-F) 0,1 0 Setting disable-flush-all to 1 disables the open source Memcached flush-all command. Modifying this configuration increments the cmd_flush counter, however a flush does not actually occur.
max-item-size (-I) 524288-134217728 (bytes) 1048576 The Memcached parameter max-item-size sets the maximum size limit for items stored in the instance. It is subject to a few additional constraints:
  • max-item-size must be greater than or equal to slab_chunk_max. slab_chunk_max is set to 524288 bytes (512 KiB), and Memorystore for Memcached does not support changing this value. Therefore, the minimum value of max-item-size is 524288 bytes as opposed to the open source Memcached supported minimum (1024 bytes).
  • max-item-size must be evenly divisible by slab_chunk_max (524288 bytes).
  • max-item-size may not be more than half the total allocated size of the cache (the -m flag).
slab-min-size (-n) 1-1024 (bytes) 48 Sets the minimum item size and the size of the smallest Memcached slab.
slab-growth-factor (-f) 1.01-100.00 1.25 slab-growth-factor is the multiplier used to calculate the size of Memcached chunks/slabs. Lowering this value can improve the efficiency of memory usage, but it depends on size of items to be stored and the available memory of the instance.
protocol (-B) auto, ascii auto The binding protocol. Designates which protocol clients attempting to connect to the server must use. Auto supports both binary and ascii protocol.
disable-cas (-C) 0,1 0 If disable-cas is set to 1, check and set (CAS) operations are disabled. Disabling CAS operations uses 8 fewer bytes for each item in the cache. Memcached uses the CAS operation to refresh an item's data if it hasn't been updated since the last retrieval.
disable-evictions (-M) 0,1 0 If set to 1, when out of memory, Memcached returns an error rather than evicting items. The instance won't accept writes until memory becomes available.
max-reqs-per-event (-R) 1-1000 20 Limits the number of requests per event that a single client connection can make. After the client exceeds this value, the server prioritizes other clients before it continues to process the original client request.

Supported extended options

Parameter Acceptable values Default value Description
track_sizes 0,1 0 (disabled) If track-sizes is set to 1, users can run the Memcached stats sizes command. We do not recommend enabling this configuration in production environments.
watcher_logbuf_size 0-2097151 (kibibytes) 262144 The size of the write buffer per active watcher connected. Changing this configuration adjusts the size of the watch command's logging buffer size. To avoid losing logs, increase watcher_logbuf_size when it is full.
worker_logbuf_size 48-524288 (kibibytes) 65536 Controls the size of the buffer for each active worker. The background thread reads from these buffers.
lru_crawler 0,1 1 (enabled) The lru_crawler configuration enables a background process that scans through slabs and removes the least recently used (lru) items from those slabs. This process is not CPU or memory intensive. If you set lru_crawler to 1, the process will run at launch time until you set lru_crawler to 0.
hashpower 13-32 16 Integer multiplier for the initial size of the hash table. Increases as the size of the hash grows.
idle_timeout 0-86400 seconds 0 (disabled) Set to 0 (disabled) by default. This configurations sets time in seconds that clients can idle before timing out and disconnecting.
lru_maintainer 0,1 1 (enabled) Enabled by default. lru_maintainer is a background process that determines how recently items are accessed in order to properly sort all items by "least recently used" (lru).
maxconns_fast 0,1 0 (disabled) Manages how Memcached processes new connections when the maximum number of clients is reached. When maxconns-fast is set to 0, connections exceeding the maximum connection limit are added to a queue. When maxconns-fast is set to 1, connections exceeding the maximum connection limit are dropped and served an error message.
hash_algorithm jenkins, murmur3 murmur3 Designates the hash algorithm that the instance uses.

Unmodifiable configuration parameters

The following table lists the Memcached configuration parameters that you cannot modify with Memorystore for Memcached, and the default values of the parameters. For more details, see the list of native Memcached configuration parameters.

Parameter Default value
port (-p) 11211
memory-limit (-m) Set to match the memory configured for each node in the instance node config.
threads (-t) Set to match the number of CPUs for each instance node.
conn-limit (-c) 65000 per node
verbose (-v) true
slab_automove 1 (enabled)
slab_reassign 1 (enabled)
enable-largepages (-L) 0 (disabled)
lock-memory (-k) 0 (disabled)
expirezero-does-not-evict Not supported. Deprecated in Memcached 1.4.35.
slab_chunk_max 524288 bytes
modern 1 (enabled)

What's next