Last active
August 29, 2015 14:08
-
-
Save eccyan/89de903b75feb3ffe4d8 to your computer and use it in GitHub Desktop.
Redis のメモリが足りなくなった時にどうやってチューニングしたか ref: http://qiita.com/eccyan/items/e8cc56948a00d6aad0aa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rdb -c memory dump.rdb > redis_memory.csv | |
# バイトサイズとキーの個数と単位バイトサイズを出す | |
$ cat redis_memory.csv | sed -E "1d" | sed -E 's/:[0-9]+(:|")/:{id}\1/g' | cut -d ',' -f 3,4 | awk -F ',' '{ sum[$1] += $2; count[$1] += 1 } END { for (key in sum) print key, sum[key], count[key], sum[key] /count[key] }' > redis_memory_status.csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ question_id: <INTEGER> | |
accessed_at: <STRING> | |
} | |
, // … | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis> object encoding <KEY> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hash-max-zipmap-entries 64 (hash-max-ziplist-entries for Redis >= 2.6) | |
hash-max-zipmap-value 512 (hash-max-ziplist-value for Redis >= 2.6) | |
list-max-ziplist-entries 512 | |
list-max-ziplist-value 64 | |
zset-max-ziplist-entries 128 | |
zset-max-ziplist-value 64 | |
set-max-intset-entries 512 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment