add compression for log

This commit is contained in:
siddontang 2014-09-27 09:10:08 +08:00
parent 05135a5ac9
commit b2a8b70e54
2 changed files with 6 additions and 2 deletions

View File

@ -34,6 +34,7 @@ type ReplicationConfig struct {
ExpiredLogDays int `toml:"expired_log_days"` ExpiredLogDays int `toml:"expired_log_days"`
Sync bool `toml:"sync"` Sync bool `toml:"sync"`
WaitSyncTime int `toml:"wait_sync_time"` WaitSyncTime int `toml:"wait_sync_time"`
Compression bool `toml:"compression"`
} }
type Config struct { type Config struct {
@ -98,6 +99,7 @@ func NewConfigDefault() *Config {
cfg.LMDB.NoSync = true cfg.LMDB.NoSync = true
cfg.Replication.WaitSyncTime = 1 cfg.Replication.WaitSyncTime = 1
cfg.Replication.Compression = true
return cfg return cfg
} }

View File

@ -54,9 +54,11 @@ path = ""
expired_log_days = 7 expired_log_days = 7
# If sync is true, the new log must be sent to some slaves, and then commit. # 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 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 wait_sync_time = 1
# Compress the log or not
compression = true