Memcached
Memcached is a high-performance, distributed in-memory caching system.
Auto-Detection
Section titled “Auto-Detection”Glouton detects Memcached by its process and listening port (default: 11211).
If auto-detected parameters are incorrect, override them manually:
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: 11211EOFCreate or edit C:\ProgramData\glouton\conf.d\99-memcached.conf:
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: 11211Glouton automatically detects configuration changes.
Service Check
Section titled “Service Check”Glouton performs a Memcached protocol check on the configured port to verify that the server is responding.
Built-in Metrics
Section titled “Built-in Metrics”| Metric | Description |
|---|---|
service_status | Status of Memcached |
memcached_command_get | Number of get requests per second |
memcached_command_set | Number of set requests per second |
memcached_connections_current | Number of client connections to Memcached |
memcached_items_current | Current number of items stored |
memcached_octets_rx | Network traffic received by Memcached in bytes per second |
memcached_octets_tx | Network traffic sent by Memcached in bytes per second |
memcached_ops_cas_hits | Number of successful CAS (Check-And-Set) requests per second |
memcached_ops_cas_misses | Number of CAS requests against missing keys per second |
memcached_ops_decr_hits | Number of successful decrement requests per second |
memcached_ops_decr_misses | Number of decrement requests against missing keys per second |
memcached_ops_delete_hits | Number of successful delete requests per second |
memcached_ops_delete_misses | Number of delete requests against missing keys per second |
memcached_ops_evictions | Number of items evicted to free memory for new items per second |
memcached_ops_get_hits | Number of successful get requests per second |
memcached_ops_get_misses | Number of get requests against missing keys per second |
memcached_ops_incr_hits | Number of successful increment requests per second |
memcached_ops_incr_misses | Number of increment requests against missing keys per second |
memcached_ops_touch_hits | Number of successful touch requests per second |
memcached_ops_touch_misses | Number of touch requests against missing keys per second |
memcached_percent_hitratio | Hit ratio of get requests in percent |
memcached_ps_count_threads | Number of worker threads |
memcached_uptime | Time since Memcached server start in seconds |
Monitoring Troubleshooting
Section titled “Monitoring Troubleshooting”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.
The Service Check is not OK
Section titled “The Service Check is not OK”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 are Missing
Section titled “Metrics are Missing”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.
printf 'stats\r\n' | nc -w 2 127.0.0.1 11211 | head -5