如何监控 memcached 上的“添加”命令的数量

如何监控 memcached 上的“添加”命令的数量

因此 memcached 提供了大量统计数据来跟踪使用情况(命中和未命中)。

示例输出 -

stats
STAT pid 1
STAT uptime 982226
STAT time 1630949306
STAT version 1.6.6
STAT libevent 2.0.21-stable
STAT pointer_size 64
STAT rusage_user 18.366158
STAT rusage_system 19.678998
STAT max_connections 65000
STAT curr_connections 7
STAT total_connections 3953
STAT connection_structures 17
STAT response_obj_bytes 2480
STAT response_obj_total 2
STAT response_obj_free 1
STAT response_obj_oom 0
STAT read_buf_bytes 32768
STAT read_buf_bytes_free 16384
STAT read_buf_oom 0
STAT reserved_fds 10
STAT cmd_get 8
STAT cmd_set 3980
STAT cmd_flush 0
STAT cmd_touch 0
STAT cmd_config_get 65475
STAT cmd_config_set 1
STAT cmd_meta 0
STAT get_hits 0
STAT get_misses 8
STAT get_expired 0
STAT get_flushed 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT touch_hits 0
STAT touch_misses 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 4273871
STAT bytes_written 94622147
STAT limit_maxbytes 13932429312
STAT launch_time_maxbytes 13932429312
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT time_in_listen_disabled_us 0
STAT threads 2
STAT conn_yields 0
STAT hash_power_level 16
STAT hash_bytes 524288
STAT hash_is_expanding 0
STAT curr_config 1
STAT malloc_fails 0
STAT log_worker_dropped 0
STAT log_worker_written 0
STAT log_watcher_skipped 0
STAT log_watcher_sent 0
STAT bytes 9202
STAT curr_items 50
STAT total_items 3939
STAT slab_global_page_pool 0
STAT expired_unfetched 3889
STAT evicted_unfetched 0
STAT evictions 0
STAT reclaimed 3889
STAT crawler_reclaimed 0
STAT crawler_items_checked 0
STAT lrutail_reflocked 0

此列表中包含有关 get、delete、incr、delete 的统计数据。但是,我的应用程序广泛使用了添加并且当更新失败时,没有任何具体的指标来显示。

我如何检查实际添加了多少以及未添加多少?

请注意,我可以通过应用程序执行此操作 - 通过日志记录等,但我正在寻找一种从 memcached 的监控指标中获取此功能的方法。

这可能吗?

相关内容