9
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Redisコマンドまとめ

Last updated at Posted at 2016-07-08

redis-cliでよく使うコマンドをまとめる

基本はredis-cli コマンド操作まとめを見れば、大丈夫

足りてないところを追記

1.アイテムの総数を確認したい

$ dbsize

2.メモリ使用量確認したい

$ info

# Memory
used_memory:3861975728
used_memory_human:3.60G
used_memory_rss:4020875264
used_memory_peak:3862466864
used_memory_peak_human:3.60G
used_memory_lua:36864
mem_fragmentation_ratio:1.04
mem_allocator:libc

3.dbの一覧出したい

$ info keyspace
db0:keys=13333067,expires=13333066,avg_ttl=5823077226
db1:keys=29,expires=1,avg_ttl=57199

4. namespaceつけてるアイテムのnamespace一覧出したい

$ redis-cli KEYS "*" > keys
$ grep "\:" --color=never keys |  cut -d':' -f1 | uniq
9
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?