Supported OS Linux Mac OS

インテグレーションバージョン4.1.0

概要

Agent の Memcache チェックを使用して、Memcache のメモリ使用量、ヒット数、ミス数、エビクション数、フィルパーセンテージなどを追跡します。

セットアップ

インストール

Memcache チェックは Datadog Agent パッケージに含まれています。Memcache サーバーに追加でインストールする必要はありません。

構成

ホストで実行されている Agent 用にこのチェックを構成する場合は、以下の手順に従ってください。コンテナ環境の場合は、コンテナ化セクションを参照してください。

Memcache サーバーを起動する際に、バインディングプロトコル -Bbinary または auto に設定します。自動 (auto) がデフォルトです。

メトリクスの収集

ホスト

ホストで実行中の Agent に対してこのチェックを構成するには

  1. Agent のコンフィギュレーションディレクトリのルートにある conf.d/ フォルダーの mcache.d/conf.yaml ファイルを編集します。使用可能なすべてのコンフィギュレーションオプションについては、サンプル mcache.d/conf.yaml を参照してください。

    init_config:
    
    instances:
      ## @param url - string - required
      ## url used to connect to the Memcached instance.
      #
      - url: localhost
    
  2. Agent を再起動すると、Datadog への Memcache メトリクスの送信が開始されます。

トレースの収集

Datadog APM は、Memcache と統合して分散システム全体のトレースを確認します。Datadog Agent v6 以降では、トレースの収集はデフォルトで有効化されています。トレースの収集を開始するには、以下の手順に従います。

  1. Datadog でトレースの収集を有効にします
  2. Memcache へのリクエストを作成するアプリケーションをインスツルメントします

コンテナ化

コンテナ環境の場合は、オートディスカバリーのインテグレーションテンプレートのガイドを参照して、次のパラメーターを適用してください。

パラメーター
<INTEGRATION_NAME>mcache
<INIT_CONFIG>空白または {}
<INSTANCE_CONFIG>{"url": "%%host%%","port": "11211"}
トレースの収集

コンテナ化されたアプリケーションの APM は、Agent v6 以降を実行するホストでサポートされていますが、トレースの収集を開始するには、追加のコンフィギュレーションが必要です。

Agent コンテナで必要な環境変数

パラメーター
<DD_API_KEY>api_key
<DD_APM_ENABLED>true
<DD_APM_NON_LOCAL_TRAFFIC>true

利用可能な環境変数とコンフィギュレーションの完全なリストについては、Kubernetes アプリケーションのトレースおよび Kubernetes Daemon のセットアップを参照してください。

次に、アプリケーションコンテナをインスツルメントし、Agent コンテナの名前に DD_AGENT_HOST を設定します。

ログ収集

Agent バージョン 6.0 以降で利用可能

  1. このコンフィギュレーションブロックを mcache.d/conf.yaml ファイルに追加すると、Memcached ログの収集を開始します。

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

    path パラメーターと service パラメーターの値を変更し、環境に合わせて構成します。

  2. Agent を再起動して、変更を検証します。

検証

Agent の status サブコマンドを実行し、Checks セクションで mcache を探します。

収集データ

メトリクス

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.items.age
(gauge)
Age of the oldest item in the LRU
Shown as second
memcache.items.crawler_reclaimed_rate
(gauge)
Rate at which items freed by the LRU Crawler
Shown as operation
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.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.evicted_rate
(gauge)
Rate at which items had to be evicted from the LRU before expiring
Shown as eviction
memcache.items.evicted_time
(gauge)
Seconds since the last access for the most recent item evicted from this class
Shown as second
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.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.lrutail_reflocked_rate
(gauge)
Rate at which items found to be refcount locked in the LRU tail
Shown as item
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.number
(gauge)
Number of items presently stored in this slab class
Shown as item
memcache.items.number_cold
(gauge)
Number of items presently stored in the COLD LRU
Shown as item
memcache.items.number_hot
(gauge)
Number of items presently stored in the HOT LRU
Shown as item
memcache.items.number_noexp
(gauge)
Number of items presently stored in the NOEXP class
Shown as item
memcache.items.number_warm
(gauge)
Number of items presently stored in the WARM LRU
Shown as item
memcache.items.outofmemory_rate
(gauge)
Rate at which the underlying slab class was unable to store a new item
Shown as error
memcache.items.reclaimed_rate
(gauge)
Rate at which entries were stored using memory from an expired entry
Shown as operation
memcache.items.tailrepairs_rate
(gauge)
Rate at which memcache self-healed a slab with a refcount leak
Shown as operation
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.max_connections
(gauge)
Maximum number of connections to this server.
Shown as connection
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.slabs.active_slabs
(gauge)
Total number of slab classes allocated
Shown as occurrence
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.cas_hits_rate
(gauge)
Rate at which CAS commands modified this slab class
Shown as operation
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.cmd_set_rate
(gauge)
Rate at which set requests stored data in this slab class
Shown as command
memcache.slabs.decr_hits_rate
(gauge)
Rate at which decrs commands modified this slab class
Shown as operation
memcache.slabs.delete_hits_rate
(gauge)
Rate at which delete commands succeeded in this slab class
Shown as operation
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.get_hits_rate
(gauge)
Rate at which get requests were serviced by this slab class
Shown as hit
memcache.slabs.incr_hits_rate
(gauge)
Rate at which incrs commands modified this slab class
Shown as operation
memcache.slabs.mem_requested
(gauge)
Number of bytes requested to be stored in this slab
Shown as byte
memcache.slabs.total_chunks
(gauge)
Total number of chunks allocated to the slab class
Shown as buffer
memcache.slabs.total_malloced
(gauge)
Total amount of memory allocated to slab pages
Shown as byte
memcache.slabs.total_pages
(gauge)
Total number of pages allocated to the slab class
Shown as page
memcache.slabs.touch_hits_rate
(gauge)
Rate of touches serviced by this slab class
Shown as operation
memcache.slabs.used_chunks
(gauge)
How many chunks have been allocated to items
Shown as buffer
memcache.slabs.used_chunks_rate
(gauge)
Rate at which chunks have been allocated to items
Shown as buffer
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

mcache.d/conf.yamloptions.slabs: true と設定している場合、チェックは memcache.slabs.* メトリクスのみを収集します。同様に、options.items: true と設定している場合、チェックは memcache.items.* メトリクスのみを収集します。

イベント

Mcache チェックには、イベントは含まれません。

サービスチェック

memcache.can_connect
Returns CRITICAL if the Agent is unable to connect to the monitored Memcached instance. Returns OK otherwise.
Statuses: ok, critical

トラブルシューティング

ご不明な点は、Datadog のサポートチームまでお問合せください。

その他の参考資料