国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

linux下命令行查看Memcached運行狀態(tài)

2016-01-21 17:01:04 6661

stats
查看memcached狀態(tài)的基本命令,通過(guò)這個(gè)命令可以看到如下信息:
STAT pid 22459                             進(jìn)程ID
STAT uptime 1027046                        服務(wù)器運行秒數
STAT time 1273043062                       服務(wù)器當前unix時(shí)間戳
STAT version 1.4.4                         服務(wù)器版本
STAT pointer_size 64                       操作系統字大小(這臺服務(wù)器是64位的)
STAT rusage_user 0.040000                  進(jìn)程累計用戶(hù)時(shí)間
STAT rusage_system 0.260000                進(jìn)程累計系統時(shí)間
STAT curr_connections 10                   當前打開(kāi)連接數
STAT total_connections 82                  曾打開(kāi)的連接總數
STAT connection_structures 13              服務(wù)器分配的連接結構數
STAT cmd_get 54                            執行g(shù)et命令總數
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                   寫(xiě)入字節總數
STAT limit_maxbytes 1048576                分配的內存數(字節)
STAT accepting_conns 1                     目前接受的鏈接數
STAT listen_disabled_num 0                 
STAT threads 4                             線(xiàn)程數
STAT conn_yields 0
STAT bytes 0                               存儲item字節數
STAT curr_items 0                          item個(gè)數
STAT total_items 34                        item總數
STAT evictions 0                           為獲取空間刪除item的總數
 

stats items
輸出各個(gè)slab中的item信息。s
stats slabs
輸出slab中更詳細的item信息
stats sizes
輸出所有item的大小和個(gè)數
stats cachedump <slab_id> <limit_num>

根據<slab_id>輸出相同的<slab_id>中的item信息。<limit_num>是輸出的個(gè)數,當<limit_num>為0是輸出所有的item。

利用shell命令操作Memcached
1、數據存儲(假設key為g,value為12345) 
   
 printf "set g 0 0 5 12345 "|nc 127.0.0.1 11211
    STORED
    2、數據取回(假設key為zhangyan)

printf "get g "|nc 127.0.0.1 11211
    VALUE g 0 5
     12345
     END
    3、數值增加1(假設key為g,并且value為正整數)
   
 printf "incr g 1 " | nc 127.0.0.1 11211
    12346
    4、數值減少3(假設key為g,并且value為正整數)
 
 printf "decr g  3 " | nc 127.0.0.1 11211
    12343
    5、數據刪除(假設key為g)
   
 printf "delete g " | nc 127.0.0.1 11211
    DELETED
    6、查看Memcached狀態(tài)
 
 printf "stats " | 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狀態(tài):
 
 watch "printf stats | 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(也就是已經(jīng)存儲了998個(gè)key值)
STAT items:1:age 604348                   Slab Id=1 ; 已經(jīng)存在時(shí)間,單位秒
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(也就是已經(jīng)存儲了91897個(gè)key值)
STAT items:6:age 604345                  Slab Id=6 ; 已經(jīng)存在時(shí)間,單位秒
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

提交成功!非常感謝您的反饋,我們會(huì )繼續努力做到更好!

這條文檔是否有幫助解決問(wèn)題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問(wèn)題:
-->