redis和memcached

1、查看连接数

[memcached]

stats

STAT curr_connections 7   //当前连接数

STAT total_connections 16  //到目前为止总连接数

[redis]

18898] 03 Nov 12:15:32.953 - DB 0: 3 keys (0 volatile) in 4 slots HT.

[18898] 03 Nov 12:15:32.953 - 40 clients connected (0 slaves), 1587080 bytes in use


2、查看所有值

[memcached]

1)、stats items

    STAT items:1:number 5

2)、stats cachedump 1 5

ITEM lli [3 b; 1444382375 s]

ITEM lly [3 b; 1444382375 s]

ITEM aa [3 b; 1444382375 s]

ITEM lie [3 b; 1444382375 s]

ITEM name [3 b; 1444382375 s]

END

[redis]

 keys '*'

1) "key2"

2) "yin"

3) "lie"

4) "key1"

5) "lly"


redis运行中修改配置文件使生效

EG:

config set dbfilename "rd.rdb"  //修改dbfilename

config get * //进行查看配置是否生效


3、清空所有值

[memcached]

flush_all

[redis]

flushall

flushdb

你可能感兴趣的:(redis)