Deploy Memcached with flags
A managed Memcached instance lives inside a project and is reachable from any container in that project. Pick between a single node (standalone) for caches you can afford to lose and a multi-node cluster for higher capacity and partition tolerance.
A managed Memcached instance lives inside a project and is reachable from any container in that project. Pick between a single node (standalone) for caches you can afford to lose and a multi-node cluster for higher capacity and partition tolerance.
For the YAML-mode equivalent, see Deploy Memcached with YAML.
Minimal create
reis memcached:create \
--project my-project \
--name "Session Cache" \
--handle session-cache \
--memory 256 \
--regions falkenstein-1That gets you a single-node Memcached instance with 256 MB of memory. Sensible defaults handle everything else.
A more typical deploy
A clustered cache sized for a busy production workload:
reis memcached:create \
--project my-project \
--name "Session Cache" \
--handle session-cache \
--memory 1024 \
--max_connections 4096 \
--threads 8 \
--max_item_size_mb 4 \
--nodes 3 \
--mode cluster \
--regions falkenstein-1 \
--regions virginia-1Flag reference
| Flag | Description | Default |
|---|---|---|
--name | Display name (required) | — |
--handle | Immutable handle (required) | — |
--project | Project handle the instance belongs to | — |
--regions (-r) | Active region — repeatable | required |
--memory | Memory per node in MB | 512 |
--max_connections | Concurrent connections per node | 1024 |
--threads | Worker threads per node | 4 |
--max_item_size_mb | Largest item the cache will accept (max 128) | 1 |
--nodes | Number of nodes (1-9) | 1 |
--mode | standalone or cluster | cluster |
Interactive create
Omit the required flags and Reis walks you through the prompts, fetching available regions and projects from the API:
reis memcached:createUpdating an instance
# Resize memory per node
reis memcached:update session-cache --memory 2048
# Add nodes
reis memcached:update session-cache --nodes 5
# Switch topology
reis memcached:update session-cache --mode standalone --nodes 1Each update flag overrides only the field you pass; everything else stays as it was.
Connecting from a container
Once the instance is running, the platform exposes its hostname inside the project's private network. The container can reach it directly — no further configuration needed.
Cluster mode works with any consistent-hashing memcached client (libmemcached-based clients, twemproxy, mcrouter). Standalone mode is a single hostname/port pair you point the client at directly.
Related
- Deploy Memcached with YAML — declarative version
- Deploy an HTTP container with flags — for the service that fronts the cache
- Flag mode overview — repeatable flags, booleans, short aliases