Configuration file parameter description: 1. Redis defaults to not run as a daemon, can be modified by this configuration item, and enable Daemons daemonizeno2 with Yes. When Redis is running as a daemon, Redis writes the PID to the/var/run/redis.pid file by default, which can be specified by Pidfile &NBSP;&NBSP;PIDFILE/VAR/RUN/REDIS.PID3. Specify the Redis listening port, the default port is 6379, the author in his own blog post explains why 6379 is chosen as the default port, because 6379 Merz the corresponding number on the phone keypad, and Merz from Italy showgirl Alessiamerz name port63794. Binding host address bind127.0.0.15. If the client closes the connection after a long period of inactivity, if 0 is specified, the feature is turned off timeout3006. Specifying the logging level, Redis supports a total of four levels: Debug, verbose, notice, warning, and the default is verbose loglevelverbose7. logging mode, which defaults to standard output, and if Redis is configured to run as a daemon, and this is configured as logging as standard output, the log will be sent to/dev/null logfile Stdout8. Set the number of databases, the default database is 0, and you can use the select<dbid> command to specify the database id databases169 on the connection. Specify how many times the update operation will synchronize the data to the data file, multiple conditions can be matched save<seconds> <changes> Three conditions are available in the Redis default configuration file: save900 1 save300 10 save60 10000 represents 1 changes in 900 seconds (15 minutes), 5 changes in 300 seconds (10 minutes), and 60 secondsThere are 10,000 changes. 10. Specifies whether to compress data when stored to a local database, by default, Yes,redis with LZF compression, and if you want to save CPU time, you can turn off this option, but cause the database file to become huge &NBSP;&NBSP;RDBCOMPRESSIONYES11. Specifies the local database file name, the default value is dump.rdb dbfilenamedump.rdb12. Specify local database storage directory &NBSP;&NBSP;DIR./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 starts slaveof<masterip> < Masterport>14. When the master service has password protection set, the Slav service connects the master's password masterauth<master-password>15. Set the Redis connection password, and if the connection password is configured, the client needs to provide a password via the auth<password> command when connecting to Redis, which is closed &NBSP;&NBSP;REQUIREPASSFOOBARED16 by default. 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 maxclients12817 to the client. Specify the Redis maximum memory limit, Redis will load the data into memory when it is started, Redis will try to clear the expired or expiring key first, when this method is processed, 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 area maxmemory<bytes>18. Specifies whether logging occurs after each update operation, which, by default, writes data to disk asynchronously and, if not turned on, may cause a period of time during a power outageData loss. 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. The default is no appendonlyno19. Specifies the update log file name, which defaults to appendonly.aof appendfilenameappendonly.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
&NBSP;&NBSP;EVERYSEC: Indicates synchronization once per second (tradeoff, default) appendfsynceverysec 21. 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 more pages from the disk automatically swapped out into memory (in the following article I will carefully analyze the Redis VM mechanism) &NBSP;&NBSP;&NBSP;VM-ENABLEDNO22. Virtual memory file path with default value of/tmp/redis.swap, not multiple Redis instance shares vm-swap-file/tmp/redis.swap23. All data larger than Vm-max-memory is stored in virtual memory, regardless of how small the vm-max-memory setting is, all index data is in memory (Redis's index data is keys), that is, when Vm-max-memory is set to 0, In fact, all value is present on disk. The default value is 0 vm-max-memory024. The 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 values vm-page-size3225. Set the number of pages in the swap file, which consumes 1byte of memory per 8 pages on disk because the page table (a bitmap that indicates that the page is idle or used) is in memory. vm-pages13421772826. Set the number of threads to access the swap file, preferably without exceeding the machine's number of cores, if set to 0, all operations on the swap file are serial and may cause a long delay. The default value is 4 vm-max-threads427. Sets whether to merge smaller packages into one package when answering to the client, default is on &Nbsp;glueoutputbufyes28. Specifies that a special hashing algorithm is used when more than a certain number or maximum element exceeds a certain threshold hash-max-zipmap-entries64 hash-max-zipmap-value51229. Specifies whether to activate the reset hash, which is turned on by default (described later in the introduction of the hashing algorithm for Redis) &NBSP;&NBSP;ACTIVEREHASHINGYES30. Specifies that other profiles can be used to share the same profile across multiple Redis instances on the same host, while each instance has its own specific profile include/path/to/ local.conf more wonderful content please pay attention to: http://bbs.superwu.cn focus on Superman academy QR Code:
Redis configuration file parameter description