Where is it?
redis unzip the redis.conf in the package
Remember to back up its original files~
- Some basic measurement units are defined at the beginning, only bytes are supported, not bits
- Not case sensitive
Other configuration files can be included through INCLUDES.
Whether to run as a daemon.
If running as a daemon process, where is the process pipe id file placed. (I don’t understand this for the time being)
Port number, the default is 6379
In the initial learning stage, just keep the official default value, don't make mistakes.
Translation: Set the backlog of tcp. The backlog is actually a connection queue. The sum of the backlog queues = the unfinished three-way handshake queue + the completed three-way handshake queue. In a high-concurrency environment, you need a high backlog value to avoid slow client connection problems. Note that the linux kernel will reduce this value to the value of /proc/sys/net/core/somaxconn, so you need to make sure to increase the two values of somaxconn and tcp_max_syn_backlog to achieve the desired effect.
How many seconds after being idle to close the redis connection
If it is 0, keep it on
Log level, use debug
9, logfile in the development phase
Set the name of the log file
Set the number of databases, the default is 16
save [seconds] [changes]Save [changes] changes within [seconds]
save ""This function can be disabled, or no save command can be set.
Enter in the client
saveto manually save the snapshot
When an error occurs in the backup process, the main process stops accepting new write operations. This is to maintain persistent data consistency issues.
For the snapshots stored in the disk, you can set whether to compress the storage. If it is, redis will use the LZF algorithm for compression. If you don't want to consume CPU for compression, you can set to turn off this feature.
After storing the snapshot, redis can also use the CRC64 algorithm for data verification, but doing so will increase the performance consumption by about 10%. If you want to get the maximum performance improvement, you can turn off this feature
The name of the snapshot file
6 、 you
Storage path of the snapshot file
config get requirepassGet password
config set requirepass [password]set password
After setting the password, if you do any operation, you will be prompted that there is no permission:
auth [password]so there is permission~
config get dirGet current path
Maximum number of clients
The maximum memory size that can be used
When the memory is not enough, the old data needs to be removed to add the new one, so the removal strategy is set here.
There are six strategies:
- Volatile-lru: the least recently used algorithm, select the key-value pair with the longest idle time from the keys with the expiration time set and clear it
- allkeys-lru: Use the least recently used algorithm for all keys
- volatile-random: randomly remove a key with expiration time
- allkeys-random: randomly remove a key
- volatile-ttl: Remove the key with the smallest ttl value, of course, provided that there is an expiration time
- noeviction: Do not remove. Report an error when the memory is full
sets the number of samples. The LRU algorithm and the minimum TTL algorithm are not accurate algorithms, but estimated values. Generally speaking, the higher the samples value, the closer it is to the real LRU algorithm, but it will consume more CPU resources. The default setting is 5.