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 NameUnitDescription
memcached_bytesbytesbytesCurrent number of bytes used by this server to store items
memcached_bytes_readbytes_readbytes / secondRate of bytes read from the network by this server
memcached_bytes_writtenbytes_writtenbytes / secondRate of bytes written to the network by this server
memcached_cas_badvalcas_badvalkeys / secondRate at which keys are compared and swapped where the comparison (original) value did not match the supplied value
memcached_cas_hitscas_hitshits / secondRate at which keys are compared and swapped and found present
memcached_cas_missescas_missesmisses / secondRate at which keys are compared and swapped and not found present
memcached_cmd_flushcmd_flushcommands / secondRate of flush_all commands
memcached_cmd_getcmd_getcommands / secondRate of get commands
memcached_cmd_setcmd_setcommands / secondRate of set commands
memcached_connection_structuresconnection_structuresNumber of connection structures allocated by the server
memcached_curr_connectionscurr_connectionsconnectionNumber of open connections to this server
memcached_curr_itemscurr_itemsitemsCurrent number of items stored by the server
memcached_delete_hitsdelete_hitshits / secondRate at which delete commands result in items being removed
memcached_delete_missesdelete_missesmisses / secondRate at which delete commands result in no items being removed
memcached_evictionsevictionsevictions / secondRate at which valid items are removed from cache to free memory for new items
memcached_get_hitsget_hitshits / secondRate at which keys are requested and found present
memcached_get_missesget_missesmisses / secondRate at which keys are requested and not found
memcached_limit_maxbyteslimit_maxbytesmegabytesNumber of bytes this server is allowed to use for storage
memcached_listen_disabled_numlisten_disabled_numevents / secondRate at which the server has reached the maximum connection limit
memcached_pointer_sizepointer_sizebitsDefault size of pointers on the host OS, generally 32 or 64
memcached_rusage_systemrusage_systemfractionFraction of time the CPU spent executing kernel code on behalf of this server process
memcached_rusage_userrusage_userfractionFraction of user time the CPU spent executing this server process
memcached_threadsthreadsthreadNumber of threads used by the current Memcached server process
memcached_total_connectionstotal_connectionsconnection / secondRate at which connections to this server are opened
memcached_total_itemstotal_itemsitemsTotal number of items stored by this server since it started
memcached_uptimeuptimeminutesNumber of minutes this server has been running
memcached_items_evicteditems_evictedeviction/secRate at which items had to be evicted from the LRU before expiring
memcached_items_evicted_nonzeroitems_evicted_nonzeroevictions / secondRate at which nonzero items which had an explicit expiry time set had to be evicted from the LRU before expiring
memcached_items_evicted_unfetcheditems_evicted_unfetchedevictions / secondRate at which expired items reclaimed from the LRU which were never touched after being set
memcached_items_expired_unfetcheditems_expired_unfetchedevictions / secondRate at which valid items evicted from the LRU which were never touched after being set
memcached_items_outofmemoryitems_outofmemoryerrors / secondRate at which the underlying slab class was unable to store a new item
memcached_items_tailrepairsitems_tailrepairsoperations / secondRate at which memcache self-healed a slab with a refcount leak
memcached_items_moves_to_colditems_moves_to_colditems / secondRate at which items were moved from HOT or WARM into COLD
memcached_items_moves_to_warmitems_moves_to_warmitems / secondRate at which items were moved from COLD to WARM
memcached_items_moves_within_lruitems_moves_within_lruitems / secondRate at which active items were bumped within HOT or WARM
memcached_items_reclaimeditems_reclaimedoperations / secondRate at which entries were stored using memory from an expired entry
memcached_items_crawler_reclaimeditems_crawler_reclaimedoperations / secondRate at which items were freed by the LRU Crawler
memcached_items_lrutail_reflockeditems_lrutail_reflockeditems / secondRate at which items found to be refcount locked in the LRU tail
memcached_items_direct_reclaimsitems_direct_reclaimsoperations / secondRate at which worker threads had to directly pull LRU tails to find memory for a new item
memcached_items_numberitems_numberitemsNumber of items presently stored in this slab class
memcached_items_number_hotitems_number_hotitemsNumber of items presently stored in the HOT LRU
memcached_items_number_warmitems_number_warmitemsNumber of items presently stored in the WARM LRU
memcached_items_number_colditems_number_colditemsNumber of items presently stored in the COLD LRU
memcached_items_ageitems_agesecondsAge of the oldest item in the LRU
memcached_items_evicted_timeitems_evicted_timesecondsTime since the last access for the most recent item evicted from this class
memcached_slabs_get_hitsslabs_get_hitshits / secondRate at which GET requests were serviced by this slab class
memcached_slabs_cmd_setslabs_cmd_setcommands / secondRate at which set requests stored data in this slab class
memcached_slabs_delete_hitsslabs_delete_hitsoperations / secondRate at which delete commands succeeded in this slab class
memcached_slabs_incr_hitsslabs_incr_hitsoperations / secondRate at which incrs commands modified this slab class
memcached_slabs_decr_hitsslabs_decr_hitsoperations / secondRate at which decrs commands modified this slab class
memcached_slabs_cas_hitsslabs_cas_hitsoperations / secondRate at which CAS commands modified this slab class
memcached_slabs_cas_badvalslabs_cas_badvalkeys / secondRate at which CAS commands failed to modify a value due to a bad CAS ID
memcached_slabs_touch_hitsslabs_touch_hitsoperations / secondRate of touches serviced by this slab class
memcached_slabs_used_chunks_rateslabs_used_chunks_ratebuffer / secondRate at which chunks have been allocated to items
memcached_slabs_chunk_sizeslabs_chunk_sizebytesAmount of space each chunk uses
memcached_slabs_chunks_per_pageslabs_chunks_per_pagebufferChunks existing in one page
memcached_slabs_total_pagesslabs_total_pagespageTotal number of pages allocated to the slab class
memcached_slabs_total_chunksslabs_total_chunksbufferTotal number of chunks allocated to the slab class
memcached_slabs_used_chunksslabs_used_chunksbufferHow many chunks have been allocated to items
memcached_slabs_free_chunksslabs_free_chunksbufferChunks not yet allocated to items or freed via delete
memcached_slabs_free_chunks_endslabs_free_chunks_endbufferNumber of free chunks at the end of the last allocated page
memcached_slabs_mem_requestedslabs_mem_requestedbytesNumber of bytes requested to be stored in this slab
memcached_slabs_active_slabsslabs_active_slabsoccuranceTotal number of slab classes allocated
memcached_slabs_total_mallocedslabs_total_mallocedbytesTotal memory allocated to slab pages