configuration file parameter Description: 1. Redis default is not run as daemon, can be modified by this configuration item, enable daemon with YesDaemonizeno2. When Redis is running as a daemon, Redis writes the PID to the/var/run/redis.pid file by default and can be specified by pidfilePidfile/var/run/redis.pid3. Specify the Redis listening port, the default port is 6379, the author in his own article blog post explains why 6379 as the default port, because 6379 Merz the corresponding number on the phone keypad, and Merz from Italy showgirl Alessiamerz nameport63794. The host address of the bindingbind127.0.0.15. If the client closes the connection after a long period of inactivity, if it is specified as 0, the function is turned offtimeout3006. Specify logging level, Redis supports four levels in total: Debug, verbose, notice, warning, default is verboseLoglevelverbose7. Logging mode, default to standard output, if Redis is configured to run as daemon, and this is configured as logging mode as standard output, the log will be sent to/dev/nulllogfile stdout8. Set the number of databases, the default database is 0, you can use the select<dbid> command to specify the database ID on the connectionDATABASES169. Specify how many times the update operation will synchronize the data to the data file and can be combined with multiple conditionssave<seconds> <changes>There are three conditions available in the Redis default configuration file:save900 1 save300 Ten Save60 10000Represents 1 changes in 900 seconds (15 minutes), 5 changes in 300 seconds (10 minutes), and 60 changes in 10,000 seconds. 10. Specify whether to compress the data when storing to the local database, the default is Yes,redis with LZF compression, if you want to save CPU time, you can turn off this option, but it will cause the database file to become hugeRdbcompressionyes11. Specify the local database file name, the default value is Dump.rdbDbfilenamedump.rdb12. Specify the local database to hold the directorydir./13. Set the IP address and port of the master service when this machine is a Slav service, and it will automatically synchronize data from master when Redis bootsslaveof<masterip> <masterport>14. When the master service is password protected, the Slav service connects the password of mastermasterauth<master-password>15. Set the Redis connection password, if the connection password is configured, the client needs to provide the password via the auth<password> command when connecting to Redis, which is turned off by defaultrequirepassfoobared16. Set the maximum number of client connections at the same time, the default is unlimited, Redis can open at the same number of client connections for the Redis process can open the maximum number of file descriptors, if set MAXCLIENTS0, indicating no restrictions. When the number of client connections reaches the limit, Redis closes the new connection and returns the Max Numberof clients reached error message to the clientmaxclients12817. Specify the maximum Redis memory limit, Redis will load data into memory when it is started, Redis will try to clear expired or expiring key first, when this method processing, still reach the maximum memory setting, will no longer write operation, but still can read operation. Redis new VM mechanism will store key memory, value will be stored in swap areamaxmemory<bytes>18. Specifies whether logging occurs after each update operation, which, by default, writes data to disk asynchronously and, if not turned on, may result in data loss over a period of time when power is lost. Because the Redis itself synchronizes data files in sync with the save conditions above, some data will only exist in memory for a period of time. Default is NoAppendonlyno19. Specify the update log file name, default to Appendonly.aofappendfilenameappendonly.aof20. Specify the update log condition, a total of 3 optional values:
No: Indicates that the data cache of the operating system is synchronized to disk (fast)
always: Represents a manual call to Fsync () to write data to disk (slow, secure) after each update operation
everysec: Indicates synchronization once per second (trade-offs, default values)appendfsynceverysec21. Specify whether to enable the virtual memory mechanism, the default value is no, a simple introduction, the VM mechanism to store data paging, by Redis will be less accessible pages, such as cold data swap to disk, Access to multiple pages is automatically swapped out into memory by the disk (in a later article I will carefully analyze the Redis VM mechanism)Vm-enabledno22. Virtual memory file path, default value is/tmp/redis.swap, cannot be shared by multiple Redis instancesVm-swap-file/tmp/redis.swap23. Store all data greater than vm-max-memory in virtual memory, regardless of the vm-max-memory settings, all index data is memory stored (REDIS index data is keys), that is, when the vm-max-memory is set to 0, In fact, all value is present on disk. The default value is 0vm-max-memory0The Redis swap file is divided into a number of page, an object can be saved on more than one page, but a page can not be shared by multiple objects, Vm-page-size is based on the size of the stored data to set, the author suggests that if you store many small objects, The page size is best set to 32 or 64bytes, and if you store large objects, you can use a larger page, and if you are unsure, use the default valuesvm-page-size3225. Set the number of pages in the swap file, since the page table (a bitmap that indicates that the page is idle or used) is in memory and consumes 1byte of memory per 8 pages on disk.vm-pages13421772826. Set the number of threads to access swap files, preferably do not exceed the machine's core number, if set to 0, then all the swap file operation is serial, may cause a relatively long delay. The default value is 4VM-MAX-THREADS427. Set when replying to the client, whether to merge the smaller package into one package send, the default is to turn onGlueoutputbufyes28. Specifies that a special hashing algorithm is used when more than a certain number or maximum element exceeds a critical valueHash-max-zipmap-entries64 hash-max-zipmap-value51229. Specify whether to activate the reset hash, which is on by default (described later in the introduction of the Redis hashing algorithm)Activerehashingyes30. Specify other profiles that can use the same configuration file across multiple Redis instances on the same host, while each instance has its own specific configuration fileinclude/path/to/local.confFor more highlights, please follow: http://bbs.superwu.cnfocus on the two-dimensional code of Superman Academy:
Redis configuration File parameter description