Skip to content
BleemeoBleemeo

Memcached

Auto-Detection
Health Check
Built-in Metrics

Memcached is a high-performance, distributed in-memory caching system.

Glouton detects Memcached by its process and listening port (default: 11211).

If auto-detected parameters are incorrect, override them manually:

Terminal window
sudo tee /etc/glouton/conf.d/99-memcached.conf > /dev/null << 'EOF'
service:
# For a Memcached running outside a container
- type: "memcached"
address: "127.0.0.1"
port: 11211
# For an additional Memcached running outside a container
- type: "memcached"
instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE"
address: "127.0.0.1"
port: 11212
# For a Memcached running in a Docker container
- type: "memcached"
instance: "CONTAINER_NAME"
address: "172.17.0.2"
port: 11211
EOF

Glouton automatically detects configuration changes.

Glouton performs a Memcached protocol check on the configured port to verify that the server is responding.

MetricDescription
service_statusStatus of Memcached
memcached_command_getNumber of get requests per second
memcached_command_setNumber of set requests per second
memcached_connections_currentNumber of client connections to Memcached
memcached_items_currentCurrent number of items stored
memcached_octets_rxNetwork traffic received by Memcached in bytes per second
memcached_octets_txNetwork traffic sent by Memcached in bytes per second
memcached_ops_cas_hitsNumber of successful CAS (Check-And-Set) requests per second
memcached_ops_cas_missesNumber of CAS requests against missing keys per second
memcached_ops_decr_hitsNumber of successful decrement requests per second
memcached_ops_decr_missesNumber of decrement requests against missing keys per second
memcached_ops_delete_hitsNumber of successful delete requests per second
memcached_ops_delete_missesNumber of delete requests against missing keys per second
memcached_ops_evictionsNumber of items evicted to free memory for new items per second
memcached_ops_get_hitsNumber of successful get requests per second
memcached_ops_get_missesNumber of get requests against missing keys per second
memcached_ops_incr_hitsNumber of successful increment requests per second
memcached_ops_incr_missesNumber of increment requests against missing keys per second
memcached_ops_touch_hitsNumber of successful touch requests per second
memcached_ops_touch_missesNumber of touch requests against missing keys per second
memcached_percent_hitratioHit ratio of get requests in percent
memcached_ps_count_threadsNumber of worker threads
memcached_uptimeTime since Memcached server start in seconds

See Troubleshoot a Service Check or Missing Metrics for what applies to every service: finding the address and port Glouton really uses, what each check message means, and how to read the collection error — which does not appear in the agent logs at the default level.

Glouton sends version on the Memcached port and expects a VERSION answer:

Status text Cause Fix
TCP port 11211, Connection refused Memcached listens on another port or address, or only on a UNIX socket Set address and port; a socket-only Memcached cannot be checked
TCP port 11211, unexpected response "..." Something that is not Memcached answers on that port, or SASL authentication is required Check what listens there; Glouton cannot authenticate to Memcached
TCP port N, connection timed out after 10 seconds A firewall drops the packets Open the port for the agent

Metrics come from the stats command on the same port, sent without authentication — Glouton has no way to authenticate to Memcached. A check that passes means version was answered, so the remaining causes are a server that answers version but refuses stats, or a plan that does not include the built-in metrics: those require the Professional plan, while the availability check is available on every plan. The error Memcached returned is in scrape-loop-active.json, under memcached input.

Terminal window
printf 'stats\r\n' | nc -w 2 127.0.0.1 11211 | head -5