如何監控 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 的監控指標中獲取此資訊。

這可能嗎?

相關內容