Memcached cache server
v0.1.7Read-only memcached introspection via the `stats` ASCII protocol — general stats, slab usage, item counts, sizes. Plus FLUSH_ALL as a critical mutator. Target host/port via MEMCACHED_HOST + MEMCACHED_PORT env vars on the runner host (default 127.0.0.1:11211).
nc
Install
emisar pack install
fetches this pack, re-validates it, and verifies its content hash against the
--hash
below — the exact bytes this page was rendered against, so a tampered copy is
rejected — before copying it into the runner's packs dir. The command reloads a
running daemon itself; no manual restart.
sudo emisar pack install memcached --hash sha256:d401bdb56c6835122f9b55bb03743347ddbc2745b2c90384b1deb1979800b805
Setup
Actions speak the memcached ASCII protocol over nc to
MEMCACHED_HOST
:
MEMCACHED_PORT
on the runner host, defaulting to the local instance at 127.0.0.1:11211. The ASCII protocol has no authentication, so no credentials are involved.
Environment
Set these on the runner host, then add each name to
execution.inherit_env
so the value reaches the action.
-
MEMCACHED_HOSTdefault 127.0.0.1Target host.
-
MEMCACHED_PORTdefault 11211Target port.
Notes
-
Any of
MEMCACHED_HOSTyou set must also be allowlisted in the runner'sexecution.inherit_env— the action env is scrubbed to PATH/LANG/LC_ALL/TERM by default, so an env present on the host but not allowlisted is silently dropped (the action falls back to its local default or fails auth). - No authentication exists for this transport; reach a remote daemon only over a trusted network or tunnel.
- flush_all is destructive — it invalidates every key and can stampede the origin on the next miss.
Verify it works
Runs mc.stats, a low-risk
read that confirms the pack can reach its target. Run it on the host once the pack
is installed; pack install runs it for
you.
sudo emisar pack verify memcached
Install and configure a pack walks through the whole sequence on a host.
Actions 7 total
View on GitHub-
mc.flush_all exec critical Critical — data loss or irreversible
flush_all
Invalidate every key. Cold cache → origin load spike.
View source on GitHub -
mc.stats exec low Low — read-only or trivially reversible
stats (general)
Show uptime, current connections, get/set rates, hit/miss, bytes, evictions.
View source on GitHub -
mc.stats_items exec low Low — read-only or trivially reversible
stats items
Show per-slab item counts + age.
View source on GitHub -
mc.stats_settings exec low Low — read-only or trivially reversible
stats settings
Show daemon configuration at boot.
View source on GitHub -
mc.stats_sizes exec low Low — read-only or trivially reversible
stats sizes
Show a histogram of item sizes. WARNING: scans all items — can be slow on busy servers.
View source on GitHub -
mc.stats_slabs exec low Low — read-only or trivially reversible
stats slabs
Show per-slab allocation + utilization.
View source on GitHub -
mc.version exec low Low — read-only or trivially reversible
version
Show the daemon version.
View source on GitHub