Description of the redis. conf parameter in the redis configuration file

Source: Internet
Author: User

 

The redis. conf configuration options are as follows:
Whether daemonize is run by a later process. The default value is no.
If pidfile is run by a later process, you must specify a PID. The default value is/var/run/redis. PID.
Bind Host IP address. Default Value: 127.0.0.1 (note)
Port listening port. The default value is 6379.
Timeout timeout. The default value is 300 seconds)
Loglevel log record level, which has four optional values: Debug, verbose (default), notice, and warning
Logfile logging method. The default value is stdout.
Number of available databases in databases. The default value is 16 and the default value is 0.
Save <seconds> <changes> specifies the duration of an update operation to synchronize data to a data file. This can be used with multiple conditions. For example, three conditions are set in the default configuration file.
Save 900 1 900 seconds (15 minutes) at least one key is changed
Save 300 10 300 seconds (5 minutes) at least 300 keys are changed
Save 60 10000 at least 10000 keys are changed within 60 seconds
Whether the data is compressed when rdbcompression is stored in the local database. The default value is yes.
Dbfilename: name of the local database file. The default value is dump. RDB.
Path for storing the Dir local database. The default value is ./
Slaveof <masterip> <masterport> when the local machine is a slave service, set the IP address and port of the master service (note)
Masterauth <master-Password> when the local machine is a slave service, set the connection password of the master service (note)
Requirepass connection password (note)
Maxclients maximum number of client connections, no limit by default (note)
After maxmemory <bytes> sets the maximum memory to reach the maximum memory setting, redis will first try to clear expired or expiring keys. After this method is processed, it will reach the maximum memory setting, no more write operations can be performed. (Note)
Whether appendonly records logs after each update operation. If it is not enabled, data may be lost for a period of time during power failure. Because redis synchronizes data files according to the Save conditions above, some data will only exist in the memory for a period of time. The default value is no.
Appendfilename: update the log file name. The default value is appendonly. aof (comment)
Appendfsync updates log conditions. There are three optional values. "No" indicates that data is cached and synchronized to the disk by the operating system. "Always" indicates that data is manually written to the disk by calling fsync () after each update operation. "everysec" indicates that data is synchronized once per second (default ).
Whether VM-enabled uses virtual memory. The default value is no.
VM-Swap-file: virtual memory file path. The default value is/tmp/redis. Swap. It cannot be shared by multiple redis instances.
VM-max-memory stores all data greater than VM-max-memory into the virtual memory, no matter how small the VM-max-memory settings are, all index data is stored in memory (redis index data is keys). That is to say, when VM-max-memory is set to 0, all values are actually stored on the disk. The default value is 0.

The official redis documentation provides some suggestions for the use of VMS:When your key is small and the value is large, it will be better to use VM. this saves a lot of memory. when your key is not hour, you can consider using some very method to convert a large key into a large value. For example, you can consider combining the key and value into a new value. it is best to use Linux ext3 and other file systems that support sparse files to save your swap files. the VM-max-threads parameter can be used to set the number of threads accessing the swap file. It is recommended that the number of threads not exceed the number of machine cores. If it is set to 0, all operations on swap files are serial. it may cause a long delay, but it guarantees data integrity.

With the VM function, redis finally got rid of the nightmare of limited memory capacity. It seems that we can call it a redis database, and we can imagine how many new usage can be produced. of course, we hope this function will not affect the memory storage performance of the original apsaradb for redis database.

 

Virtual Memory User Guide http://code.google.com/p/redis/wiki/VirtualMemoryUserGuide

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.