Datadog-Memcached Integration

Overview

The Agent’s memcache check lets you track memcache’s memory use, hits, misses, evictions, fill percent, and much more.

Setup

Installation

The memcache check is packaged with the Agent, so simply install the Agent on your memcache servers. If you need the newest version of the check, install the dd-check-mcache package.

Configuration

Create a file mcache.yaml in the Agent’s conf.d directory.See the sample mcache.yaml for all available configuration options:

init_config:

instances:
  - url: localhost  # url used to connect to the memcached instance
    port: 11212 # optional; default is 11211
#    socket: /path/to/memcache/socket # alternative to url/port; 'dd-agent' user must have read/write permission
    options:
      items: false # set to true to collect items stats
      slabs: false # set to true to collect slabs stats
#    tags:
#    - optional_tag

Restart the Agent to begin sending memcache metrics to Datadog.

Validation

Run the Agent’s info subcommand and look for mcache under the Checks section:

  Checks
  ======
    [...]

    mcache
    -------
      - instance #0 [OK]
      - Collected 26 metrics, 0 events & 1 service check

    [...]

Compatibility

The memcache check is compatible with all major platforms.

Data Collected

Metrics

memcache.avg_item_size
(gauge)
The average size of an item.
shown as byte
memcache.bytes
(gauge)
Current number of bytes used by this server to store items.
shown as byte
memcache.bytes_read_rate
(gauge)
Rate of bytes read from the network by this server.
shown as byte
memcache.bytes_written_rate
(gauge)
Rate of bytes written to the network by this server.
shown as byte
memcache.cas_badval_rate
(gauge)
Rate at which keys are compared and swapped where the comparison (original) value did not match the supplied value.
shown as key
memcache.cas_hits_rate
(gauge)
Rate at which keys are compared and swapped and found present.
shown as hit
memcache.cas_misses_rate
(gauge)
Rate at which keys are compared and swapped and not found present.
shown as miss
memcache.cmd_flush_rate
(gauge)
Rate of "flush_all" commands.
shown as command
memcache.cmd_get_rate
(gauge)
Rate of "get" commands.
shown as command
memcache.cmd_set_rate
(gauge)
Rate of "set" commands.
shown as command
memcache.connection_structures
(gauge)
Number of connection structures allocated by the server.
shown as
memcache.curr_connections
(gauge)
Number of open connections to this server.
shown as connection
memcache.curr_items
(gauge)
Current number of items stored by the server.
shown as item
memcache.delete_hits_rate
(gauge)
Rate at which delete commands result in items being removed.
shown as hit
memcache.delete_misses_rate
(gauge)
Rate at which delete commands result in no items being removed.
shown as miss
memcache.evictions_rate
(gauge)
Rate at which valid items are removed from cache to free memory for new items.
shown as eviction
memcache.fill_percent
(gauge)
Amount of memory being used by the server for storing items as a percentage of the max allowed.
shown as percent
memcache.get_hit_percent
(gauge)
Percentage of requested keys that are found present.
shown as percent
memcache.get_hits_rate
(gauge)
Rate at which keys are requested and found present.
shown as hit
memcache.get_misses_rate
(gauge)
Rate at which keys are requested and not found.
shown as miss
memcache.limit_maxbytes
(gauge)
Number of bytes this server is allowed to use for storage.
shown as byte
memcache.listen_disabled_num_rate
(gauge)
Rate at which the server has reached the max connection limit.
shown as event
memcache.pointer_size
(gauge)
Default size of pointers on the host OS (generally 32 or 64)
shown as bit
memcache.rusage_system_rate
(gauge)
Fraction of user time the CPU spent executing this server process.
shown as fraction
memcache.rusage_user_rate
(gauge)
Fraction of time the CPU spent executing kernel code on behalf of this server process.
shown as fraction
memcache.threads
(gauge)
Number of threads used by the current Memcached server process.
shown as thread
memcache.total_connections_rate
(gauge)
Rate at which connections to this server are opened.
shown as connection
memcache.total_items
(gauge)
Total number of items stored by this server since it started.
shown as item
memcache.uptime
(gauge)
Number of seconds this server has been running.
shown as second
memcache.items.evicted_rate
(gauge)
Rate st which items had to be evicted from the LRU before expiring
shown as eviction
memcache.items.evicted_nonzero_rate
(gauge)
Rate at which nonzero items which had an explicit expire time set had to be evicted from the LRU before expiring
shown as eviction
memcache.items.expired_unfetched_rate
(gauge)
Rate at which expired items reclaimed from the LRU which were never touched after being set
shown as eviction
memcache.items.evicted_unfetched_rate
(gauge)
Rate at which valid items evicted from the LRU which were never touched after being set
shown as eviction
memcache.items.outofmemory_rate
(gauge)
Rate at which the underlying slab class was unable to store a new item
shown as error
memcache.items.tailrepairs_rate
(gauge)
Rate at which memcache self-healed a slab with a refcount leak
shown as operation
memcache.items.moves_to_cold_rate
(gauge)
Rate at which items were moved from HOT or WARM into COLD
shown as item
memcache.items.moves_to_warm_rate
(gauge)
Rate at which items were moved from COLD to WARM
shown as item
memcache.items.moves_within_lru_rate
(gauge)
Rate at which active items were bumped within HOT or WARM
shown as item
memcache.items.reclaimed_rate
(gauge)
Rate at which entries were stored using memory from an expired entry
shown as operation
memcache.items.crawler_reclaimed_rate
(gauge)
Rate at which items freed by the LRU Crawler
shown as operation
memcache.items.lrutail_reflocked_rate
(gauge)
Rate at which items found to be refcount locked in the LRU tail
shown as item
memcache.items.direct_reclaims_rate
(gauge)
Rate at which worker threads had to directly pull LRU tails to find memory for a new item
shown as operation
memcache.items.number
(gauge)
Number of items presently stored in this slab class
shown as item
memcache.items.number_hot
(gauge)
Number of items presently stored in the HOT LRU
shown as item
memcache.items.number_warm
(gauge)
Number of items presently stored in the WARM LRU
shown as item
memcache.items.number_cold
(gauge)
Number of items presently stored in the COLD LRU
shown as item
memcache.items.number_noexp
(gauge)
Number of items presently stored in the NOEXP class
shown as item
memcache.items.age
(gauge)
Age of the oldest item in the LRU
shown as second
memcache.items.evicted_time
(gauge)
Seconds since the last access for the most recent item evicted from this class
shown as second
memcache.slabs.get_hits_rate
(gauge)
Rate at which get requests were serviced by this slab class
shown as hit
memcache.slabs.cmd_set_rate
(gauge)
Rate at which set requests stored data in this slab class
shown as command
memcache.slabs.delete_hits_rate
(gauge)
Rate at which delete commands succeeded in this slab class
shown as operation
memcache.slabs.incr_hits_rate
(gauge)
Rate at which incrs commands modified this slab class
shown as operation
memcache.slabs.decr_hits_rate
(gauge)
Rate at which decrs commands modified this slab class
shown as operation
memcache.slabs.cas_hits_rate
(gauge)
Rate at which CAS commands modified this slab class
shown as operation
memcache.slabs.cas_badval_rate
(gauge)
Rate at which CAS commands failed to modify a value due to a bad CAS id
shown as key
memcache.slabs.touch_hits_rate
(gauge)
Rate of touches serviced by this slab class
shown as operation
memcache.slabs.used_chunks_rate
(gauge)
Rate at which chunks have been allocated to items
shown as buffer
memcache.slabs.chunk_size
(gauge)
The amount of space each chunk uses
shown as byte
memcache.slabs.chunks_per_page
(gauge)
How many chunks exist within one page
shown as buffer
memcache.slabs.total_pages
(gauge)
Total number of pages allocated to the slab class
shown as page
memcache.slabs.total_chunks
(gauge)
Total number of chunks allocated to the slab class
shown as buffer
memcache.slabs.used_chunks
(gauge)
How many chunks have been allocated to items
shown as buffer
memcache.slabs.free_chunks
(gauge)
Chunks not yet allocated to items or freed via delete
shown as buffer
memcache.slabs.free_chunks_end
(gauge)
Number of free chunks at the end of the last allocated page
shown as buffer
memcache.slabs.mem_requested
(gauge)
Number of bytes requested to be stored in this slab
shown as byte
memcache.slabs.active_slabs
(gauge)
Total number of slab classes allocated
shown as occurrence
memcache.slabs.total_malloced
(gauge)
Total amount of memory allocated to slab pages
shown as byte

The check only collects memcache.slabs.* metrics if you set options.slabs: true in mcache.yaml. Likewise, it only collects memcache.items.* metrics if you set options.items: true.

Events

The Mcache check does not include any event at this time.

Service Checks

memcache.can_connect:

Returns CRITICAL if the Agent cannot connect to memcache to collect metrics, otherwise OK.

Troubleshooting

Need help? Contact Datadog Support.

Further Reading