Memcached — a high-performance, in-memory key/value cache for speeding up dynamic web apps by alleviating database load. Deployed as a host-networked Nomad service; purely in-memory, no persistence.
Save as values.hcl, edit, then run:
# The name of the Nomad job.
job_name = "memcached"
# The Nomad namespace to deploy into.
namespace = "default"
# The datacenters to deploy to.
datacenters = ["*"]
# The Memcached container image.
image = "memcached:alpine"
# Host port Memcached listens on.
port = 11211
# Max memory for the cache, in MB (memcached -m). Items are evicted (LRU) when full.
memory_limit = 256
# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []
# The task resources. Give memory headroom above memory_limit.
resources = {
cpu = 200
memory = 320
}
| Name | Type | Default | Description |
|---|---|---|---|
| job_name | string | "memcached" | The name of the Nomad job. |
| namespace | string | "default" | The Nomad namespace to deploy into. |
| datacenters | list | ["*"] | The datacenters to deploy to. |
| image | string | "memcached:alpine" | The Memcached container image. |
| port | number | 11211 | Host port Memcached listens on. |
| memory_limit | number | 256 | Max memory for the cache, in MB (memcached -m). Items are evicted (LRU) when full. |
| constraints | list | [] | Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true". |
| resources | object | {
cpu = 200
memory = 320
} | The task resources. Give memory headroom above memory_limit. |
No variables match.
Memcached — a high-performance, distributed in-memory key/value cache, commonly used to speed up dynamic web apps by caching query results and objects. Host-networked Nomad service; purely in-memory (nothing persists).
nomad-pack registry add nomploy github.com/Nomploy/nomad-packs
nomad-pack run memcached --registry nomploy
In nomploy: create a Compose service, type Nomad Pack, pack memcached, custom registry
github.com/Nomploy/nomad-packs, then Deploy.
Point your app's memcached client at <node-ip>:11211.
| Variable | Default | Notes |
|---|---|---|
image |
memcached:alpine |
Pin a tag in production. |
port |
11211 |
Listen port. |
memory_limit |
256 |
Max cache size in MB (-m); LRU eviction when full. |
constraints |
[] |
Placement. |
resources |
cpu 200 / mem 320 |
Keep task memory above memory_limit. |
redis if you need persistence, data structures, or pub/sub; memcached is for
simple, volatile object caching.