max open files, refer to  and . Or you will see error messages like
Too many open filesin log.txt, or
Connection reset by peeron client side.
PS: Use c1000k to test how many concurrent connections your system supports.
server: ip: 127.0.0.1 port: 8888
The default configuration listen to the
127.0.0.1 local loopback network interface, so other machine will not be able to connect to that ssdb server. If you want to connect to ssdb server from other machine, change
Meanwhile, specify with
deny, allow instructions to only allow connections from reliable IP.
0.0.0.0without network restriction is often a security issue, any one can access to your data! You can use iptables as well.
server: readonly: yes|no
SSDB server can be configured as readonly mode, if SSDB is running in readonly mode, any write operation command will rejected by the server:
ssdb 127.0.0.1:8888> set a 2 client_error: Forbidden Command: set (0.000 sec)
The default option is not set, that is SSDB server works in readwrite mode.
See also Log Analytics.
The log levels are:
debug, info, warn, error, fatal.
Generally, I recommend you set
logger.outputLog Output Destination
Can be relative path or absolute path, if relative path is set, it is relative to the directory of the ssdb.conf file.
If you want to write logs to console, edit ssdb.conf, modify
logger: output: log.txt
logger: output: stdout
logger.rorate.sizeLogrotate and Cleanup
Sets the max size of log file in bytes. Log files will be cut into 1000MB size files, the names are in the form of:
The rotated files will not be deleted automatically, you need to write a crontab script to deleted unused files yourself.
leveldb.cache_sizeMax memory usage for caching data, in MB
Set this item to a large number will normally give better performance, usually half of the physical memory. If your server has less memory, set it to a smaller number, the minimum number is 16.
leveldb.block_size Don't bother with this number
leveldb.write_buffer_size Write buffer size, in MB
If your server has less memory, set it to a smaller number, vice verse. It should be between
Normally, you should not change this. If you have a slower disk and most of your data will never be updated and new data barely be inserted, set it to a smaller number(better to be greater than 50).
leveldb.compressionCompress data before they are written to disk
You SHOULD let it be
yes! Normally you will be able to store 10 times disk space of data, and have better performance, if you set it to
A ssdb-server may temporarily(only last for short time) consume up to this many memory(in MB):
cache_size + write_buffer_size * 66 + 32
This is for
compression is set to
compression is set to
yes, it would be:
cache_size + 10 * write_buffer_size * 66 + 32
You can tune the configuration to limit the memory usage of a ssdb-server instance.
Users reported that with default configuration, the memory usage is about 1GB, you can refer to this.
Sorry, you cannot set the maximum memory usage of SSDB. SSDB may use memory according to these facts:
cache_sizeconfiguration, the most important fact.
cache_size is what you can control, but you can not control others. With a SSDB instance running on a 16G physical memory machine, you set
cache_size to 8000(8G), then you may find the process ssdb-server may use 12G RES memory with top command. If the instance is very busy, it may use 15G RES memory as well.