From b0553789719a3f47531655dab13f5def5ce35403 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 16 Dec 2009 15:48:57 -0500 Subject: [PATCH] LZF compression re-enabled by default, but with INIT_HTAB set to 0 to avoid the very costly memset initialization. Note that with this option set valgrind will output some false positive about lzf_c.c --- lzfP.h | 2 +- redis.c | 2 +- redis.conf | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lzfP.h b/lzfP.h index 3781cac1..d533f182 100644 --- a/lzfP.h +++ b/lzfP.h @@ -88,7 +88,7 @@ * deterministic/repeatable when the configuration otherwise is the same). */ #ifndef INIT_HTAB -# define INIT_HTAB 1 +# define INIT_HTAB 0 #endif /* diff --git a/redis.c b/redis.c index 40441228..52443129 100644 --- a/redis.c +++ b/redis.c @@ -1142,7 +1142,7 @@ static void initServerConfig() { server.appendfilename = "appendonly.aof"; server.requirepass = NULL; server.shareobjects = 0; - server.rdbcompression = 0; + server.rdbcompression = 1; server.sharingpoolsize = 1024; server.maxclients = 0; server.maxmemory = 0; diff --git a/redis.conf b/redis.conf index 099a00a2..c1a1f7f1 100644 --- a/redis.conf +++ b/redis.conf @@ -54,10 +54,10 @@ save 300 10 save 60 10000 # Compress string objects using LZF when dump .rdb databases? -# For default that's set to 'no' because uses too much CPU time. -# You want to switch this to 'yes' only if you have a lot of very compressible -# data inside your dataset and are using replication. -rdbcompression no +# For default that's set to 'yes' as it's almost always a win. +# If you want to save some CPU in the saving child set it to 'no' but +# the dataset will likely be bigger if you have compressible values or keys. +rdbcompression yes # The filename where to dump the DB dbfilename dump.rdb -- 2.45.2