From b2a8b70e54ed78da4b2d82f4a00dc23394f3da99 Mon Sep 17 00:00:00 2001 From: siddontang Date: Sat, 27 Sep 2014 09:10:08 +0800 Subject: [PATCH] add compression for log --- config/config.go | 2 ++ config/config.toml | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index e2381a7..5a8070b 100644 --- a/config/config.go +++ b/config/config.go @@ -34,6 +34,7 @@ type ReplicationConfig struct { ExpiredLogDays int `toml:"expired_log_days"` Sync bool `toml:"sync"` WaitSyncTime int `toml:"wait_sync_time"` + Compression bool `toml:"compression"` } type Config struct { @@ -98,6 +99,7 @@ func NewConfigDefault() *Config { cfg.LMDB.NoSync = true cfg.Replication.WaitSyncTime = 1 + cfg.Replication.Compression = true return cfg } diff --git a/config/config.toml b/config/config.toml index d3faf17..fbe86a6 100644 --- a/config/config.toml +++ b/config/config.toml @@ -54,9 +54,11 @@ path = "" expired_log_days = 7 # If sync is true, the new log must be sent to some slaves, and then commit. -# It may affect performance. +# It will reduce performance but have better high availability. sync = true -# If sync is true, wait at last wait_sync_time seconds to check whether slave sync this log +# If sync is true, wait at last wait_sync_time seconds for slave syncing this log wait_sync_time = 1 +# Compress the log or not +compression = true