Hello, Salvatore,
Thank you for your help!
On Sun, Oct 7, 2012 at 5:23 PM, Salvatore Sanfilippo <
ant...@gmail.com> wrote:
> Hello Alexander,
>
> such a tool is almost impossible to build because AOF can be any
> combination of Redis commands, the only way to go from AOF to the
> memory representation of keys and values is to load the file into
> Redis, otherwise such a tool should basically simulate much of the
> Redis internals in order to work.
Makes sense.
Then the next question: can I write a simple script that uses Redis to
convert AOF to RDB? As I see it now, I have to feed .aof to a new
redis-server process, wait until it loads, connect to it, and issue a
BGSAVE. I, of course, will do that manually, but I would like
something that is more convenient to automate.
> If you have your AOF instance running "live", you can use redis-cli
> --big-keys in order to have a clue about your large keys without any
> need to perform a conversion.
Yes, I have one.
Please help me interpret what I see (or just point me to the docs):
$ redis-cli --bigkeys
# Press ctrl+c when you have had enough of it... :)
# You can use -i 0.1 to sleep 0.1 sec every 100 sampled keys
# in order to reduce server load (usually not needed).
[string] zzz:live_cluster_count | biggest so far with size 1
^C
$ redis-cli -n 2 --bigkeys
# Press ctrl+c when you have had enough of it... :)
# You can use -i 0.1 to sleep 0.1 sec every 100 sampled keys
# in order to reduce server load (usually not needed).
[string] zzz:chain:49 | biggest so far with size 6157
[string] zzz:chain:1 | biggest so far with size 22163
[ set] zzz:partners | biggest so far with size 16
[ hash] zzz:chainsv | biggest so far with size 10159
[ set] zzz:dates | biggest so far with size 45
[string] zzz:chains | biggest so far with size 209720
[ set] zzz:categories | biggest so far with size 386
^C
$ redis-cli -n 3 --bigkeys
# Press ctrl+c when you have had enough of it... :)
# You can use -i 0.1 to sleep 0.1 sec every 100 sampled keys
# in order to reduce server load (usually not needed).
[ hash] zzz:category:9:1346616000:uniq | biggest so far with size 1
[ hash] zzz:category:(?):1349035200:all | biggest so far with size 7
[ hash] zzz:stat:6:1347739200:uniq | biggest so far with size 17
[string] zzz:cps:1:1347393600:lb | biggest so far with size 10
[ hash] zzz:cps:6:1347652800:all | biggest so far with size 54928
[string] zzz:stats:3:1347220800:lb | biggest so far with size 5410
[string] zzz:stats:3:1347480000:lb | biggest so far with size 5438
[string] zzz:cps:2:1347307200:lb | biggest so far with size 357312
[string] zzz:cps:6:1348603200:lb | biggest so far with size 5150046
[ hash] zzz:cps:6:1348689600:all | biggest so far with size 79787
[string] zzz:cps:6:1349121600:lb | biggest so far with size 5978019
[ hash] zzz:cps:6:1349294400:all | biggest so far with size 82397
[string] zzz:cps:6:1349208000:lb | biggest so far with size 6273410
[ hash] zzz:cps:6:1349121600:all | biggest so far with size 83285
[ hash] zzz:cps:6:1349208000:all | biggest so far with size 87557
^C
$ redis-cli -n 4 --bigkeys
# Press ctrl+c when you have had enough of it... :)
# You can use -i 0.1 to sleep 0.1 sec every 100 sampled keys
# in order to reduce server load (usually not needed).
[ hash] services:info:zzz1871 | biggest so far with size 14
[string] zzz:payload_global_counter:417 | biggest so far with size 5
[string] zzz:payload_global_counter:383 | biggest so far with size 6
[ set] services:running | biggest so far with size 33
^C
* * *
My problem:
I have this in info:
db0:keys=1,expires=0
db2:keys=61,expires=0
db3:keys=6323,expires=0
db4:keys=52,expires=6
...and .aof file, after rewrite, weights 2GB.
I would like to figure out what takes so much space and optimize that away.
Thanks again,
Alexander.