跳转至

Memcached

·


Memcached 采集器可以从 Memcached 实例中采集实例运行状态指标,并将指标采集到观测云,帮助监控分析 Memcached 各种异常情况。

配置

前置条件

  • Memcached 版本 >= 1.5.0。已测试的版本:
    • 1.5.x
    • 1.6.x

进入 DataKit 安装目录下的 conf.d/samples 目录,复制 memcached.conf.sample 并命名为 memcached.conf。示例如下:

[[inputs.memcached]]
  ## Servers' addresses.
  servers = ["localhost:11211"]
  # unix_sockets = ["/var/run/memcached.sock"]

  ## Set true to enable election
  election = true

  ## Collect extra stats
  # extra_stats = ["slabs", "items"]

  ## Collect interval.
  # units: "ns", "us", "ms", "s", "m", "h"
  interval = "10s"

[inputs.memcached.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"
  # ...

配置好后,重启 DataKit 即可。

目前可以通过 ConfigMap 方式注入采集器配置来开启采集器。

指标

以下所有数据采集,默认会追加全局选举 tag,也可以在配置中通过 [inputs.memcached.tags] 指定其它标签:

 [inputs.memcached.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"
  # ...

memcached

Tags & Fields Description
server
(tag)
The memcached server address from which metrics are gathered.
accepting_conns Whether the server is currently accepting new connections. 1 means accepting, 0 means not accepting.
Type: int | (gauge)
Unit: N/A
auth_cmds Cumulative number of authentication commands handled, successful or failed.
Type: int | (count)
Unit: count
auth_errors Cumulative number of failed authentications.
Type: int | (count)
Unit: count
bytes Current number of bytes used to store items
Type: int | (gauge)
Unit: digital,B
bytes_read Cumulative bytes read by this server from the network.
Type: int | (count)
Unit: digital,B
bytes_written Cumulative bytes written by this server to the network.
Type: int | (count)
Unit: digital,B
cas_badval Cumulative CAS requests for which a key was found but the CAS value did not match.
Type: int | (count)
Unit: count
cas_hits Cumulative successful CAS requests.
Type: int | (count)
Unit: count
cas_misses Cumulative CAS requests against missing keys.
Type: int | (count)
Unit: count
cmd_flush Cumulative number of flush requests.
Type: int | (count)
Unit: count
cmd_get Cumulative number of retrieval requests.
Type: int | (count)
Unit: count
cmd_set Cumulative number of storage requests.
Type: int | (count)
Unit: count
cmd_touch Cumulative number of touch requests.
Type: int | (count)
Unit: count
conn_yields Cumulative number of times a connection yielded to another connection after hitting the -R limit.
Type: int | (count)
Unit: count
connection_structures Number of connection structures allocated by the server
Type: int | (gauge)
Unit: count
curr_connections Number of open connections
Type: int | (gauge)
Unit: count
curr_items Current number of items stored
Type: int | (gauge)
Unit: count
decr_hits Cumulative successful decr requests.
Type: int | (count)
Unit: count
decr_misses Cumulative decr requests against missing keys.
Type: int | (count)
Unit: count
delete_hits Cumulative delete requests that removed an item.
Type: int | (count)
Unit: count
delete_misses Cumulative delete requests for missing keys.
Type: int | (count)
Unit: count
evicted_unfetched Cumulative items evicted from the LRU that were never fetched after being set.
Type: int | (count)
Unit: count
evictions Cumulative valid items removed from cache to free memory for new items.
Type: int | (count)
Unit: count
expired_unfetched Cumulative expired items reclaimed from the LRU that were never fetched after being set.
Type: int | (count)
Unit: count
get_hits Cumulative keys requested and found present.
Type: int | (count)
Unit: count
get_misses Cumulative requested items that were not found.
Type: int | (count)
Unit: count
hash_bytes Bytes currently used by hash tables
Type: int | (gauge)
Unit: digital,B
hash_is_expanding Whether the hash table is currently being grown to a new size. 1 means expanding, 0 means not expanding.
Type: int | (gauge)
Unit: N/A
hash_power_level Current size multiplier for hash table
Type: int | (gauge)
Unit: count
incr_hits Cumulative successful incr requests.
Type: int | (count)
Unit: count
incr_misses Cumulative incr requests against missing keys.
Type: int | (count)
Unit: count
limit_maxbytes Number of bytes this server is allowed to use for storage
Type: int | (gauge)
Unit: digital,B
listen_disabled_num Cumulative number of times the server stopped accepting new connections after reaching maxconns.
Type: int | (count)
Unit: count
reclaimed Cumulative entries stored using memory reclaimed from an expired entry.
Type: int | (count)
Unit: count
threads Number of worker threads requested
Type: int | (gauge)
Unit: count
total_connections Cumulative connections opened since the server started.
Type: int | (count)
Unit: count
total_items Cumulative items stored since the server started.
Type: int | (count)
Unit: count
touch_hits Cumulative keys touched with a new expiration time.
Type: int | (count)
Unit: count
touch_misses Cumulative touch requests for items that were not found.
Type: int | (count)
Unit: count
uptime Seconds since the server started.
Type: int | (gauge)
Unit: time,s

memcached_items

Tags & Fields Description
server
(tag)
The memcached server address from which metrics are gathered.
slab_id
(tag)
Slab class ID from the stats items key.
age Age in seconds of the oldest item in the LRU for this slab class.
Type: int | (gauge)
Unit: time,s
crawler_reclaimed Cumulative items freed by the LRU crawler.
Type: int | (count)
Unit: count
direct_reclaims Cumulative worker threads that directly pulled LRU tails to find memory for a new item.
Type: int | (count)
Unit: count
evicted Cumulative items evicted from this slab class before expiring.
Type: int | (count)
Unit: count
evicted_nonzero Cumulative evicted items from this slab class that had an explicit non-zero expiration time.
Type: int | (count)
Unit: count
evicted_time Seconds since the last access for the most recent item evicted from this class
Type: int | (gauge)
Unit: time,s
evicted_unfetched Cumulative valid items evicted from this slab class that were never fetched after being set.
Type: int | (count)
Unit: count
expired_unfetched Cumulative expired items reclaimed from this slab class that were never fetched after being set.
Type: int | (count)
Unit: count
lrutail_reflocked Cumulative items found to be refcount locked in the LRU tail.
Type: int | (count)
Unit: count
moves_to_cold Cumulative items moved from HOT or WARM into COLD.
Type: int | (count)
Unit: count
moves_to_warm Cumulative items moved from COLD to WARM.
Type: int | (count)
Unit: count
moves_within_lru Cumulative active items bumped within HOT or WARM.
Type: int | (count)
Unit: count
number Number of items presently stored in this slab class
Type: int | (gauge)
Unit: count
number_cold Number of items presently stored in the COLD LRU
Type: int | (gauge)
Unit: count
number_hot Number of items presently stored in the HOT LRU
Type: int | (gauge)
Unit: count
number_noexp Number of items presently stored in the NOEXP class
Type: int | (gauge)
Unit: count
number_warm Number of items presently stored in the WARM LRU
Type: int | (gauge)
Unit: count
outofmemory Cumulative times this slab class could not store a new item due to memory pressure.
Type: int | (count)
Unit: count
reclaimed Cumulative entries stored using memory reclaimed from an expired entry.
Type: int | (count)
Unit: count
tailrepairs Cumulative self-healing repairs for slab items with leaked refcount references.
Type: int | (count)
Unit: count

memcached_slabs

Tags & Fields Description
server
(tag)
The memcached server address from which metrics are gathered.
slab_id
(tag)
Slab class ID from the stats slabs key.
active_slabs Total number of slab classes allocated
Type: int | (gauge)
Unit: count
cas_badval Cumulative CAS commands that failed to modify a value due to a bad CAS ID.
Type: int | (count)
Unit: count
cas_hits Cumulative CAS commands that modified this slab class.
Type: int | (count)
Unit: count
chunk_size The amount of space each chunk uses
Type: int | (gauge)
Unit: digital,B
chunks_per_page How many chunks exist within one page
Type: int | (gauge)
Unit: count
cmd_set Cumulative set requests that stored data in this slab class.
Type: int | (count)
Unit: count
decr_hits Cumulative decr commands that modified this slab class.
Type: int | (count)
Unit: count
delete_hits Cumulative successful delete commands in this slab class.
Type: int | (count)
Unit: count
free_chunks Chunks not yet allocated to items or freed via delete
Type: int | (gauge)
Unit: count
free_chunks_end Number of free chunks at the end of the last allocated page
Type: int | (gauge)
Unit: count
get_hits Cumulative get requests serviced by this slab class.
Type: int | (count)
Unit: count
incr_hits Cumulative incr commands that modified this slab class.
Type: int | (count)
Unit: count
total_chunks Total number of chunks allocated to the slab class
Type: int | (gauge)
Unit: count
total_malloced Total amount of memory allocated to slab pages
Type: int | (gauge)
Unit: digital,B
total_pages Total number of pages allocated to the slab class
Type: int | (gauge)
Unit: count
touch_hits Cumulative touch commands serviced by this slab class.
Type: int | (count)
Unit: count
used_chunks How many chunks have been allocated to items
Type: int | (gauge)
Unit: count

文档评价

文档内容是否对您有帮助? ×