understanding append-only and redis db size

541 views
Skip to first unread message

Gopalakrishnan Subramani

unread,
Jan 14, 2011, 1:30:41 AM1/14/11
to Redis DB
Here my append only size is much bigger than db file size. Is this how
redis work or am I missing something?

ls /data/stacked/site -s -k
total 1480860
1229008 appendonly.aof 251852 redis_site.rdb

I have enabled appendonly options in my configuration and no where I
am saying redis to sync my db. Is it possible to configure redis to
save into disk for every single update/add to list/set?


Here is my configuration

daemonize no

port 6000
bind 127.0.0.1
timeout 0

loglevel notice

logfile /log/stacked/redis-sitedb-server.log

databases 25

save 1 1
save 1 10

rdbcompression yes

dbfilename redis_site.rdb

dir /data/stacked/site

appendonly yes

appendfsync always
# appendfsync everysec
# appendfsync no

glueoutputbuf yes
#shareobjects no
#shareobjectspoolsize 1024



Regards,

Krish

Pieter Noordhuis

unread,
Jan 14, 2011, 5:03:04 AM1/14/11
to redi...@googlegroups.com
The AOF will (almost) always be bigger than the dump file because it logs all write commands. That way, keeping a consistent view of your data is relatively cheap since Redis only needs to append these commands to a file, instead of dumping the resulting values.

If you want to be sure that Redis does a real disk write for every write command, you can take a look at the appendfsync option in the configuration file. When you set this to "always", Redis flushes the write buffer for every command (actually, once per event loop tick). You'll notice a big drop in performance though. Also, I suggest you read http://redis.io/topics/persistence to get familiar with everything related to persistence in Redis.

Cheers,
Pieter


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.


iammutex

unread,
Jan 17, 2011, 5:23:04 AM1/17/11
to Redis DB
You can run the BGREWRITEAOF command to compact your aof file.It's
just maintain one log for every record. So the aof file size will
still bigger than you db file size.

On Jan 14, 2:30 pm, Gopalakrishnan Subramani
Reply all
Reply to author
Forward
0 new messages