You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

696 lines
29 KiB

  1. # Redis configuration file example
  2. # Note on units: when memory size is needed, it is possible to specify
  3. # it in the usual form of 1k 5GB 4M and so forth:
  4. #
  5. # 1k => 1000 bytes
  6. # 1kb => 1024 bytes
  7. # 1m => 1000000 bytes
  8. # 1mb => 1024*1024 bytes
  9. # 1g => 1000000000 bytes
  10. # 1gb => 1024*1024*1024 bytes
  11. #
  12. # units are case insensitive so 1GB 1Gb 1gB are all the same.
  13. # By default Redis does not run as a daemon. Use 'yes' if you need it.
  14. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
  15. daemonize no
  16. # When running daemonized, Redis writes a pid file in /var/run/redis.pid by
  17. # default. You can specify a custom pid file location here.
  18. pidfile /var/run/redis.pid
  19. # Accept connections on the specified port, default is 6379.
  20. # If port 0 is specified Redis will not listen on a TCP socket.
  21. port 6379
  22. # By default Redis listens for connections from all the network interfaces
  23. # available on the server. It is possible to listen to just one or multiple
  24. # interfaces using the "bind" configuration directive, followed by one or
  25. # more IP addresses.
  26. #
  27. # Examples:
  28. #
  29. # bind 192.168.1.100 10.0.0.1
  30. # bind 127.0.0.1
  31. # Specify the path for the unix socket that will be used to listen for
  32. # incoming connections. There is no default, so Redis will not listen
  33. # on a unix socket when not specified.
  34. #
  35. # unixsocket /tmp/redis.sock
  36. # unixsocketperm 755
  37. # Close the connection after a client is idle for N seconds (0 to disable)
  38. timeout 0
  39. # TCP keepalive.
  40. #
  41. # If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
  42. # of communication. This is useful for two reasons:
  43. #
  44. # 1) Detect dead peers.
  45. # 2) Take the connection alive from the point of view of network
  46. # equipment in the middle.
  47. #
  48. # On Linux, the specified value (in seconds) is the period used to send ACKs.
  49. # Note that to close the connection the double of the time is needed.
  50. # On other kernels the period depends on the kernel configuration.
  51. #
  52. # A reasonable value for this option is 60 seconds.
  53. tcp-keepalive 0
  54. # Specify the server verbosity level.
  55. # This can be one of:
  56. # debug (a lot of information, useful for development/testing)
  57. # verbose (many rarely useful info, but not a mess like the debug level)
  58. # notice (moderately verbose, what you want in production probably)
  59. # warning (only very important / critical messages are logged)
  60. loglevel notice
  61. # Specify the log file name. Also the emptry string can be used to force
  62. # Redis to log on the standard output. Note that if you use standard
  63. # output for logging but daemonize, logs will be sent to /dev/null
  64. logfile ""
  65. # To enable logging to the system logger, just set 'syslog-enabled' to yes,
  66. # and optionally update the other syslog parameters to suit your needs.
  67. # syslog-enabled no
  68. # Specify the syslog identity.
  69. # syslog-ident redis
  70. # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
  71. # syslog-facility local0
  72. # Set the number of databases. The default database is DB 0, you can select
  73. # a different one on a per-connection basis using SELECT <dbid> where
  74. # dbid is a number between 0 and 'databases'-1
  75. databases 16
  76. ################################ SNAPSHOTTING #################################
  77. #
  78. # Save the DB on disk:
  79. #
  80. # save <seconds> <changes>
  81. #
  82. # Will save the DB if both the given number of seconds and the given
  83. # number of write operations against the DB occurred.
  84. #
  85. # In the example below the behaviour will be to save:
  86. # after 900 sec (15 min) if at least 1 key changed
  87. # after 300 sec (5 min) if at least 10 keys changed
  88. # after 60 sec if at least 10000 keys changed
  89. #
  90. # Note: you can disable saving at all commenting all the "save" lines.
  91. #
  92. # It is also possible to remove all the previously configured save
  93. # points by adding a save directive with a single empty string argument
  94. # like in the following example:
  95. #
  96. # save ""
  97. save 900 1
  98. save 300 10
  99. save 60 10000
  100. # By default Redis will stop accepting writes if RDB snapshots are enabled
  101. # (at least one save point) and the latest background save failed.
  102. # This will make the user aware (in an hard way) that data is not persisting
  103. # on disk properly, otherwise chances are that no one will notice and some
  104. # distater will happen.
  105. #
  106. # If the background saving process will start working again Redis will
  107. # automatically allow writes again.
  108. #
  109. # However if you have setup your proper monitoring of the Redis server
  110. # and persistence, you may want to disable this feature so that Redis will
  111. # continue to work as usually even if there are problems with disk,
  112. # permissions, and so forth.
  113. stop-writes-on-bgsave-error yes
  114. # Compress string objects using LZF when dump .rdb databases?
  115. # For default that's set to 'yes' as it's almost always a win.
  116. # If you want to save some CPU in the saving child set it to 'no' but
  117. # the dataset will likely be bigger if you have compressible values or keys.
  118. rdbcompression yes
  119. # Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
  120. # This makes the format more resistant to corruption but there is a performance
  121. # hit to pay (around 10%) when saving and loading RDB files, so you can disable it
  122. # for maximum performances.
  123. #
  124. # RDB files created with checksum disabled have a checksum of zero that will
  125. # tell the loading code to skip the check.
  126. rdbchecksum yes
  127. # The filename where to dump the DB
  128. dbfilename dump.rdb
  129. # The working directory.
  130. #
  131. # The DB will be written inside this directory, with the filename specified
  132. # above using the 'dbfilename' configuration directive.
  133. #
  134. # The Append Only File will also be created inside this directory.
  135. #
  136. # Note that you must specify a directory here, not a file name.
  137. dir /data
  138. ################################# REPLICATION #################################
  139. # Master-Slave replication. Use slaveof to make a Redis instance a copy of
  140. # another Redis server. Note that the configuration is local to the slave
  141. # so for example it is possible to configure the slave to save the DB with a
  142. # different interval, or to listen to another port, and so on.
  143. #
  144. # slaveof <masterip> <masterport>
  145. # If the master is password protected (using the "requirepass" configuration
  146. # directive below) it is possible to tell the slave to authenticate before
  147. # starting the replication synchronization process, otherwise the master will
  148. # refuse the slave request.
  149. #
  150. # masterauth <master-password>
  151. # When a slave loses its connection with the master, or when the replication
  152. # is still in progress, the slave can act in two different ways:
  153. #
  154. # 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
  155. # still reply to client requests, possibly with out of date data, or the
  156. # data set may just be empty if this is the first synchronization.
  157. #
  158. # 2) if slave-serve-stale-data is set to 'no' the slave will reply with
  159. # an error "SYNC with master in progress" to all the kind of commands
  160. # but to INFO and SLAVEOF.
  161. #
  162. slave-serve-stale-data yes
  163. # You can configure a slave instance to accept writes or not. Writing against
  164. # a slave instance may be useful to store some ephemeral data (because data
  165. # written on a slave will be easily deleted after resync with the master) but
  166. # may also cause problems if clients are writing to it because of a
  167. # misconfiguration.
  168. #
  169. # Since Redis 2.6 by default slaves are read-only.
  170. #
  171. # Note: read only slaves are not designed to be exposed to untrusted clients
  172. # on the internet. It's just a protection layer against misuse of the instance.
  173. # Still a read only slave exports by default all the administrative commands
  174. # such as CONFIG, DEBUG, and so forth. To a limited extend you can improve
  175. # security of read only slaves using 'rename-command' to shadow all the
  176. # administrative / dangerous commands.
  177. slave-read-only yes
  178. # Slaves send PINGs to server in a predefined interval. It's possible to change
  179. # this interval with the repl_ping_slave_period option. The default value is 10
  180. # seconds.
  181. #
  182. # repl-ping-slave-period 10
  183. # The following option sets the replication timeout for:
  184. #
  185. # 1) Bulk transfer I/O during SYNC, from the point of view of slave.
  186. # 2) Master timeout from the point of view of slaves (data, pings).
  187. # 3) Slave timeout from the point of view of masters (REPLCONF ACK pings).
  188. #
  189. # It is important to make sure that this value is greater than the value
  190. # specified for repl-ping-slave-period otherwise a timeout will be detected
  191. # every time there is low traffic between the master and the slave.
  192. #
  193. # repl-timeout 60
  194. # Disable TCP_NODELAY on the slave socket after SYNC?
  195. #
  196. # If you select "yes" Redis will use a smaller number of TCP packets and
  197. # less bandwidth to send data to slaves. But this can add a delay for
  198. # the data to appear on the slave side, up to 40 milliseconds with
  199. # Linux kernels using a default configuration.
  200. #
  201. # If you select "no" the delay for data to appear on the slave side will
  202. # be reduced but more bandwidth will be used for replication.
  203. #
  204. # By default we optimize for low latency, but in very high traffic conditions
  205. # or when the master and slaves are many hops away, turning this to "yes" may
  206. # be a good idea.
  207. repl-disable-tcp-nodelay no
  208. # Set the replication backlog size. The backlog is a buffer that accumulates
  209. # slave data when slaves are disconnected for some time, so that when a slave
  210. # wants to reconnect again, often a full resync is not needed, but a partial
  211. # resync is enough, just passing the portion of data the slave missed while
  212. # disconnected.
  213. #
  214. # The biggest the replication backlog, the longer the time the slave can be
  215. # disconnected and later be able to perform a partial resynchronization.
  216. #
  217. # The backlog is only allocated once there is at least a slave connected.
  218. #
  219. # repl-backlog-size 1mb
  220. # After a master has no longer connected slaves for some time, the backlog
  221. # will be freed. The following option configures the amount of seconds that
  222. # need to elapse, starting from the time the last slave disconnected, for
  223. # the backlog buffer to be freed.
  224. #
  225. # A value of 0 means to never release the backlog.
  226. #
  227. # repl-backlog-ttl 3600
  228. # The slave priority is an integer number published by Redis in the INFO output.
  229. # It is used by Redis Sentinel in order to select a slave to promote into a
  230. # master if the master is no longer working correctly.
  231. #
  232. # A slave with a low priority number is considered better for promotion, so
  233. # for instance if there are three slaves with priority 10, 100, 25 Sentinel will
  234. # pick the one with priority 10, that is the lowest.
  235. #
  236. # However a special priority of 0 marks the slave as not able to perform the
  237. # role of master, so a slave with priority of 0 will never be selected by
  238. # Redis Sentinel for promotion.
  239. #
  240. # By default the priority is 100.
  241. slave-priority 100
  242. # It is possible for a master to stop accepting writes if there are less than
  243. # N slaves connected, having a lag less or equal than M seconds.
  244. #
  245. # The N slaves need to be in "online" state.
  246. #
  247. # The lag in seconds, that must be <= the specified value, is calculated from
  248. # the last ping received from the slave, that is usually sent every second.
  249. #
  250. # This option does not GUARANTEES that N replicas will accept the write, but
  251. # will limit the window of exposure for lost writes in case not enough slaves
  252. # are available, to the specified number of seconds.
  253. #
  254. # For example to require at least 3 slaves with a lag <= 10 seconds use:
  255. #
  256. # min-slaves-to-write 3
  257. # min-slaves-max-lag 10
  258. #
  259. # Setting one or the other to 0 disables the feature.
  260. #
  261. # By default min-slaves-to-write is set to 0 (feature disabled) and
  262. # min-slaves-max-lag is set to 10.
  263. ################################## SECURITY ###################################
  264. # Require clients to issue AUTH <PASSWORD> before processing any other
  265. # commands. This might be useful in environments in which you do not trust
  266. # others with access to the host running redis-server.
  267. #
  268. # This should stay commented out for backward compatibility and because most
  269. # people do not need auth (e.g. they run their own servers).
  270. #
  271. # Warning: since Redis is pretty fast an outside user can try up to
  272. # 150k passwords per second against a good box. This means that you should
  273. # use a very strong password otherwise it will be very easy to break.
  274. #
  275. # requirepass foobared
  276. # Command renaming.
  277. #
  278. # It is possible to change the name of dangerous commands in a shared
  279. # environment. For instance the CONFIG command may be renamed into something
  280. # hard to guess so that it will still be available for internal-use tools
  281. # but not available for general clients.
  282. #
  283. # Example:
  284. #
  285. # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
  286. #
  287. # It is also possible to completely kill a command by renaming it into
  288. # an empty string:
  289. #
  290. # rename-command CONFIG ""
  291. #
  292. # Please note that changing the name of commands that are logged into the
  293. # AOF file or transmitted to slaves may cause problems.
  294. ################################### LIMITS ####################################
  295. # Set the max number of connected clients at the same time. By default
  296. # this limit is set to 10000 clients, however if the Redis server is not
  297. # able to configure the process file limit to allow for the specified limit
  298. # the max number of allowed clients is set to the current file limit
  299. # minus 32 (as Redis reserves a few file descriptors for internal uses).
  300. #
  301. # Once the limit is reached Redis will close all the new connections sending
  302. # an error 'max number of clients reached'.
  303. #
  304. # maxclients 10000
  305. # Don't use more memory than the specified amount of bytes.
  306. # When the memory limit is reached Redis will try to remove keys
  307. # accordingly to the eviction policy selected (see maxmemmory-policy).
  308. #
  309. # If Redis can't remove keys according to the policy, or if the policy is
  310. # set to 'noeviction', Redis will start to reply with errors to commands
  311. # that would use more memory, like SET, LPUSH, and so on, and will continue
  312. # to reply to read-only commands like GET.
  313. #
  314. # This option is usually useful when using Redis as an LRU cache, or to set
  315. # an hard memory limit for an instance (using the 'noeviction' policy).
  316. #
  317. # WARNING: If you have slaves attached to an instance with maxmemory on,
  318. # the size of the output buffers needed to feed the slaves are subtracted
  319. # from the used memory count, so that network problems / resyncs will
  320. # not trigger a loop where keys are evicted, and in turn the output
  321. # buffer of slaves is full with DELs of keys evicted triggering the deletion
  322. # of more keys, and so forth until the database is completely emptied.
  323. #
  324. # In short... if you have slaves attached it is suggested that you set a lower
  325. # limit for maxmemory so that there is some free RAM on the system for slave
  326. # output buffers (but this is not needed if the policy is 'noeviction').
  327. #
  328. # maxmemory <bytes>
  329. # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
  330. # is reached. You can select among five behaviors:
  331. #
  332. # volatile-lru -> remove the key with an expire set using an LRU algorithm
  333. # allkeys-lru -> remove any key accordingly to the LRU algorithm
  334. # volatile-random -> remove a random key with an expire set
  335. # allkeys-random -> remove a random key, any key
  336. # volatile-ttl -> remove the key with the nearest expire time (minor TTL)
  337. # noeviction -> don't expire at all, just return an error on write operations
  338. #
  339. # Note: with any of the above policies, Redis will return an error on write
  340. # operations, when there are not suitable keys for eviction.
  341. #
  342. # At the date of writing this commands are: set setnx setex append
  343. # incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
  344. # sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
  345. # zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
  346. # getset mset msetnx exec sort
  347. #
  348. # The default is:
  349. #
  350. # maxmemory-policy volatile-lru
  351. # LRU and minimal TTL algorithms are not precise algorithms but approximated
  352. # algorithms (in order to save memory), so you can select as well the sample
  353. # size to check. For instance for default Redis will check three keys and
  354. # pick the one that was used less recently, you can change the sample size
  355. # using the following configuration directive.
  356. #
  357. # maxmemory-samples 3
  358. ############################## APPEND ONLY MODE ###############################
  359. # By default Redis asynchronously dumps the dataset on disk. This mode is
  360. # good enough in many applications, but an issue with the Redis process or
  361. # a power outage may result into a few minutes of writes lost (depending on
  362. # the configured save points).
  363. #
  364. # The Append Only File is an alternative persistence mode that provides
  365. # much better durability. For instance using the default data fsync policy
  366. # (see later in the config file) Redis can lose just one second of writes in a
  367. # dramatic event like a server power outage, or a single write if something
  368. # wrong with the Redis process itself happens, but the operating system is
  369. # still running correctly.
  370. #
  371. # AOF and RDB persistence can be enabled at the same time without problems.
  372. # If the AOF is enabled on startup Redis will load the AOF, that is the file
  373. # with the better durability guarantees.
  374. #
  375. # Please check http://redis.io/topics/persistence for more information.
  376. appendonly no
  377. # The name of the append only file (default: "appendonly.aof")
  378. # appendfilename appendonly.aof
  379. # The fsync() call tells the Operating System to actually write data on disk
  380. # instead to wait for more data in the output buffer. Some OS will really flush
  381. # data on disk, some other OS will just try to do it ASAP.
  382. #
  383. # Redis supports three different modes:
  384. #
  385. # no: don't fsync, just let the OS flush the data when it wants. Faster.
  386. # always: fsync after every write to the append only log . Slow, Safest.
  387. # everysec: fsync only one time every second. Compromise.
  388. #
  389. # The default is "everysec", as that's usually the right compromise between
  390. # speed and data safety. It's up to you to understand if you can relax this to
  391. # "no" that will let the operating system flush the output buffer when
  392. # it wants, for better performances (but if you can live with the idea of
  393. # some data loss consider the default persistence mode that's snapshotting),
  394. # or on the contrary, use "always" that's very slow but a bit safer than
  395. # everysec.
  396. #
  397. # More details please check the following article:
  398. # http://antirez.com/post/redis-persistence-demystified.html
  399. #
  400. # If unsure, use "everysec".
  401. # appendfsync always
  402. appendfsync everysec
  403. # appendfsync no
  404. # When the AOF fsync policy is set to always or everysec, and a background
  405. # saving process (a background save or AOF log background rewriting) is
  406. # performing a lot of I/O against the disk, in some Linux configurations
  407. # Redis may block too long on the fsync() call. Note that there is no fix for
  408. # this currently, as even performing fsync in a different thread will block
  409. # our synchronous write(2) call.
  410. #
  411. # In order to mitigate this problem it's possible to use the following option
  412. # that will prevent fsync() from being called in the main process while a
  413. # BGSAVE or BGREWRITEAOF is in progress.
  414. #
  415. # This means that while another child is saving, the durability of Redis is
  416. # the same as "appendfsync none". In practical terms, this means that it is
  417. # possible to lose up to 30 seconds of log in the worst scenario (with the
  418. # default Linux settings).
  419. #
  420. # If you have latency problems turn this to "yes". Otherwise leave it as
  421. # "no" that is the safest pick from the point of view of durability.
  422. no-appendfsync-on-rewrite no
  423. # Automatic rewrite of the append only file.
  424. # Redis is able to automatically rewrite the log file implicitly calling
  425. # BGREWRITEAOF when the AOF log size grows by the specified percentage.
  426. #
  427. # This is how it works: Redis remembers the size of the AOF file after the
  428. # latest rewrite (if no rewrite has happened since the restart, the size of
  429. # the AOF at startup is used).
  430. #
  431. # This base size is compared to the current size. If the current size is
  432. # bigger than the specified percentage, the rewrite is triggered. Also
  433. # you need to specify a minimal size for the AOF file to be rewritten, this
  434. # is useful to avoid rewriting the AOF file even if the percentage increase
  435. # is reached but it is still pretty small.
  436. #
  437. # Specify a percentage of zero in order to disable the automatic AOF
  438. # rewrite feature.
  439. auto-aof-rewrite-percentage 100
  440. auto-aof-rewrite-min-size 64mb
  441. ################################ LUA SCRIPTING ###############################
  442. # Max execution time of a Lua script in milliseconds.
  443. #
  444. # If the maximum execution time is reached Redis will log that a script is
  445. # still in execution after the maximum allowed time and will start to
  446. # reply to queries with an error.
  447. #
  448. # When a long running script exceed the maximum execution time only the
  449. # SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
  450. # used to stop a script that did not yet called write commands. The second
  451. # is the only way to shut down the server in the case a write commands was
  452. # already issue by the script but the user don't want to wait for the natural
  453. # termination of the script.
  454. #
  455. # Set it to 0 or a negative value for unlimited execution without warnings.
  456. lua-time-limit 5000
  457. ################################## SLOW LOG ###################################
  458. # The Redis Slow Log is a system to log queries that exceeded a specified
  459. # execution time. The execution time does not include the I/O operations
  460. # like talking with the client, sending the reply and so forth,
  461. # but just the time needed to actually execute the command (this is the only
  462. # stage of command execution where the thread is blocked and can not serve
  463. # other requests in the meantime).
  464. #
  465. # You can configure the slow log with two parameters: one tells Redis
  466. # what is the execution time, in microseconds, to exceed in order for the
  467. # command to get logged, and the other parameter is the length of the
  468. # slow log. When a new command is logged the oldest one is removed from the
  469. # queue of logged commands.
  470. # The following time is expressed in microseconds, so 1000000 is equivalent
  471. # to one second. Note that a negative number disables the slow log, while
  472. # a value of zero forces the logging of every command.
  473. slowlog-log-slower-than 10000
  474. # There is no limit to this length. Just be aware that it will consume memory.
  475. # You can reclaim memory used by the slow log with SLOWLOG RESET.
  476. slowlog-max-len 128
  477. ############################# Event notification ##############################
  478. # Redis can notify Pub/Sub clients about events happening in the key space.
  479. # This feature is documented at http://redis.io/topics/keyspace-events
  480. #
  481. # For instance if keyspace events notification is enabled, and a client
  482. # performs a DEL operation on key "foo" stored in the Database 0, two
  483. # messages will be published via Pub/Sub:
  484. #
  485. # PUBLISH __keyspace@0__:foo del
  486. # PUBLISH __keyevent@0__:del foo
  487. #
  488. # It is possible to select the events that Redis will notify among a set
  489. # of classes. Every class is identified by a single character:
  490. #
  491. # K Keyspace events, published with __keyspace@<db>__ prefix.
  492. # E Keyevent events, published with __keyevent@<db>__ prefix.
  493. # g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
  494. # $ String commands
  495. # l List commands
  496. # s Set commands
  497. # h Hash commands
  498. # z Sorted set commands
  499. # x Expired events (events generated every time a key expires)
  500. # e Evicted events (events generated when a key is evicted for maxmemory)
  501. # A Alias for g$lshzxe, so that the "AKE" string means all the events.
  502. #
  503. # The "notify-keyspace-events" takes as argument a string that is composed
  504. # by zero or multiple characters. The empty string means that notifications
  505. # are disabled at all.
  506. #
  507. # Example: to enable list and generic events, from the point of view of the
  508. # event name, use:
  509. #
  510. # notify-keyspace-events Elg
  511. #
  512. # Example 2: to get the stream of the expired keys subscribing to channel
  513. # name __keyevent@0__:expired use:
  514. #
  515. # notify-keyspace-events Ex
  516. #
  517. # By default all notifications are disabled because most users don't need
  518. # this feature and the feature has some overhead. Note that if you don't
  519. # specify at least one of K or E, no events will be delivered.
  520. notify-keyspace-events ""
  521. ############################### ADVANCED CONFIG ###############################
  522. # Hashes are encoded using a memory efficient data structure when they have a
  523. # small number of entries, and the biggest entry does not exceed a given
  524. # threshold. These thresholds can be configured using the following directives.
  525. hash-max-ziplist-entries 512
  526. hash-max-ziplist-value 64
  527. # Similarly to hashes, small lists are also encoded in a special way in order
  528. # to save a lot of space. The special representation is only used when
  529. # you are under the following limits:
  530. list-max-ziplist-entries 512
  531. list-max-ziplist-value 64
  532. # Sets have a special encoding in just one case: when a set is composed
  533. # of just strings that happens to be integers in radix 10 in the range
  534. # of 64 bit signed integers.
  535. # The following configuration setting sets the limit in the size of the
  536. # set in order to use this special memory saving encoding.
  537. set-max-intset-entries 512
  538. # Similarly to hashes and lists, sorted sets are also specially encoded in
  539. # order to save a lot of space. This encoding is only used when the length and
  540. # elements of a sorted set are below the following limits:
  541. zset-max-ziplist-entries 128
  542. zset-max-ziplist-value 64
  543. # Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
  544. # order to help rehashing the main Redis hash table (the one mapping top-level
  545. # keys to values). The hash table implementation Redis uses (see dict.c)
  546. # performs a lazy rehashing: the more operation you run into an hash table
  547. # that is rehashing, the more rehashing "steps" are performed, so if the
  548. # server is idle the rehashing is never complete and some more memory is used
  549. # by the hash table.
  550. #
  551. # The default is to use this millisecond 10 times every second in order to
  552. # active rehashing the main dictionaries, freeing memory when possible.
  553. #
  554. # If unsure:
  555. # use "activerehashing no" if you have hard latency requirements and it is
  556. # not a good thing in your environment that Redis can reply form time to time
  557. # to queries with 2 milliseconds delay.
  558. #
  559. # use "activerehashing yes" if you don't have such hard requirements but
  560. # want to free memory asap when possible.
  561. activerehashing yes
  562. # The client output buffer limits can be used to force disconnection of clients
  563. # that are not reading data from the server fast enough for some reason (a
  564. # common reason is that a Pub/Sub client can't consume messages as fast as the
  565. # publisher can produce them).
  566. #
  567. # The limit can be set differently for the three different classes of clients:
  568. #
  569. # normal -> normal clients
  570. # slave -> slave clients and MONITOR clients
  571. # pubsub -> clients subcribed to at least one pubsub channel or pattern
  572. #
  573. # The syntax of every client-output-buffer-limit directive is the following:
  574. #
  575. # client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
  576. #
  577. # A client is immediately disconnected once the hard limit is reached, or if
  578. # the soft limit is reached and remains reached for the specified number of
  579. # seconds (continuously).
  580. # So for instance if the hard limit is 32 megabytes and the soft limit is
  581. # 16 megabytes / 10 seconds, the client will get disconnected immediately
  582. # if the size of the output buffers reach 32 megabytes, but will also get
  583. # disconnected if the client reaches 16 megabytes and continuously overcomes
  584. # the limit for 10 seconds.
  585. #
  586. # By default normal clients are not limited because they don't receive data
  587. # without asking (in a push way), but just after a request, so only
  588. # asynchronous clients may create a scenario where data is requested faster
  589. # than it can read.
  590. #
  591. # Instead there is a default limit for pubsub and slave clients, since
  592. # subscribers and slaves receive data in a push fashion.
  593. #
  594. # Both the hard or the soft limit can be disabled by setting them to zero.
  595. client-output-buffer-limit normal 0 0 0
  596. client-output-buffer-limit slave 256mb 64mb 60
  597. client-output-buffer-limit pubsub 32mb 8mb 60
  598. # Redis calls an internal function to perform many background tasks, like
  599. # closing connections of clients in timeot, purging expired keys that are
  600. # never requested, and so forth.
  601. #
  602. # Not all tasks are performed with the same frequency, but Redis checks for
  603. # tasks to perform accordingly to the specified "hz" value.
  604. #
  605. # By default "hz" is set to 10. Raising the value will use more CPU when
  606. # Redis is idle, but at the same time will make Redis more responsive when
  607. # there are many keys expiring at the same time, and timeouts may be
  608. # handled with more precision.
  609. #
  610. # The range is between 1 and 500, however a value over 100 is usually not
  611. # a good idea. Most users should use the default of 10 and raise this up to
  612. # 100 only in environments where very low latency is required.
  613. hz 10
  614. # When a child rewrites the AOF file, if the following option is enabled
  615. # the file will be fsync-ed every 32 MB of data generated. This is useful
  616. # in order to commit the file to the disk more incrementally and avoid
  617. # big latency spikes.
  618. aof-rewrite-incremental-fsync yes
  619. ################################## INCLUDES ###################################
  620. # Include one or more other config files here. This is useful if you
  621. # have a standard template that goes to all Redis server but also need
  622. # to customize a few per-server settings. Include files can include
  623. # other files, so use this wisely.
  624. #
  625. # include /path/to/local.conf
  626. # include /path/to/other.conf