ledisdb/config/config.toml

135 lines
3.3 KiB
TOML
Raw Normal View History

# LedisDB configuration
# Server listen address
addr = "127.0.0.1:6380"
# Server http listen address, set empty to disable
http_addr = "127.0.0.1:11181"
# Data store path, all ledisdb's data will be saved here
data_dir = "/tmp/ledis_server"
# Log server command, set empty to disable
access_log = ""
# Set slaveof to enable replication from master, empty, no replication
2014-09-25 12:03:29 +04:00
# Any write operations except flushall and replication will be disabled in slave mode.
slaveof = ""
2014-10-10 05:49:16 +04:00
# Readonly mode, slave server is always readonly even readonly = false
# for readonly mode, only replication and flushall can write
readonly = false
# Choose which backend storage to use, now support:
#
# leveldb
# rocksdb
# goleveldb
# lmdb
# boltdb
2014-09-04 10:02:47 +04:00
# memory
#
db_name = "leveldb"
2014-09-18 18:30:33 +04:00
# If not set, use data_dir/"db_name"_data
db_path = ""
2014-10-16 05:35:35 +04:00
# Sync commit to disk if possible
# 0: no sync
# 1: sync every second
# 2: sync every commit
db_sync_commit = 0
# enable replication or not
use_replication = false
2014-10-25 10:48:52 +04:00
# set connection buffer, you can increase them appropriately
conn_read_buffer_size = 10240
conn_write_buffer_size = 10240
[leveldb]
2014-10-24 09:01:13 +04:00
# for leveldb and goleveldb
compression = false
block_size = 32768
write_buffer_size = 67108864
cache_size = 524288000
max_open_files = 1024
2014-10-24 09:01:13 +04:00
[rocksdb]
# rocksdb has many many configurations,
# we only list little now, but may add more later.
# good luck!
# 0:no, 1:snappy, 2:zlib, 3:bz2, 4:lz4, 5:lz4hc
compression = 0
2014-10-24 12:39:37 +04:00
block_size = 65536
2014-10-24 09:01:13 +04:00
write_buffer_size = 67108864
cache_size = 524288000
max_open_files = 1024
max_write_buffer_num = 2
min_write_buffer_number_to_merge = 1
num_levels = 7
2014-10-24 12:39:37 +04:00
level0_file_num_compaction_trigger = 8
2014-10-24 09:01:13 +04:00
level0_slowdown_writes_trigger = 16
level0_stop_writes_trigger = 64
2014-10-24 12:39:37 +04:00
target_file_size_base = 67108864
2014-10-24 09:01:13 +04:00
target_file_size_multiplier = 1
2014-10-24 12:39:37 +04:00
max_bytes_for_level_base = 536870912
max_bytes_for_level_multiplier = 8
2014-10-24 09:01:13 +04:00
disable_auto_compactions = false
disable_data_sync = false
use_fsync = false
background_theads = 4
high_priority_background_threads = 1
2014-10-24 12:39:37 +04:00
max_background_compactions = 3
2014-10-24 09:01:13 +04:00
max_background_flushes = 1
allow_os_buffer = true
enable_statistics = false
stats_dump_period_sec = 3600
2014-10-24 19:30:27 +04:00
# dangerous to set true, write may got lost after a crash
# you can set true if replication opened, we may recover from replication log,
# but it is still not a easy work.
disable_wal = false
2014-10-24 09:01:13 +04:00
[lmdb]
map_size = 524288000
nosync = true
2014-09-22 13:50:51 +04:00
[replication]
# Path to store replication information(write ahead log, commit log, etc.)
# if not set, use data_dir/rpl
path = ""
2014-09-17 13:54:04 +04:00
# If sync is true, the new log must be sent to some slaves, and then commit.
2014-09-27 05:10:08 +04:00
# It will reduce performance but have better high availability.
sync = true
2014-10-11 12:00:59 +04:00
# If sync is true, wait at last wait_sync_time milliseconds for slave syncing this log
wait_sync_time = 500
2014-10-05 13:24:44 +04:00
# If sync is true, wait at most min(wait_max_slave_acks, (n + 1) / 2) to promise syncing ok.
# n is slave number
# If 0, wait (n + 1) / 2 acks.
wait_max_slave_acks = 2
2014-10-09 11:05:15 +04:00
# Expire write ahead logs after the given days
expired_log_days = 7
# Sync log to disk if possible
# 0: no sync
# 1: sync every second
# 2: sync every commit
sync_log = 0
2014-09-27 05:10:08 +04:00
# Compress the log or not
compression = true
2014-10-10 13:57:18 +04:00
[snapshot]
# Path to store snapshot dump file
# if not set, use data_dir/snapshot
2014-10-11 13:44:31 +04:00
# snapshot file name format is dmp-2006-01-02T15:04:05.999999999
2014-10-10 13:57:18 +04:00
path = ""
# Reserve newest max_num snapshot dump files
max_num = 1