SSDB FAQ - Frequently Asked Questions
- Question: There is no question or answer I want to ask here, what should I do?
Answer: I recommend everyone to answer their own questions by studying the documentation and using their own brain thinking.
If you still can’t get it after studying the documentation and thinking fully For the answer, you can file an issue on Github.
Note that as a user of technical products, an Internet worker, or even a programmer, you should learn basic questioning skills. If your question is not received answer, then the responsibility lies not with the person being asked, but with yourself. You did not ask the question correctly like a normal technical person.
- ##Question: Why can I access the SSDB server on this machine but not on other machines? It prompts Connection refused.
##Answer:Default The configuration file is based on security considerations and is only open to local access. If you want to open it to other IPs on the network, please modify the configuration according to the document.
- Question: Why can’t the number of concurrency increase? The server reports an error Too many open files, and the client reports an error Connection reset by peer.
Answer: Please refer to the documentation for configuration.
- Question: I deleted one, two, or all keys, why does SSDB occupy The memory and disk space are not released?
Answer: SSDB has its own strategy to decide when or whether to release the memory and hard disk space occupied. You You cannot ask SSDB to release this space immediately or at some time in the future, or based on a certain condition . Moreover, even if the database is cleared, SSDB will still retain some information and therefore still occupy some hard disk space. You should not Concerned about this issue.
- Q: Why does SSDB occasionally use 100% CPU?
##Answer: SSDB Occasionally it is completely normal to use 100% CPU, please don’t make a fuss. This is because SSDB/LevelDB is performing database compaction (Compaction) operation, and the duration generally varies. As the data becomes larger and longer, it usually only lasts a few seconds.
- Q: Why does SSDB occasionally use more disk IO?
Answer: SSDB Occasionally It is completely normal to use more disk IO, please don’t make a fuss. This is because SSDB/LevelDB is performing database compaction (Compaction) operation, and the duration generally increases as the data becomes larger. Variable length, usually only lasts a few seconds.
- Question: Why does SSDB occasionally use more memory space, and then decreases again?
Answer: The memory space used by SSDB changes, and may be high or low. The upper limit of the memory space used is described in the document.
- Question: The service will be slightly slower during Compaction. Can I set the time for Compaction execution?
Answer: Very Unfortunately, you cannot set when Compaction should be executed. SSDB/LevelDB has its own policies and mechanisms to determine when Compaction should be performed. According to the feedback from most users, Compaction has no impact on the service.
- Q: My original configuration file did not turn on the compression option (compression: no), can I change compression to yes midway?
Answer: Yes, you can modify the compression option at any time. As long as you restart ssdb-server, the new modification will take effect. After the change, the original data will still be compatible and will not Any questions.
- #Question: I turned on the compression option, but the hard disk footprint of SSDB has not become smaller. What’s going on?
Answer: No matter you turn on or off the compression option, the new option will take effect as soon as you restart. However, the new option does not necessarily affect the original old data immediately. SSDB will apply new options to old data when appropriate, you have no control over this.
- Question: Is there a command to know the total number of keys stored in SSDB?
##Answer: If you want to count the number of KVs, then at the beginning, you have to put all KVs in the same HASH, and then you can get the number of keys through the hsize command . If you didn't do this at first, or you want to count quantities other than KV, then the answer is simple - there is no such single command (unless you write a script to traverse the statistics yourself).
- Question: Does SSDB support key search? Does it support wildcard Does fuzzy search work?
Answer: SSDB supports, and only supports prefix search, that is, search similar to
a
, but does not supporta
,a
or other fuzzy search. For specific usage, please refer to the commands: scan, hlist , keys, hkeys, hscan, zlist, zkeys, zscan, qlist Documentation for .Note, these commands require you to omit the
!
- Question: Does SSDB not support sets collection? I can’t use Redis’s sadd, sdiff, etc. to find intersection and union commands?
Answer: SSDB does not support sets, and is unlikely to support them in the future, because there are alternatives. You can use hash instead of sets, because the key of a hash is unique and can realize the characteristics of a set. As for operations such as intersection and union, You can only implement it yourself. For example, to find the intersection, you can traverse the key of the first hash, then compare it with the second hash, and store the result in the third hash.
- ##Question: I use Twemproxy to configure SSDB for load balancing and clustering, but when I use ssdb-cli to connect to Twemproxy, an error will be reported. Why?
Answer: Because Twemproxy does not support the SSDB network protocol, you can only use redis-cli to connect to Twemproxy. Note that you can use ssdb-cli or redis-cli to connect SSDB, that's because SSDB supports two protocols, while Twemproxy only supports one.
- Question: How to deploy multiple SSDB instances on one machine?
Answer: Every An instance is started using different configuration files, and the
work_dir
server.port
in the configuration file cannot be the same, that is, the database storage path and listening port of each instance. Ifpidfile
logger.output
The absolute path is used, and it must be ensured that it cannot be the same. If it is a relative path, it is not necessary, because the default path is different because it followswork_dir
.