Memcached is a general-purpose, free, and open-source software distributed memory caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source must be read.

Prerequisite

For Virtual Machines, install the Linux Agent.

Configuring the credentials

Configure the credentials in the directory /opt/opsramp/agent/conf/app.d/creds.yaml

memcached:
- name: memcached
  user: <username>
  pwd: <Password>
  encoding-type: plain
  labels:
    key1: val1
    key2: val2

Configuring the application

Virtual machine

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-detection.yaml

- name: memcached
  instance-checks:
    service-check:
      - memcache
    process-check:
      - memcache
    port-check:
      - 11211
    detection-pattern: "(process-check && service-check && port-check)"
  freq-secs: "60"

Docker environment

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-container-detection.yaml

- name: memcached
  container-checks:
    image-check:
      - memcached
    port-check:
      - 11211
    detection-pattern: "(image-check && port-check)"
  freq-secs: "60"

Kubernetes environment

Configure the application in config.yaml

- name: memcached
  container-checks:
    image-check:
      - memcached
    port-check:
      - 11211
    detection-pattern: "(image-check && port-check)"
  freq-secs: "60"

Validate

Go to Resources under the Infrastructure tab to check if your resources are onboarded and the metrics are collected.

Metrics

OpsRamp MetricMetric Display NameUnit
memcached_bytes

Current number of bytes used by this server to store items
bytesbytes
memcached_bytes_read

Rate of bytes read from the network by this server
bytes_readbytes / second
memcached_bytes_written

Rate of bytes written to the network by this server
bytes_writtenbytes / second
memcached_cas_badval

Rate at which keys are compared and swapped where the comparison (original) value did not match the supplied value
cas_badvalkeys / second
memcached_cas_hits

Rate at which keys are compared and swapped and found present
cas_hitshits / second
memcached_cas_misses

Rate at which keys are compared and swapped and not found present
cas_missesmisses / second
memcached_cmd_flush

Rate of flush_all commands
cmd_flushcommands / second
memcached_cmd_get

Rate of get commands
cmd_getcommands / second
memcached_cmd_set

Rate of set commands
cmd_setcommands / second
memcached_connection_structures

Number of connection structures allocated by the server
connection_structures
memcached_curr_connections

Number of open connections to this server
curr_connectionsconnection
memcached_curr_items

Current number of items stored by the server
curr_itemsitems
memcached_delete_hits

Rate at which delete commands result in items being removed
delete_hitshits / second
memcached_delete_misses

Rate at which delete commands result in no items being removed
delete_missesmisses / second
memcached_evictions

Rate at which valid items are removed from cache to free memory for new items
evictionsevictions / second
memcached_get_hits

Rate at which keys are requested and found present
get_hitshits / second
memcached_get_misses

Rate at which keys are requested and not found
get_missesmisses / second
memcached_limit_maxbytes

Number of bytes this server is allowed to use for storage
limit_maxbytesmegabytes
memcached_listen_disabled_num

Rate at which the server has reached the maximum connection limit
listen_disabled_numevents / second
memcached_pointer_size

Default size of pointers on the host OS, generally 32 or 64
pointer_sizebits
memcached_rusage_system

Fraction of time the CPU spent executing kernel code on behalf of this server process
rusage_systemfraction
memcached_rusage_user

Fraction of user time the CPU spent executing this server process
rusage_userfraction
memcached_threads

Number of threads used by the current Memcached server process
threadsthread
memcached_total_connections

Rate at which connections to this server are opened
total_connectionsconnection / second
memcached_total_items

Total number of items stored by this server since it started
total_itemsitems
memcached_uptime

Number of minutes this server has been running
uptimeminutes
memcached_items_evicted

Rate at which items had to be evicted from the LRU before expiring
items_evictedeviction/sec
memcached_items_evicted_nonzero

Rate at which nonzero items which had an explicit expiry time set had to be evicted from the LRU before expiring
items_evicted_nonzeroevictions / second
memcached_items_evicted_unfetched

Rate at which expired items reclaimed from the LRU which were never touched after being set
items_evicted_unfetchedevictions / second
memcached_items_expired_unfetched

Rate at which valid items evicted from the LRU which were never touched after being set
items_expired_unfetchedevictions / second
memcached_items_outofmemory

Rate at which the underlying slab class was unable to store a new item
items_outofmemoryerrors / second
memcached_items_tailrepairs

Rate at which memcache self-healed a slab with a refcount leak
items_tailrepairsoperations / second
memcached_items_moves_to_cold

Rate at which items were moved from HOT or WARM into COLD
items_moves_to_colditems / second
memcached_items_moves_to_warm

Rate at which items were moved from COLD to WARM
items_moves_to_warmitems / second
memcached_items_moves_within_lru

Rate at which active items were bumped within HOT or WARM
items_moves_within_lruitems / second
memcached_items_reclaimed

Rate at which entries were stored using memory from an expired entry
items_reclaimedoperations / second
memcached_items_crawler_reclaimed

Rate at which items were freed by the LRU Crawler
items_crawler_reclaimedoperations / second
memcached_items_lrutail_reflocked

Rate at which items found to be refcount locked in the LRU tail
items_lrutail_reflockeditems / second
memcached_items_direct_reclaims

Rate at which worker threads had to directly pull LRU tails to find memory for a new item
items_direct_reclaimsoperations / second
memcached_items_number

Number of items presently stored in this slab class
items_numberitems
memcached_items_number_hot

Number of items presently stored in the HOT LRU
items_number_hotitems
memcached_items_number_warm

Number of items presently stored in the WARM LRU
items_number_warmitems
memcached_items_number_cold

Number of items presently stored in the COLD LRU
items_number_colditems
memcached_items_age

Age of the oldest item in the LRU
items_ageseconds
memcached_items_evicted_time

Time since the last access for the most recent item evicted from this class
items_evicted_timeseconds
memcached_slabs_get_hits

Rate at which GET requests were serviced by this slab class
slabs_get_hitshits / second
memcached_slabs_cmd_set

Rate at which set requests stored data in this slab class
slabs_cmd_setcommands / second
memcached_slabs_delete_hits

Rate at which delete commands succeeded in this slab class
slabs_delete_hitsoperations / second
memcached_slabs_incr_hits

Rate at which incrs commands modified this slab class
slabs_incr_hitsoperations / second
memcached_slabs_decr_hits

Rate at which decrs commands modified this slab class
slabs_decr_hitsoperations / second
memcached_slabs_cas_hits

Rate at which CAS commands modified this slab class
slabs_cas_hitsoperations / second
memcached_slabs_cas_badval

Rate at which CAS commands failed to modify a value due to a bad CAS ID
slabs_cas_badvalkeys / second
memcached_slabs_touch_hits

Rate of touches serviced by this slab class
slabs_touch_hitsoperations / second
memcached_slabs_used_chunks_rate

Rate at which chunks have been allocated to items
slabs_used_chunks_ratebuffer / second
memcached_slabs_chunk_size

Amount of space each chunk uses
slabs_chunk_sizebytes
memcached_slabs_chunks_per_page

Chunks existing in one page
slabs_chunks_per_pagebuffer
memcached_slabs_total_pages

Total number of pages allocated to the slab class
slabs_total_pagespage
memcached_slabs_total_chunks

Total number of chunks allocated to the slab class
slabs_total_chunksbuffer
memcached_slabs_used_chunks

How many chunks have been allocated to items
slabs_used_chunksbuffer
memcached_slabs_free_chunks

Chunks not yet allocated to items or freed via delete
slabs_free_chunksbuffer
memcached_slabs_free_chunks_end

Number of free chunks at the end of the last allocated page
slabs_free_chunks_endbuffer
memcached_slabs_mem_requested

Number of bytes requested to be stored in this slab
slabs_mem_requestedbytes
memcached_slabs_active_slabs

Total number of slab classes allocated
slabs_active_slabsoccurance
memcached_slabs_total_malloced

Total memory allocated to slab pages
slabs_total_mallocedbytes