From 09d57e28f62f0806d58531cd456bf5c0cf02ef0c Mon Sep 17 00:00:00 2001 From: siddontang Date: Fri, 13 Mar 2015 14:00:33 +0800 Subject: [PATCH] use 16 now for later refactor I will try to support large db index for xcodis --- config/config.go | 4 ++-- config/config.toml | 2 +- etc/ledis.conf | 4 ++-- ledis/ledis.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/config.go b/config/config.go index 61d4519..8567b76 100644 --- a/config/config.go +++ b/config/config.go @@ -215,8 +215,8 @@ func (cfg *Config) adjust() { cfg.ConnWriteBufferSize = getDefault(4*KB, cfg.ConnWriteBufferSize) cfg.TTLCheckInterval = getDefault(1, cfg.TTLCheckInterval) cfg.Databases = getDefault(0, cfg.Databases) - if cfg.Databases > 256 { - cfg.Databases = 256 + if cfg.Databases > 16 { + cfg.Databases = 16 } } diff --git a/config/config.toml b/config/config.toml index bcc3820..0b965f5 100644 --- a/config/config.toml +++ b/config/config.toml @@ -11,7 +11,7 @@ data_dir = "/tmp/ledis_server" # Set the number of databases. You can use `select dbindex` to choose a db. # dbindex must be in [0, databases - 1]. -# Maximum databases is 256. +# Maximum databases is 16 now. databases = 16 # Log server command, set empty to disable diff --git a/etc/ledis.conf b/etc/ledis.conf index 9c34182..0b965f5 100644 --- a/etc/ledis.conf +++ b/etc/ledis.conf @@ -11,8 +11,8 @@ data_dir = "/tmp/ledis_server" # Set the number of databases. You can use `select dbindex` to choose a db. # dbindex must be in [0, databases - 1]. -# Maximum databases is 256. -databases = 256 +# Maximum databases is 16 now. +databases = 16 # Log server command, set empty to disable access_log = "" diff --git a/ledis/ledis.go b/ledis/ledis.go index 0bd4526..60c06a2 100644 --- a/ledis/ledis.go +++ b/ledis/ledis.go @@ -45,8 +45,8 @@ func Open(cfg *config.Config) (*Ledis, error) { if cfg.Databases == 0 { cfg.Databases = 16 - } else if cfg.Databases > 256 { - cfg.Databases = 256 + } else if cfg.Databases > 16 { + cfg.Databases = 16 } os.MkdirAll(cfg.DataDir, 0755)