日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux memcached 运行,linux下查看Memcached运行状态

發布時間:2023/12/2 linux 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux memcached 运行,linux下查看Memcached运行状态 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

查看Memcached運行狀態的命令是:echo stats | nc 127.0.0.1 11211 查看memcached狀態的基本命令,通過這個命令可以看到如下信息: STAT pid 22459 進程ID STAT uptime 1027046 服務器運行秒數 STAT time 1273043062 服務器當前unix時間戳 STAT version 1.4.

查看Memcached運行狀態的命令是:echo stats | nc 127.0.0.1 11211

查看memcached狀態的基本命令,通過這個命令可以看到如下信息:

STAT pid 22459 進程ID

STAT uptime 1027046 服務器運行秒數

STAT time 1273043062 服務器當前unix時間戳

STAT version 1.4.4 服務器版本

STAT pointer_size 64 操作系統字大小(這臺服務器是64位的)

STAT rusage_user 0.040000 進程累計用戶時間

STAT rusage_system 0.260000 進程累計系統時間

STAT curr_connections 10 當前打開連接數

STAT total_connections 82 曾打開的連接總數

STAT connection_structures 13 服務器分配的連接結構數

STAT cmd_get 54 執行get命令總數

STAT cmd_set 34 執行set命令總數

STAT cmd_flush 3 指向flush_all命令總數

STAT get_hits 9 get命中次數

STAT get_misses 45 get未命中次數

STAT delete_misses 5 delete未命中次數

STAT delete_hits 1 delete命中次數

STAT incr_misses 0 incr未命中次數

STAT incr_hits 0 incr命中次數

STAT decr_misses 0 decr未命中次數

STAT decr_hits 0 decr命中次數

STAT cas_misses 0 cas未命中次數

STAT cas_hits 0 cas命中次數

STAT cas_badval 0 使用擦拭次數

STAT auth_cmds 0

STAT auth_errors 0

STAT bytes_read 15785 讀取字節總數

STAT bytes_written 15222 寫入字節總數

STAT limit_maxbytes 1048576 分配的內存數(字節)

STAT accepting_conns 1 目前接受的鏈接數

STAT listen_disabled_num 0

STAT threads 4 線程數

STAT conn_yields 0

STAT bytes 0 存儲item字節數

STAT curr_items 0 item個數

STAT total_items 34 item總數

STAT evictions 0 為獲取空間刪除item的總數

stats items

輸出各個slab中的item信息。s

stats slabs

輸出slab中更詳細的item信息

stats sizes

輸出所有item的大小和個數

stats cachedump

根據輸出相同的中的item信息。是輸出的個數,當為0是輸出所有的item。

利用shell命令操作Memcached

1、數據存儲(假設key為g,value為12345)

printf “set g 0 0 5\r\n12345\r\n”|nc 127.0.0.1 11211

STORED

2、數據取回(假設key為zhangyan)

printf “get g\r\n”|nc 127.0.0.1 11211

VALUE g 0 5

12345

END

3、數值增加1(假設key為g,并且value為正整數)

printf “incr g 1\r\n” | nc 127.0.0.1 11211

12346

4、數值減少3(假設key為g,并且value為正整數)

printf “decr g 3\r\n” | nc 127.0.0.1 11211

12343

5、數據刪除(假設key為g)

printf “delete g\r\n” | nc 127.0.0.1 11211

DELETED

6、查看Memcached狀態

printf “stats\r\n” | nc 127.0.0.1 11211

STAT pid 3025

STAT uptime 4120500

STAT time 1228021767

STAT version 1.2.6

STAT pointer_size 32

STAT rusage_user 433.463103

STAT rusage_system 1224.515845

STAT curr_items 1132460

STAT total_items 8980260

STAT bytes 1895325386

STAT curr_connections 252

STAT total_connections 547850

STAT connection_structures 1189

STAT cmd_get 13619685

STAT cmd_set 8980260

STAT get_hits 6851607

STAT get_misses 6768078

STAT evictions 0

STAT bytes_read 160396238246

STAT bytes_written 260080686529

STAT limit_maxbytes 2147483648

STAT threads 1

END

7、模擬top命令,查看Memcached狀態:

watch “printf ‘stats\r\n’ | nc 127.0.0.1 11211″

或者

watch “echo stats | nc 127.0.0.1 11211″

一、echo stats items | nc127.0.0.1 11211

STAT items:1:number 998 Slab Id=1 ; items數量:998(也就是已經存儲了998個key值)

STAT items:1:age 604348 Slab Id=1 ; 已經存在時間,單位秒

STAT items:1:evicted 0 Slab Id=1 ; 被踢出的數量

STAT items:1:evicted_nonzero 0

STAT items:1:evicted_time 0

STAT items:1:outofmemory 0

STAT items:1:tailrepairs 0

STAT items:1:reclaimed 0

STAT items:6:number 91897 Slab Id=6 ; items數量:91897(也就是已經存儲了91897個key值)

STAT items:6:age 604345 Slab Id=6 ; 已經存在時間,單位秒

STAT items:6:evicted 0 Slab Id=6 ; 被踢出的數量

STAT items:6:evicted_nonzero 0

STAT items:6:evicted_time 0

STAT items:6:outofmemory 0

STAT items:6:tailrepairs 0

STAT items:6:reclaimed 0

總結

以上是生活随笔為你收集整理的linux memcached 运行,linux下查看Memcached运行状态的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。