Memcache
Rapport de recherche Datadog : Bilan sur l'adoption de l'informatique sans serveur Rapport : Bilan sur l'adoption de l'informatique sans serveur

Memcache

Agent Check Check de l'Agent

Supported OS: Linux Mac OS

Présentation

Le check Memcache de l’Agent vous permet de surveiller l’utilisation de la mémoire, les hits, les miss, les expulsions, le pourcentage de remplissage et d’autres métriques pour Memcache.

Configuration

Installation

Le check Memcache est inclus avec le package de l’Agent Datadog : vous n’avez donc rien d’autre à installer sur vos serveurs Memcache.

Configuration

Suivez les instructions ci-dessous pour installer et configurer ce check lorsque l’Agent est exécuté sur un host. Consultez la section Environnement conteneurisé pour en savoir plus sur les environnements conteneurisés.

Collecte de métriques

Host
  1. Modifiez le fichier mcache.d/conf.yaml dans le dossier conf.d/ à la racine du répertoire de configuration de votre Agent. Consultez le fichier d’exemple mcache.d/conf.yaml pour découvrir toutes les options de configuration disponibles :

    init_config:
    
    instances:
     ## @param url - string - required
     ## url used to connect to the Memcached instance.
     #
     - url: localhost
  2. Redémarrez l’Agent pour commencer à envoyer vos métriques Memcache à Datadog.

Collecte de traces

L’APM Datadog s’intègre à Memcache pour vous permettre de visualiser les traces sur l’ensemble de votre système distribué. La collecte de traces est activée par défaut dans les versions 6 et ultérieures de l’Agent Datadog. Pour commencer à recueillir des traces :

  1. Activez la collecte de trace dans Datadog.
  2. Instrumentez l’application qui envoie des requêtes à Memcache.
Environnement conteneurisé

Consultez la documentation relative aux modèles d’intégration Autodiscovery pour découvrir comment appliquer les paramètres ci-dessous à un environnement conteneurisé.

ParamètreValeur
<NOM_INTÉGRATION>mcache
<CONFIG_INIT>vide ou {}
<CONFIG_INSTANCE>{"url": "%%host%%","port": "11211"}
Collecte de traces

L’APM dédié aux applications conteneurisées est pris en charge par les hosts exécutant les versions 6 et ultérieures de l’Agent, mais nécessite une configuration supplémentaire pour recueillir des traces.

Variables d’environnement requises sur le conteneur de l’Agent :

ParamètreValeur
<DD_API_KEY>api_key
<DD_APM_ENABLED>true
<DD_APM_NON_LOCAL_TRAFFIC>true

Consultez les sections Tracing d’applications Kubernetes et Configuration de DaemonSet Kubernetes pour consulter la liste complète des variables d’environnement et configurations disponibles.

Ensuite, instrumentez le conteneur de votre application et définissez DD_AGENT_HOST sur le nom de votre conteneur d’Agent.

Collecte de logs

Disponible à partir des versions > 6.0 de l’Agent

  1. Ajoutez ce bloc de configuration à votre fichier mcache.d/conf.yaml pour commencer à recueillir vos logs Memcached :

    logs:
     - type: file
       path: /var/log/memcached.log
       source: memcached
       service: mcache

    Modifiez les valeurs des paramètres path et service et configurez-les pour votre environnement.

  2. Redémarrez l’Agent pour appliquer ces changements.

Validation

Lancez la sous-commande status de l’Agent et cherchez mcache dans la section Checks.

Données collectées

Métriques

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.
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 since the start of the memcache server.
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 time the CPU spent executing kernel code on behalf of this server process.
Shown as fraction
memcache.rusage_user_rate
(gauge)
Fraction of user time the CPU spent executing 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

Le check recueille uniquement les métriques memcache.slabs.* si vous définissez options.slabs: true dans le fichier mcache.d/conf.yaml. De même, il ne recueille les métriques memcache.items.* que si vous définissez options.items: true.

Événements

Le check Mcache n’inclut aucun événement.

Checks de service

memcache.can_connect :

Renvoie CRITICAL si l’Agent ne parvient pas à se connecter à Memcache pour recueillir des métriques. Si ce n’est pas le cas, renvoie OK.

Dépannage

Besoin d’aide ? Contactez l’assistance Datadog.

Pour aller plus loin