diff options
author | Alistair Francis <alistair.francis@wdc.com> | 2018-05-24 10:18:12 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-05-29 12:56:19 -0700 |
commit | 4b9e0f546e024680d7897d06037fa79c78058c3c (patch) | |
tree | 2ac60afd7a80f123e411712b3e69e71723bcb75f | |
parent | e148ac43cc465f094a4b0dc3a0063fc02a612f21 (diff) | |
download | meta-openembedded-4b9e0f546e024680d7897d06037fa79c78058c3c.tar.gz |
redis: Update to 4.0.8
Update redis to the latest 4.0.8 release. This also involves updating
the redis.conf while maintaining some OE specific config options.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-extended/redis/redis/hiredis-update-Makefile-to-add-symbols-to-staticlib.patch | 19 | ||||
-rw-r--r-- | meta-oe/recipes-extended/redis/redis/hiredis-use-default-CC-if-it-is-set.patch | 12 | ||||
-rw-r--r-- | meta-oe/recipes-extended/redis/redis/oe-use-libc-malloc.patch | 10 | ||||
-rw-r--r-- | meta-oe/recipes-extended/redis/redis/redis.conf | 974 | ||||
-rw-r--r-- | meta-oe/recipes-extended/redis/redis/remove-atomics.patch | 72 | ||||
-rw-r--r-- | meta-oe/recipes-extended/redis/redis_4.0.8.bb (renamed from meta-oe/recipes-extended/redis/redis_3.0.2.bb) | 7 |
6 files changed, 956 insertions, 138 deletions
diff --git a/meta-oe/recipes-extended/redis/redis/hiredis-update-Makefile-to-add-symbols-to-staticlib.patch b/meta-oe/recipes-extended/redis/redis/hiredis-update-Makefile-to-add-symbols-to-staticlib.patch deleted file mode 100644 index 2b3b587936..0000000000 --- a/meta-oe/recipes-extended/redis/redis/hiredis-update-Makefile-to-add-symbols-to-staticlib.patch +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | --- redis-3.0.2/deps/hiredis/Makefile.orig 2016-05-06 19:36:26.179003036 -0700 | ||
2 | +++ redis-3.0.2/deps/hiredis/Makefile 2016-05-06 19:40:15.341340736 -0700 | ||
3 | @@ -25,7 +25,7 @@ | ||
4 | |||
5 | # Fallback to gcc when $CC is not in $PATH. | ||
6 | CC?=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc') | ||
7 | -OPTIMIZATION?=-O3 | ||
8 | +OPTIMIZATION?=-O2 | ||
9 | WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings | ||
10 | DEBUG?= -g -ggdb | ||
11 | REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG) $(ARCH) | ||
12 | @@ -68,6 +68,7 @@ | ||
13 | |||
14 | $(STLIBNAME): $(OBJ) | ||
15 | $(STLIB_MAKE_CMD) $(OBJ) | ||
16 | + $(RANLIB) $@ | ||
17 | |||
18 | dynamic: $(DYLIBNAME) | ||
19 | static: $(STLIBNAME) | ||
diff --git a/meta-oe/recipes-extended/redis/redis/hiredis-use-default-CC-if-it-is-set.patch b/meta-oe/recipes-extended/redis/redis/hiredis-use-default-CC-if-it-is-set.patch index f9f1c0dbd5..421f306ded 100644 --- a/meta-oe/recipes-extended/redis/redis/hiredis-use-default-CC-if-it-is-set.patch +++ b/meta-oe/recipes-extended/redis/redis/hiredis-use-default-CC-if-it-is-set.patch | |||
@@ -8,23 +8,23 @@ as CC has spaces in it, just skip it if one was already passed in. | |||
8 | 8 | ||
9 | Signed-off-by: Venture Research <tech@ventureresearch.com> | 9 | Signed-off-by: Venture Research <tech@ventureresearch.com> |
10 | 10 | ||
11 | Update to work with 3.0.x | 11 | Update to work with 4.0.8 |
12 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | 12 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> |
13 | 13 | ||
14 | --- | 14 | --- |
15 | deps/hiredis/Makefile | 2 +- | 15 | deps/hiredis/Makefile | 2 +- |
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | 16 | 1 file changed, 1 insertion(+), 1 deletion(-) |
17 | 17 | ||
18 | Index: deps/hiredis/Makefile | 18 | diff --git a/deps/hiredis/Makefile b/deps/hiredis/Makefile |
19 | =================================================================== | 19 | index 9a4de836..271c06ba 100644 |
20 | --- a/deps/hiredis/Makefile | 20 | --- a/deps/hiredis/Makefile |
21 | +++ b/deps/hiredis/Makefile | 21 | +++ b/deps/hiredis/Makefile |
22 | @@ -24,7 +24,7 @@ endef | 22 | @@ -36,7 +36,7 @@ endef |
23 | export REDIS_TEST_CONFIG | 23 | export REDIS_TEST_CONFIG |
24 | 24 | ||
25 | # Fallback to gcc when $CC is not in $PATH. | 25 | # Fallback to gcc when $CC is not in $PATH. |
26 | -CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc') | 26 | -CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc') |
27 | +CC?=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc') | 27 | +CC?=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc') |
28 | CXX:=$(shell sh -c 'type $(CXX) >/dev/null 2>/dev/null && echo $(CXX) || echo g++') | ||
28 | OPTIMIZATION?=-O3 | 29 | OPTIMIZATION?=-O3 |
29 | WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings | 30 | WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings |
30 | DEBUG?= -g -ggdb | ||
diff --git a/meta-oe/recipes-extended/redis/redis/oe-use-libc-malloc.patch b/meta-oe/recipes-extended/redis/redis/oe-use-libc-malloc.patch index b768a77491..6745f3d0e0 100644 --- a/meta-oe/recipes-extended/redis/redis/oe-use-libc-malloc.patch +++ b/meta-oe/recipes-extended/redis/redis/oe-use-libc-malloc.patch | |||
@@ -11,15 +11,15 @@ jemalloc wasn't building correctly. | |||
11 | 11 | ||
12 | Signed-off-by: Venture Research <tech@ventureresearch.com> | 12 | Signed-off-by: Venture Research <tech@ventureresearch.com> |
13 | 13 | ||
14 | Update to work with 3.0.x | 14 | Update to work with 4.0.8 |
15 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | 15 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> |
16 | 16 | ||
17 | --- | 17 | --- |
18 | src/Makefile | 2 +- | 18 | src/Makefile | 2 +- |
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | 19 | 1 file changed, 1 insertion(+), 1 deletion(-) |
20 | 20 | ||
21 | Index: src/Makefile | 21 | diff --git a/src/Makefile b/src/Makefile |
22 | =================================================================== | 22 | index 86e0b3fe..a810180b 100644 |
23 | --- a/src/Makefile | 23 | --- a/src/Makefile |
24 | +++ b/src/Makefile | 24 | +++ b/src/Makefile |
25 | @@ -13,7 +13,8 @@ | 25 | @@ -13,7 +13,8 @@ |
@@ -29,6 +29,6 @@ Index: src/Makefile | |||
29 | -uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') | 29 | -uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
30 | +# use fake uname option to force use of generic libc | 30 | +# use fake uname option to force use of generic libc |
31 | +uname_S := "USE_LIBC_MALLOC" | 31 | +uname_S := "USE_LIBC_MALLOC" |
32 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') | ||
32 | OPTIMIZATION?=-O2 | 33 | OPTIMIZATION?=-O2 |
33 | DEPENDENCY_TARGETS=hiredis linenoise lua | 34 | DEPENDENCY_TARGETS=hiredis linenoise lua |
34 | |||
diff --git a/meta-oe/recipes-extended/redis/redis/redis.conf b/meta-oe/recipes-extended/redis/redis/redis.conf index ab024ad852..75037d6dc8 100644 --- a/meta-oe/recipes-extended/redis/redis/redis.conf +++ b/meta-oe/recipes-extended/redis/redis/redis.conf | |||
@@ -1,4 +1,9 @@ | |||
1 | # Redis configuration file example | 1 | # Redis configuration file example. |
2 | # | ||
3 | # Note that in order to read the configuration file, Redis must be | ||
4 | # started with the file path as first argument: | ||
5 | # | ||
6 | # ./redis-server /path/to/redis.conf | ||
2 | 7 | ||
3 | # Note on units: when memory size is needed, it is possible to specify | 8 | # Note on units: when memory size is needed, it is possible to specify |
4 | # it in the usual form of 1k 5GB 4M and so forth: | 9 | # it in the usual form of 1k 5GB 4M and so forth: |
@@ -12,48 +17,160 @@ | |||
12 | # | 17 | # |
13 | # units are case insensitive so 1GB 1Gb 1gB are all the same. | 18 | # units are case insensitive so 1GB 1Gb 1gB are all the same. |
14 | 19 | ||
15 | # By default Redis does not run as a daemon. Use 'yes' if you need it. | 20 | ################################## INCLUDES ################################### |
16 | # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. | 21 | |
22 | # Include one or more other config files here. This is useful if you | ||
23 | # have a standard template that goes to all Redis servers but also need | ||
24 | # to customize a few per-server settings. Include files can include | ||
25 | # other files, so use this wisely. | ||
17 | # | 26 | # |
18 | # OE: run as a daemon. | 27 | # Notice option "include" won't be rewritten by command "CONFIG REWRITE" |
28 | # from admin or Redis Sentinel. Since Redis always uses the last processed | ||
29 | # line as value of a configuration directive, you'd better put includes | ||
30 | # at the beginning of this file to avoid overwriting config change at runtime. | ||
19 | # | 31 | # |
20 | daemonize yes | 32 | # If instead you are interested in using includes to override configuration |
33 | # options, it is better to use include as the last line. | ||
34 | # | ||
35 | # include /path/to/local.conf | ||
36 | # include /path/to/other.conf | ||
21 | 37 | ||
22 | # When running daemonized, Redis writes a pid file in /var/run/redis.pid by | 38 | ################################## MODULES ##################################### |
23 | # default. You can specify a custom pid file location here. | 39 | |
24 | pidfile /var/run/redis.pid | 40 | # Load modules at startup. If the server is not able to load modules |
41 | # it will abort. It is possible to use multiple loadmodule directives. | ||
42 | # | ||
43 | # loadmodule /path/to/my_module.so | ||
44 | # loadmodule /path/to/other_module.so | ||
45 | |||
46 | ################################## NETWORK ##################################### | ||
25 | 47 | ||
26 | # Accept connections on the specified port, default is 6379. | 48 | # By default, if no "bind" configuration directive is specified, Redis listens |
49 | # for connections from all the network interfaces available on the server. | ||
50 | # It is possible to listen to just one or multiple selected interfaces using | ||
51 | # the "bind" configuration directive, followed by one or more IP addresses. | ||
52 | # | ||
53 | # Examples: | ||
54 | # | ||
55 | # bind 192.168.1.100 10.0.0.1 | ||
56 | # bind 127.0.0.1 ::1 | ||
57 | # | ||
58 | # ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the | ||
59 | # internet, binding to all the interfaces is dangerous and will expose the | ||
60 | # instance to everybody on the internet. So by default we uncomment the | ||
61 | # following bind directive, that will force Redis to listen only into | ||
62 | # the IPv4 lookback interface address (this means Redis will be able to | ||
63 | # accept connections only from clients running into the same computer it | ||
64 | # is running). | ||
65 | # | ||
66 | # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES | ||
67 | # JUST COMMENT THE FOLLOWING LINE. | ||
68 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
69 | bind 127.0.0.1 | ||
70 | |||
71 | # Protected mode is a layer of security protection, in order to avoid that | ||
72 | # Redis instances left open on the internet are accessed and exploited. | ||
73 | # | ||
74 | # When protected mode is on and if: | ||
75 | # | ||
76 | # 1) The server is not binding explicitly to a set of addresses using the | ||
77 | # "bind" directive. | ||
78 | # 2) No password is configured. | ||
79 | # | ||
80 | # The server only accepts connections from clients connecting from the | ||
81 | # IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain | ||
82 | # sockets. | ||
83 | # | ||
84 | # By default protected mode is enabled. You should disable it only if | ||
85 | # you are sure you want clients from other hosts to connect to Redis | ||
86 | # even if no authentication is configured, nor a specific set of interfaces | ||
87 | # are explicitly listed using the "bind" directive. | ||
88 | protected-mode yes | ||
89 | |||
90 | # Accept connections on the specified port, default is 6379 (IANA #815344). | ||
27 | # If port 0 is specified Redis will not listen on a TCP socket. | 91 | # If port 0 is specified Redis will not listen on a TCP socket. |
28 | port 6379 | 92 | port 6379 |
29 | 93 | ||
30 | # If you want you can bind a single interface, if the bind option is not | 94 | # TCP listen() backlog. |
31 | # specified all the interfaces will listen for incoming connections. | 95 | # |
32 | # | 96 | # In high requests-per-second environments you need an high backlog in order |
33 | bind 127.0.0.1 | 97 | # to avoid slow clients connections issues. Note that the Linux kernel |
98 | # will silently truncate it to the value of /proc/sys/net/core/somaxconn so | ||
99 | # make sure to raise both the value of somaxconn and tcp_max_syn_backlog | ||
100 | # in order to get the desired effect. | ||
101 | tcp-backlog 511 | ||
34 | 102 | ||
35 | # Specify the path for the unix socket that will be used to listen for | 103 | # Unix socket. |
104 | # | ||
105 | # Specify the path for the Unix socket that will be used to listen for | ||
36 | # incoming connections. There is no default, so Redis will not listen | 106 | # incoming connections. There is no default, so Redis will not listen |
37 | # on a unix socket when not specified. | 107 | # on a unix socket when not specified. |
38 | # | 108 | # |
39 | # unixsocket /tmp/redis.sock | 109 | # unixsocket /tmp/redis.sock |
40 | # unixsocketperm 755 | 110 | # unixsocketperm 700 |
41 | 111 | ||
42 | # Close the connection after a client is idle for N seconds (0 to disable) | 112 | # Close the connection after a client is idle for N seconds (0 to disable) |
43 | timeout 0 | 113 | timeout 0 |
44 | 114 | ||
45 | # Set server verbosity to 'debug' | 115 | # TCP keepalive. |
46 | # it can be one of: | 116 | # |
117 | # If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence | ||
118 | # of communication. This is useful for two reasons: | ||
119 | # | ||
120 | # 1) Detect dead peers. | ||
121 | # 2) Take the connection alive from the point of view of network | ||
122 | # equipment in the middle. | ||
123 | # | ||
124 | # On Linux, the specified value (in seconds) is the period used to send ACKs. | ||
125 | # Note that to close the connection the double of the time is needed. | ||
126 | # On other kernels the period depends on the kernel configuration. | ||
127 | # | ||
128 | # A reasonable value for this option is 300 seconds, which is the new | ||
129 | # Redis default starting with Redis 3.2.1. | ||
130 | tcp-keepalive 300 | ||
131 | |||
132 | ################################# GENERAL ##################################### | ||
133 | |||
134 | # OE: run as a daemon. | ||
135 | daemonize yes | ||
136 | |||
137 | # If you run Redis from upstart or systemd, Redis can interact with your | ||
138 | # supervision tree. Options: | ||
139 | # supervised no - no supervision interaction | ||
140 | # supervised upstart - signal upstart by putting Redis into SIGSTOP mode | ||
141 | # supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET | ||
142 | # supervised auto - detect upstart or systemd method based on | ||
143 | # UPSTART_JOB or NOTIFY_SOCKET environment variables | ||
144 | # Note: these supervision methods only signal "process is ready." | ||
145 | # They do not enable continuous liveness pings back to your supervisor. | ||
146 | supervised no | ||
147 | |||
148 | # If a pid file is specified, Redis writes it where specified at startup | ||
149 | # and removes it at exit. | ||
150 | # | ||
151 | # When the server runs non daemonized, no pid file is created if none is | ||
152 | # specified in the configuration. When the server is daemonized, the pid file | ||
153 | # is used even if not specified, defaulting to "/var/run/redis.pid". | ||
154 | # | ||
155 | # Creating a pid file is best effort: if Redis is not able to create it | ||
156 | # nothing bad happens, the server will start and run normally. | ||
157 | |||
158 | # When running daemonized, Redis writes a pid file in /var/run/redis.pid by | ||
159 | # default. You can specify a custom pid file location here. | ||
160 | pidfile /var/run/redis.pid | ||
161 | |||
162 | # Specify the server verbosity level. | ||
163 | # This can be one of: | ||
47 | # debug (a lot of information, useful for development/testing) | 164 | # debug (a lot of information, useful for development/testing) |
48 | # verbose (many rarely useful info, but not a mess like the debug level) | 165 | # verbose (many rarely useful info, but not a mess like the debug level) |
49 | # notice (moderately verbose, what you want in production probably) | 166 | # notice (moderately verbose, what you want in production probably) |
50 | # warning (only very important / critical messages are logged) | 167 | # warning (only very important / critical messages are logged) |
51 | loglevel notice | 168 | loglevel notice |
52 | 169 | ||
53 | # Specify the log file name. Also 'stdout' can be used to force | 170 | # Specify the log file name. Also the empty string can be used to force |
54 | # Redis to log on the standard output. Note that if you use standard | 171 | # Redis to log on the standard output. Note that if you use standard |
55 | # output for logging but daemonize, logs will be sent to /dev/null | 172 | # output for logging but daemonize, logs will be sent to /dev/null |
56 | # logfile /var/log/redis.log | 173 | logfile "" |
57 | 174 | ||
58 | # To enable logging to the system logger, just set 'syslog-enabled' to yes, | 175 | # To enable logging to the system logger, just set 'syslog-enabled' to yes, |
59 | # and optionally update the other syslog parameters to suit your needs. | 176 | # and optionally update the other syslog parameters to suit your needs. |
@@ -62,7 +179,7 @@ syslog-enabled yes | |||
62 | # Specify the syslog identity. | 179 | # Specify the syslog identity. |
63 | syslog-ident redis | 180 | syslog-ident redis |
64 | 181 | ||
65 | # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. | 182 | # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. |
66 | # syslog-facility local0 | 183 | # syslog-facility local0 |
67 | 184 | ||
68 | # Set the number of databases. The default database is DB 0, you can select | 185 | # Set the number of databases. The default database is DB 0, you can select |
@@ -70,7 +187,15 @@ syslog-ident redis | |||
70 | # dbid is a number between 0 and 'databases'-1 | 187 | # dbid is a number between 0 and 'databases'-1 |
71 | databases 16 | 188 | databases 16 |
72 | 189 | ||
73 | ################################ SNAPSHOTTING ################################# | 190 | # By default Redis shows an ASCII art logo only when started to log to the |
191 | # standard output and if the standard output is a TTY. Basically this means | ||
192 | # that normally a logo is displayed only in interactive sessions. | ||
193 | # | ||
194 | # However it is possible to force the pre-4.0 behavior and always show a | ||
195 | # ASCII art logo in startup logs by setting the following option to yes. | ||
196 | always-show-logo yes | ||
197 | |||
198 | ################################ SNAPSHOTTING ################################ | ||
74 | # | 199 | # |
75 | # Save the DB on disk: | 200 | # Save the DB on disk: |
76 | # | 201 | # |
@@ -84,7 +209,7 @@ databases 16 | |||
84 | # after 300 sec (5 min) if at least 10 keys changed | 209 | # after 300 sec (5 min) if at least 10 keys changed |
85 | # after 60 sec if at least 10000 keys changed | 210 | # after 60 sec if at least 10000 keys changed |
86 | # | 211 | # |
87 | # Note: you can disable saving at all commenting all the "save" lines. | 212 | # Note: you can disable saving completely by commenting out all "save" lines. |
88 | # | 213 | # |
89 | # It is also possible to remove all the previously configured save | 214 | # It is also possible to remove all the previously configured save |
90 | # points by adding a save directive with a single empty string argument | 215 | # points by adding a save directive with a single empty string argument |
@@ -103,16 +228,16 @@ save 30 1000 | |||
103 | 228 | ||
104 | # By default Redis will stop accepting writes if RDB snapshots are enabled | 229 | # By default Redis will stop accepting writes if RDB snapshots are enabled |
105 | # (at least one save point) and the latest background save failed. | 230 | # (at least one save point) and the latest background save failed. |
106 | # This will make the user aware (in an hard way) that data is not persisting | 231 | # This will make the user aware (in a hard way) that data is not persisting |
107 | # on disk properly, otherwise chances are that no one will notice and some | 232 | # on disk properly, otherwise chances are that no one will notice and some |
108 | # distater will happen. | 233 | # disaster will happen. |
109 | # | 234 | # |
110 | # If the background saving process will start working again Redis will | 235 | # If the background saving process will start working again Redis will |
111 | # automatically allow writes again. | 236 | # automatically allow writes again. |
112 | # | 237 | # |
113 | # However if you have setup your proper monitoring of the Redis server | 238 | # However if you have setup your proper monitoring of the Redis server |
114 | # and persistence, you may want to disable this feature so that Redis will | 239 | # and persistence, you may want to disable this feature so that Redis will |
115 | # continue to work as usually even if there are problems with disk, | 240 | # continue to work as usual even if there are problems with disk, |
116 | # permissions, and so forth. | 241 | # permissions, and so forth. |
117 | stop-writes-on-bgsave-error yes | 242 | stop-writes-on-bgsave-error yes |
118 | 243 | ||
@@ -122,7 +247,7 @@ stop-writes-on-bgsave-error yes | |||
122 | # the dataset will likely be bigger if you have compressible values or keys. | 247 | # the dataset will likely be bigger if you have compressible values or keys. |
123 | rdbcompression yes | 248 | rdbcompression yes |
124 | 249 | ||
125 | # Since verison 5 of RDB a CRC64 checksum is placed at the end of the file. | 250 | # Since version 5 of RDB a CRC64 checksum is placed at the end of the file. |
126 | # This makes the format more resistant to corruption but there is a performance | 251 | # This makes the format more resistant to corruption but there is a performance |
127 | # hit to pay (around 10%) when saving and loading RDB files, so you can disable it | 252 | # hit to pay (around 10%) when saving and loading RDB files, so you can disable it |
128 | # for maximum performances. | 253 | # for maximum performances. |
@@ -138,18 +263,27 @@ dbfilename dump.rdb | |||
138 | # | 263 | # |
139 | # The DB will be written inside this directory, with the filename specified | 264 | # The DB will be written inside this directory, with the filename specified |
140 | # above using the 'dbfilename' configuration directive. | 265 | # above using the 'dbfilename' configuration directive. |
141 | # | 266 | # |
142 | # Also the Append Only File will be created inside this directory. | 267 | # The Append Only File will also be created inside this directory. |
143 | # | 268 | # |
144 | # Note that you must specify a directory here, not a file name. | 269 | # Note that you must specify a directory here, not a file name. |
145 | dir /var/lib/redis/ | 270 | dir /var/lib/redis/ |
146 | 271 | ||
147 | ################################# REPLICATION ################################# | 272 | ################################# REPLICATION ################################# |
148 | 273 | ||
149 | # Master-Slave replication. Use slaveof to make a Redis instance a copy of | 274 | # Master-Slave replication. Use slaveof to make a Redis instance a copy of |
150 | # another Redis server. Note that the configuration is local to the slave | 275 | # another Redis server. A few things to understand ASAP about Redis replication. |
151 | # so for example it is possible to configure the slave to save the DB with a | 276 | # |
152 | # different interval, or to listen to another port, and so on. | 277 | # 1) Redis replication is asynchronous, but you can configure a master to |
278 | # stop accepting writes if it appears to be not connected with at least | ||
279 | # a given number of slaves. | ||
280 | # 2) Redis slaves are able to perform a partial resynchronization with the | ||
281 | # master if the replication link is lost for a relatively small amount of | ||
282 | # time. You may want to configure the replication backlog size (see the next | ||
283 | # sections of this file) with a sensible value depending on your needs. | ||
284 | # 3) Replication is automatic and does not need user intervention. After a | ||
285 | # network partition slaves automatically try to reconnect to masters | ||
286 | # and resynchronize with them. | ||
153 | # | 287 | # |
154 | # slaveof <masterip> <masterport> | 288 | # slaveof <masterip> <masterport> |
155 | 289 | ||
@@ -160,14 +294,14 @@ dir /var/lib/redis/ | |||
160 | # | 294 | # |
161 | # masterauth <master-password> | 295 | # masterauth <master-password> |
162 | 296 | ||
163 | # When a slave lost the connection with the master, or when the replication | 297 | # When a slave loses its connection with the master, or when the replication |
164 | # is still in progress, the slave can act in two different ways: | 298 | # is still in progress, the slave can act in two different ways: |
165 | # | 299 | # |
166 | # 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will | 300 | # 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will |
167 | # still reply to client requests, possibly with out of date data, or the | 301 | # still reply to client requests, possibly with out of date data, or the |
168 | # data set may just be empty if this is the first synchronization. | 302 | # data set may just be empty if this is the first synchronization. |
169 | # | 303 | # |
170 | # 2) if slave-serve-stale data is set to 'no' the slave will reply with | 304 | # 2) if slave-serve-stale-data is set to 'no' the slave will reply with |
171 | # an error "SYNC with master in progress" to all the kind of commands | 305 | # an error "SYNC with master in progress" to all the kind of commands |
172 | # but to INFO and SLAVEOF. | 306 | # but to INFO and SLAVEOF. |
173 | # | 307 | # |
@@ -184,19 +318,65 @@ slave-serve-stale-data yes | |||
184 | # Note: read only slaves are not designed to be exposed to untrusted clients | 318 | # Note: read only slaves are not designed to be exposed to untrusted clients |
185 | # on the internet. It's just a protection layer against misuse of the instance. | 319 | # on the internet. It's just a protection layer against misuse of the instance. |
186 | # Still a read only slave exports by default all the administrative commands | 320 | # Still a read only slave exports by default all the administrative commands |
187 | # such as CONFIG, DEBUG, and so forth. To a limited extend you can improve | 321 | # such as CONFIG, DEBUG, and so forth. To a limited extent you can improve |
188 | # security of read only slaves using 'rename-command' to shadow all the | 322 | # security of read only slaves using 'rename-command' to shadow all the |
189 | # administrative / dangerous commands. | 323 | # administrative / dangerous commands. |
190 | slave-read-only yes | 324 | slave-read-only yes |
191 | 325 | ||
326 | # Replication SYNC strategy: disk or socket. | ||
327 | # | ||
328 | # ------------------------------------------------------- | ||
329 | # WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY | ||
330 | # ------------------------------------------------------- | ||
331 | # | ||
332 | # New slaves and reconnecting slaves that are not able to continue the replication | ||
333 | # process just receiving differences, need to do what is called a "full | ||
334 | # synchronization". An RDB file is transmitted from the master to the slaves. | ||
335 | # The transmission can happen in two different ways: | ||
336 | # | ||
337 | # 1) Disk-backed: The Redis master creates a new process that writes the RDB | ||
338 | # file on disk. Later the file is transferred by the parent | ||
339 | # process to the slaves incrementally. | ||
340 | # 2) Diskless: The Redis master creates a new process that directly writes the | ||
341 | # RDB file to slave sockets, without touching the disk at all. | ||
342 | # | ||
343 | # With disk-backed replication, while the RDB file is generated, more slaves | ||
344 | # can be queued and served with the RDB file as soon as the current child producing | ||
345 | # the RDB file finishes its work. With diskless replication instead once | ||
346 | # the transfer starts, new slaves arriving will be queued and a new transfer | ||
347 | # will start when the current one terminates. | ||
348 | # | ||
349 | # When diskless replication is used, the master waits a configurable amount of | ||
350 | # time (in seconds) before starting the transfer in the hope that multiple slaves | ||
351 | # will arrive and the transfer can be parallelized. | ||
352 | # | ||
353 | # With slow disks and fast (large bandwidth) networks, diskless replication | ||
354 | # works better. | ||
355 | repl-diskless-sync no | ||
356 | |||
357 | # When diskless replication is enabled, it is possible to configure the delay | ||
358 | # the server waits in order to spawn the child that transfers the RDB via socket | ||
359 | # to the slaves. | ||
360 | # | ||
361 | # This is important since once the transfer starts, it is not possible to serve | ||
362 | # new slaves arriving, that will be queued for the next RDB transfer, so the server | ||
363 | # waits a delay in order to let more slaves arrive. | ||
364 | # | ||
365 | # The delay is specified in seconds, and by default is 5 seconds. To disable | ||
366 | # it entirely just set it to 0 seconds and the transfer will start ASAP. | ||
367 | repl-diskless-sync-delay 5 | ||
368 | |||
192 | # Slaves send PINGs to server in a predefined interval. It's possible to change | 369 | # Slaves send PINGs to server in a predefined interval. It's possible to change |
193 | # this interval with the repl_ping_slave_period option. The default value is 10 | 370 | # this interval with the repl_ping_slave_period option. The default value is 10 |
194 | # seconds. | 371 | # seconds. |
195 | # | 372 | # |
196 | # repl-ping-slave-period 10 | 373 | # repl-ping-slave-period 10 |
197 | 374 | ||
198 | # The following option sets a timeout for both Bulk transfer I/O timeout and | 375 | # The following option sets the replication timeout for: |
199 | # master data or ping response timeout. The default value is 60 seconds. | 376 | # |
377 | # 1) Bulk transfer I/O during SYNC, from the point of view of slave. | ||
378 | # 2) Master timeout from the point of view of slaves (data, pings). | ||
379 | # 3) Slave timeout from the point of view of masters (REPLCONF ACK pings). | ||
200 | # | 380 | # |
201 | # It is important to make sure that this value is greater than the value | 381 | # It is important to make sure that this value is greater than the value |
202 | # specified for repl-ping-slave-period otherwise a timeout will be detected | 382 | # specified for repl-ping-slave-period otherwise a timeout will be detected |
@@ -204,13 +384,54 @@ slave-read-only yes | |||
204 | # | 384 | # |
205 | # repl-timeout 60 | 385 | # repl-timeout 60 |
206 | 386 | ||
387 | # Disable TCP_NODELAY on the slave socket after SYNC? | ||
388 | # | ||
389 | # If you select "yes" Redis will use a smaller number of TCP packets and | ||
390 | # less bandwidth to send data to slaves. But this can add a delay for | ||
391 | # the data to appear on the slave side, up to 40 milliseconds with | ||
392 | # Linux kernels using a default configuration. | ||
393 | # | ||
394 | # If you select "no" the delay for data to appear on the slave side will | ||
395 | # be reduced but more bandwidth will be used for replication. | ||
396 | # | ||
397 | # By default we optimize for low latency, but in very high traffic conditions | ||
398 | # or when the master and slaves are many hops away, turning this to "yes" may | ||
399 | # be a good idea. | ||
400 | repl-disable-tcp-nodelay no | ||
401 | |||
402 | # Set the replication backlog size. The backlog is a buffer that accumulates | ||
403 | # slave data when slaves are disconnected for some time, so that when a slave | ||
404 | # wants to reconnect again, often a full resync is not needed, but a partial | ||
405 | # resync is enough, just passing the portion of data the slave missed while | ||
406 | # disconnected. | ||
407 | # | ||
408 | # The bigger the replication backlog, the longer the time the slave can be | ||
409 | # disconnected and later be able to perform a partial resynchronization. | ||
410 | # | ||
411 | # The backlog is only allocated once there is at least a slave connected. | ||
412 | # | ||
413 | # repl-backlog-size 1mb | ||
414 | |||
415 | # After a master has no longer connected slaves for some time, the backlog | ||
416 | # will be freed. The following option configures the amount of seconds that | ||
417 | # need to elapse, starting from the time the last slave disconnected, for | ||
418 | # the backlog buffer to be freed. | ||
419 | # | ||
420 | # Note that slaves never free the backlog for timeout, since they may be | ||
421 | # promoted to masters later, and should be able to correctly "partially | ||
422 | # resynchronize" with the slaves: hence they should always accumulate backlog. | ||
423 | # | ||
424 | # A value of 0 means to never release the backlog. | ||
425 | # | ||
426 | # repl-backlog-ttl 3600 | ||
427 | |||
207 | # The slave priority is an integer number published by Redis in the INFO output. | 428 | # The slave priority is an integer number published by Redis in the INFO output. |
208 | # It is used by Redis Sentinel in order to select a slave to promote into a | 429 | # It is used by Redis Sentinel in order to select a slave to promote into a |
209 | # master if the master is no longer working correctly. | 430 | # master if the master is no longer working correctly. |
210 | # | 431 | # |
211 | # A slave with a low priority number is considered better for promotion, so | 432 | # A slave with a low priority number is considered better for promotion, so |
212 | # for instance if there are three slaves with priority 10, 100, 25 Sentinel will | 433 | # for instance if there are three slaves with priority 10, 100, 25 Sentinel will |
213 | # pick the one wtih priority 10, that is the lowest. | 434 | # pick the one with priority 10, that is the lowest. |
214 | # | 435 | # |
215 | # However a special priority of 0 marks the slave as not able to perform the | 436 | # However a special priority of 0 marks the slave as not able to perform the |
216 | # role of master, so a slave with priority of 0 will never be selected by | 437 | # role of master, so a slave with priority of 0 will never be selected by |
@@ -219,6 +440,57 @@ slave-read-only yes | |||
219 | # By default the priority is 100. | 440 | # By default the priority is 100. |
220 | slave-priority 100 | 441 | slave-priority 100 |
221 | 442 | ||
443 | # It is possible for a master to stop accepting writes if there are less than | ||
444 | # N slaves connected, having a lag less or equal than M seconds. | ||
445 | # | ||
446 | # The N slaves need to be in "online" state. | ||
447 | # | ||
448 | # The lag in seconds, that must be <= the specified value, is calculated from | ||
449 | # the last ping received from the slave, that is usually sent every second. | ||
450 | # | ||
451 | # This option does not GUARANTEE that N replicas will accept the write, but | ||
452 | # will limit the window of exposure for lost writes in case not enough slaves | ||
453 | # are available, to the specified number of seconds. | ||
454 | # | ||
455 | # For example to require at least 3 slaves with a lag <= 10 seconds use: | ||
456 | # | ||
457 | # min-slaves-to-write 3 | ||
458 | # min-slaves-max-lag 10 | ||
459 | # | ||
460 | # Setting one or the other to 0 disables the feature. | ||
461 | # | ||
462 | # By default min-slaves-to-write is set to 0 (feature disabled) and | ||
463 | # min-slaves-max-lag is set to 10. | ||
464 | |||
465 | # A Redis master is able to list the address and port of the attached | ||
466 | # slaves in different ways. For example the "INFO replication" section | ||
467 | # offers this information, which is used, among other tools, by | ||
468 | # Redis Sentinel in order to discover slave instances. | ||
469 | # Another place where this info is available is in the output of the | ||
470 | # "ROLE" command of a master. | ||
471 | # | ||
472 | # The listed IP and address normally reported by a slave is obtained | ||
473 | # in the following way: | ||
474 | # | ||
475 | # IP: The address is auto detected by checking the peer address | ||
476 | # of the socket used by the slave to connect with the master. | ||
477 | # | ||
478 | # Port: The port is communicated by the slave during the replication | ||
479 | # handshake, and is normally the port that the slave is using to | ||
480 | # list for connections. | ||
481 | # | ||
482 | # However when port forwarding or Network Address Translation (NAT) is | ||
483 | # used, the slave may be actually reachable via different IP and port | ||
484 | # pairs. The following two options can be used by a slave in order to | ||
485 | # report to its master a specific set of IP and port, so that both INFO | ||
486 | # and ROLE will report those values. | ||
487 | # | ||
488 | # There is no need to use both the options if you need to override just | ||
489 | # the port or the IP address. | ||
490 | # | ||
491 | # slave-announce-ip 5.5.5.5 | ||
492 | # slave-announce-port 1234 | ||
493 | |||
222 | ################################## SECURITY ################################### | 494 | ################################## SECURITY ################################### |
223 | 495 | ||
224 | # Require clients to issue AUTH <PASSWORD> before processing any other | 496 | # Require clients to issue AUTH <PASSWORD> before processing any other |
@@ -227,7 +499,7 @@ slave-priority 100 | |||
227 | # | 499 | # |
228 | # This should stay commented out for backward compatibility and because most | 500 | # This should stay commented out for backward compatibility and because most |
229 | # people do not need auth (e.g. they run their own servers). | 501 | # people do not need auth (e.g. they run their own servers). |
230 | # | 502 | # |
231 | # Warning: since Redis is pretty fast an outside user can try up to | 503 | # Warning: since Redis is pretty fast an outside user can try up to |
232 | # 150k passwords per second against a good box. This means that you should | 504 | # 150k passwords per second against a good box. This means that you should |
233 | # use a very strong password otherwise it will be very easy to break. | 505 | # use a very strong password otherwise it will be very easy to break. |
@@ -238,23 +510,26 @@ slave-priority 100 | |||
238 | # | 510 | # |
239 | # It is possible to change the name of dangerous commands in a shared | 511 | # It is possible to change the name of dangerous commands in a shared |
240 | # environment. For instance the CONFIG command may be renamed into something | 512 | # environment. For instance the CONFIG command may be renamed into something |
241 | # of hard to guess so that it will be still available for internal-use | 513 | # hard to guess so that it will still be available for internal-use tools |
242 | # tools but not available for general clients. | 514 | # but not available for general clients. |
243 | # | 515 | # |
244 | # Example: | 516 | # Example: |
245 | # | 517 | # |
246 | # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 | 518 | # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 |
247 | # | 519 | # |
248 | # It is also possible to completely kill a command renaming it into | 520 | # It is also possible to completely kill a command by renaming it into |
249 | # an empty string: | 521 | # an empty string: |
250 | # | 522 | # |
251 | # rename-command CONFIG "" | 523 | # rename-command CONFIG "" |
524 | # | ||
525 | # Please note that changing the name of commands that are logged into the | ||
526 | # AOF file or transmitted to slaves may cause problems. | ||
252 | 527 | ||
253 | ################################### LIMITS #################################### | 528 | ################################### CLIENTS #################################### |
254 | 529 | ||
255 | # Set the max number of connected clients at the same time. By default | 530 | # Set the max number of connected clients at the same time. By default |
256 | # this limit is set to 10000 clients, however if the Redis server is not | 531 | # this limit is set to 10000 clients, however if the Redis server is not |
257 | # able ot configure the process file limit to allow for the specified limit | 532 | # able to configure the process file limit to allow for the specified limit |
258 | # the max number of allowed clients is set to the current file limit | 533 | # the max number of allowed clients is set to the current file limit |
259 | # minus 32 (as Redis reserves a few file descriptors for internal uses). | 534 | # minus 32 (as Redis reserves a few file descriptors for internal uses). |
260 | # | 535 | # |
@@ -263,17 +538,19 @@ slave-priority 100 | |||
263 | # | 538 | # |
264 | # maxclients 10000 | 539 | # maxclients 10000 |
265 | 540 | ||
266 | # Don't use more memory than the specified amount of bytes. | 541 | ############################## MEMORY MANAGEMENT ################################ |
542 | |||
543 | # Set a memory usage limit to the specified amount of bytes. | ||
267 | # When the memory limit is reached Redis will try to remove keys | 544 | # When the memory limit is reached Redis will try to remove keys |
268 | # accordingly to the eviction policy selected (see maxmemmory-policy). | 545 | # according to the eviction policy selected (see maxmemory-policy). |
269 | # | 546 | # |
270 | # If Redis can't remove keys according to the policy, or if the policy is | 547 | # If Redis can't remove keys according to the policy, or if the policy is |
271 | # set to 'noeviction', Redis will start to reply with errors to commands | 548 | # set to 'noeviction', Redis will start to reply with errors to commands |
272 | # that would use more memory, like SET, LPUSH, and so on, and will continue | 549 | # that would use more memory, like SET, LPUSH, and so on, and will continue |
273 | # to reply to read-only commands like GET. | 550 | # to reply to read-only commands like GET. |
274 | # | 551 | # |
275 | # This option is usually useful when using Redis as an LRU cache, or to set | 552 | # This option is usually useful when using Redis as an LRU or LFU cache, or to |
276 | # an hard memory limit for an instance (using the 'noeviction' policy). | 553 | # set a hard memory limit for an instance (using the 'noeviction' policy). |
277 | # | 554 | # |
278 | # WARNING: If you have slaves attached to an instance with maxmemory on, | 555 | # WARNING: If you have slaves attached to an instance with maxmemory on, |
279 | # the size of the output buffers needed to feed the slaves are subtracted | 556 | # the size of the output buffers needed to feed the slaves are subtracted |
@@ -289,19 +566,27 @@ slave-priority 100 | |||
289 | # maxmemory <bytes> | 566 | # maxmemory <bytes> |
290 | 567 | ||
291 | # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory | 568 | # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory |
292 | # is reached? You can select among five behavior: | 569 | # is reached. You can select among five behaviors: |
293 | # | 570 | # |
294 | # volatile-lru -> remove the key with an expire set using an LRU algorithm | 571 | # volatile-lru -> Evict using approximated LRU among the keys with an expire set. |
295 | # allkeys-lru -> remove any key accordingly to the LRU algorithm | 572 | # allkeys-lru -> Evict any key using approximated LRU. |
296 | # volatile-random -> remove a random key with an expire set | 573 | # volatile-lfu -> Evict using approximated LFU among the keys with an expire set. |
297 | # allkeys-random -> remove a random key, any key | 574 | # allkeys-lfu -> Evict any key using approximated LFU. |
298 | # volatile-ttl -> remove the key with the nearest expire time (minor TTL) | 575 | # volatile-random -> Remove a random key among the ones with an expire set. |
299 | # noeviction -> don't expire at all, just return an error on write operations | 576 | # allkeys-random -> Remove a random key, any key. |
300 | # | 577 | # volatile-ttl -> Remove the key with the nearest expire time (minor TTL) |
301 | # Note: with all the kind of policies, Redis will return an error on write | 578 | # noeviction -> Don't evict anything, just return an error on write operations. |
302 | # operations, when there are not suitable keys for eviction. | 579 | # |
303 | # | 580 | # LRU means Least Recently Used |
304 | # At the date of writing this commands are: set setnx setex append | 581 | # LFU means Least Frequently Used |
582 | # | ||
583 | # Both LRU, LFU and volatile-ttl are implemented using approximated | ||
584 | # randomized algorithms. | ||
585 | # | ||
586 | # Note: with any of the above policies, Redis will return an error on write | ||
587 | # operations, when there are no suitable keys for eviction. | ||
588 | # | ||
589 | # At the date of writing these commands are: set setnx setex append | ||
305 | # incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd | 590 | # incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd |
306 | # sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby | 591 | # sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby |
307 | # zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby | 592 | # zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby |
@@ -309,15 +594,67 @@ slave-priority 100 | |||
309 | # | 594 | # |
310 | # The default is: | 595 | # The default is: |
311 | # | 596 | # |
312 | # maxmemory-policy volatile-lru | 597 | # maxmemory-policy noeviction |
313 | 598 | ||
314 | # LRU and minimal TTL algorithms are not precise algorithms but approximated | 599 | # LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated |
315 | # algorithms (in order to save memory), so you can select as well the sample | 600 | # algorithms (in order to save memory), so you can tune it for speed or |
316 | # size to check. For instance for default Redis will check three keys and | 601 | # accuracy. For default Redis will check five keys and pick the one that was |
317 | # pick the one that was used less recently, you can change the sample size | 602 | # used less recently, you can change the sample size using the following |
318 | # using the following configuration directive. | 603 | # configuration directive. |
604 | # | ||
605 | # The default of 5 produces good enough results. 10 Approximates very closely | ||
606 | # true LRU but costs more CPU. 3 is faster but not very accurate. | ||
319 | # | 607 | # |
320 | # maxmemory-samples 3 | 608 | # maxmemory-samples 5 |
609 | |||
610 | ############################# LAZY FREEING #################################### | ||
611 | |||
612 | # Redis has two primitives to delete keys. One is called DEL and is a blocking | ||
613 | # deletion of the object. It means that the server stops processing new commands | ||
614 | # in order to reclaim all the memory associated with an object in a synchronous | ||
615 | # way. If the key deleted is associated with a small object, the time needed | ||
616 | # in order to execute the DEL command is very small and comparable to most other | ||
617 | # O(1) or O(log_N) commands in Redis. However if the key is associated with an | ||
618 | # aggregated value containing millions of elements, the server can block for | ||
619 | # a long time (even seconds) in order to complete the operation. | ||
620 | # | ||
621 | # For the above reasons Redis also offers non blocking deletion primitives | ||
622 | # such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and | ||
623 | # FLUSHDB commands, in order to reclaim memory in background. Those commands | ||
624 | # are executed in constant time. Another thread will incrementally free the | ||
625 | # object in the background as fast as possible. | ||
626 | # | ||
627 | # DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled. | ||
628 | # It's up to the design of the application to understand when it is a good | ||
629 | # idea to use one or the other. However the Redis server sometimes has to | ||
630 | # delete keys or flush the whole database as a side effect of other operations. | ||
631 | # Specifically Redis deletes objects independently of a user call in the | ||
632 | # following scenarios: | ||
633 | # | ||
634 | # 1) On eviction, because of the maxmemory and maxmemory policy configurations, | ||
635 | # in order to make room for new data, without going over the specified | ||
636 | # memory limit. | ||
637 | # 2) Because of expire: when a key with an associated time to live (see the | ||
638 | # EXPIRE command) must be deleted from memory. | ||
639 | # 3) Because of a side effect of a command that stores data on a key that may | ||
640 | # already exist. For example the RENAME command may delete the old key | ||
641 | # content when it is replaced with another one. Similarly SUNIONSTORE | ||
642 | # or SORT with STORE option may delete existing keys. The SET command | ||
643 | # itself removes any old content of the specified key in order to replace | ||
644 | # it with the specified string. | ||
645 | # 4) During replication, when a slave performs a full resynchronization with | ||
646 | # its master, the content of the whole database is removed in order to | ||
647 | # load the RDB file just transfered. | ||
648 | # | ||
649 | # In all the above cases the default is to delete objects in a blocking way, | ||
650 | # like if DEL was called. However you can configure each case specifically | ||
651 | # in order to instead release memory in a non-blocking way like if UNLINK | ||
652 | # was called, using the following configuration directives: | ||
653 | |||
654 | lazyfree-lazy-eviction no | ||
655 | lazyfree-lazy-expire no | ||
656 | lazyfree-lazy-server-del no | ||
657 | slave-lazy-flush no | ||
321 | 658 | ||
322 | ############################## APPEND ONLY MODE ############################### | 659 | ############################## APPEND ONLY MODE ############################### |
323 | 660 | ||
@@ -339,24 +676,24 @@ slave-priority 100 | |||
339 | # | 676 | # |
340 | # Please check http://redis.io/topics/persistence for more information. | 677 | # Please check http://redis.io/topics/persistence for more information. |
341 | 678 | ||
342 | # | ||
343 | # OE: changed default to enable this | 679 | # OE: changed default to enable this |
344 | appendonly yes | 680 | appendonly yes |
345 | 681 | ||
346 | # The name of the append only file (default: "appendonly.aof") | 682 | # The name of the append only file (default: "appendonly.aof") |
347 | # appendfilename appendonly.aof | 683 | |
684 | appendfilename "appendonly.aof" | ||
348 | 685 | ||
349 | # The fsync() call tells the Operating System to actually write data on disk | 686 | # The fsync() call tells the Operating System to actually write data on disk |
350 | # instead to wait for more data in the output buffer. Some OS will really flush | 687 | # instead of waiting for more data in the output buffer. Some OS will really flush |
351 | # data on disk, some other OS will just try to do it ASAP. | 688 | # data on disk, some other OS will just try to do it ASAP. |
352 | # | 689 | # |
353 | # Redis supports three different modes: | 690 | # Redis supports three different modes: |
354 | # | 691 | # |
355 | # no: don't fsync, just let the OS flush the data when it wants. Faster. | 692 | # no: don't fsync, just let the OS flush the data when it wants. Faster. |
356 | # always: fsync after every write to the append only log . Slow, Safest. | 693 | # always: fsync after every write to the append only log. Slow, Safest. |
357 | # everysec: fsync only one time every second. Compromise. | 694 | # everysec: fsync only one time every second. Compromise. |
358 | # | 695 | # |
359 | # The default is "everysec" that's usually the right compromise between | 696 | # The default is "everysec", as that's usually the right compromise between |
360 | # speed and data safety. It's up to you to understand if you can relax this to | 697 | # speed and data safety. It's up to you to understand if you can relax this to |
361 | # "no" that will let the operating system flush the output buffer when | 698 | # "no" that will let the operating system flush the output buffer when |
362 | # it wants, for better performances (but if you can live with the idea of | 699 | # it wants, for better performances (but if you can live with the idea of |
@@ -384,21 +721,22 @@ appendfsync everysec | |||
384 | # that will prevent fsync() from being called in the main process while a | 721 | # that will prevent fsync() from being called in the main process while a |
385 | # BGSAVE or BGREWRITEAOF is in progress. | 722 | # BGSAVE or BGREWRITEAOF is in progress. |
386 | # | 723 | # |
387 | # This means that while another child is saving the durability of Redis is | 724 | # This means that while another child is saving, the durability of Redis is |
388 | # the same as "appendfsync none", that in practical terms means that it is | 725 | # the same as "appendfsync none". In practical terms, this means that it is |
389 | # possible to lost up to 30 seconds of log in the worst scenario (with the | 726 | # possible to lose up to 30 seconds of log in the worst scenario (with the |
390 | # default Linux settings). | 727 | # default Linux settings). |
391 | # | 728 | # |
392 | # If you have latency problems turn this to "yes". Otherwise leave it as | 729 | # If you have latency problems turn this to "yes". Otherwise leave it as |
393 | # "no" that is the safest pick from the point of view of durability. | 730 | # "no" that is the safest pick from the point of view of durability. |
731 | |||
394 | no-appendfsync-on-rewrite no | 732 | no-appendfsync-on-rewrite no |
395 | 733 | ||
396 | # Automatic rewrite of the append only file. | 734 | # Automatic rewrite of the append only file. |
397 | # Redis is able to automatically rewrite the log file implicitly calling | 735 | # Redis is able to automatically rewrite the log file implicitly calling |
398 | # BGREWRITEAOF when the AOF log size will growth by the specified percentage. | 736 | # BGREWRITEAOF when the AOF log size grows by the specified percentage. |
399 | # | 737 | # |
400 | # This is how it works: Redis remembers the size of the AOF file after the | 738 | # This is how it works: Redis remembers the size of the AOF file after the |
401 | # latest rewrite (or if no rewrite happened since the restart, the size of | 739 | # latest rewrite (if no rewrite has happened since the restart, the size of |
402 | # the AOF at startup is used). | 740 | # the AOF at startup is used). |
403 | # | 741 | # |
404 | # This base size is compared to the current size. If the current size is | 742 | # This base size is compared to the current size. If the current size is |
@@ -413,6 +751,44 @@ no-appendfsync-on-rewrite no | |||
413 | auto-aof-rewrite-percentage 100 | 751 | auto-aof-rewrite-percentage 100 |
414 | auto-aof-rewrite-min-size 64mb | 752 | auto-aof-rewrite-min-size 64mb |
415 | 753 | ||
754 | # An AOF file may be found to be truncated at the end during the Redis | ||
755 | # startup process, when the AOF data gets loaded back into memory. | ||
756 | # This may happen when the system where Redis is running | ||
757 | # crashes, especially when an ext4 filesystem is mounted without the | ||
758 | # data=ordered option (however this can't happen when Redis itself | ||
759 | # crashes or aborts but the operating system still works correctly). | ||
760 | # | ||
761 | # Redis can either exit with an error when this happens, or load as much | ||
762 | # data as possible (the default now) and start if the AOF file is found | ||
763 | # to be truncated at the end. The following option controls this behavior. | ||
764 | # | ||
765 | # If aof-load-truncated is set to yes, a truncated AOF file is loaded and | ||
766 | # the Redis server starts emitting a log to inform the user of the event. | ||
767 | # Otherwise if the option is set to no, the server aborts with an error | ||
768 | # and refuses to start. When the option is set to no, the user requires | ||
769 | # to fix the AOF file using the "redis-check-aof" utility before to restart | ||
770 | # the server. | ||
771 | # | ||
772 | # Note that if the AOF file will be found to be corrupted in the middle | ||
773 | # the server will still exit with an error. This option only applies when | ||
774 | # Redis will try to read more data from the AOF file but not enough bytes | ||
775 | # will be found. | ||
776 | aof-load-truncated yes | ||
777 | |||
778 | # When rewriting the AOF file, Redis is able to use an RDB preamble in the | ||
779 | # AOF file for faster rewrites and recoveries. When this option is turned | ||
780 | # on the rewritten AOF file is composed of two different stanzas: | ||
781 | # | ||
782 | # [RDB file][AOF tail] | ||
783 | # | ||
784 | # When loading Redis recognizes that the AOF file starts with the "REDIS" | ||
785 | # string and loads the prefixed RDB file, and continues loading the AOF | ||
786 | # tail. | ||
787 | # | ||
788 | # This is currently turned off by default in order to avoid the surprise | ||
789 | # of a format change, but will at some point be used as the default. | ||
790 | aof-use-rdb-preamble no | ||
791 | |||
416 | ################################ LUA SCRIPTING ############################### | 792 | ################################ LUA SCRIPTING ############################### |
417 | 793 | ||
418 | # Max execution time of a Lua script in milliseconds. | 794 | # Max execution time of a Lua script in milliseconds. |
@@ -421,16 +797,157 @@ auto-aof-rewrite-min-size 64mb | |||
421 | # still in execution after the maximum allowed time and will start to | 797 | # still in execution after the maximum allowed time and will start to |
422 | # reply to queries with an error. | 798 | # reply to queries with an error. |
423 | # | 799 | # |
424 | # When a long running script exceed the maximum execution time only the | 800 | # When a long running script exceeds the maximum execution time only the |
425 | # SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be | 801 | # SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be |
426 | # used to stop a script that did not yet called write commands. The second | 802 | # used to stop a script that did not yet called write commands. The second |
427 | # is the only way to shut down the server in the case a write commands was | 803 | # is the only way to shut down the server in the case a write command was |
428 | # already issue by the script but the user don't want to wait for the natural | 804 | # already issued by the script but the user doesn't want to wait for the natural |
429 | # termination of the script. | 805 | # termination of the script. |
430 | # | 806 | # |
431 | # Set it to 0 or a negative value for unlimited execution without warnings. | 807 | # Set it to 0 or a negative value for unlimited execution without warnings. |
432 | lua-time-limit 5000 | 808 | lua-time-limit 5000 |
433 | 809 | ||
810 | ################################ REDIS CLUSTER ############################### | ||
811 | # | ||
812 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
813 | # WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however | ||
814 | # in order to mark it as "mature" we need to wait for a non trivial percentage | ||
815 | # of users to deploy it in production. | ||
816 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
817 | # | ||
818 | # Normal Redis instances can't be part of a Redis Cluster; only nodes that are | ||
819 | # started as cluster nodes can. In order to start a Redis instance as a | ||
820 | # cluster node enable the cluster support uncommenting the following: | ||
821 | # | ||
822 | # cluster-enabled yes | ||
823 | |||
824 | # Every cluster node has a cluster configuration file. This file is not | ||
825 | # intended to be edited by hand. It is created and updated by Redis nodes. | ||
826 | # Every Redis Cluster node requires a different cluster configuration file. | ||
827 | # Make sure that instances running in the same system do not have | ||
828 | # overlapping cluster configuration file names. | ||
829 | # | ||
830 | # cluster-config-file nodes-6379.conf | ||
831 | |||
832 | # Cluster node timeout is the amount of milliseconds a node must be unreachable | ||
833 | # for it to be considered in failure state. | ||
834 | # Most other internal time limits are multiple of the node timeout. | ||
835 | # | ||
836 | # cluster-node-timeout 15000 | ||
837 | |||
838 | # A slave of a failing master will avoid to start a failover if its data | ||
839 | # looks too old. | ||
840 | # | ||
841 | # There is no simple way for a slave to actually have an exact measure of | ||
842 | # its "data age", so the following two checks are performed: | ||
843 | # | ||
844 | # 1) If there are multiple slaves able to failover, they exchange messages | ||
845 | # in order to try to give an advantage to the slave with the best | ||
846 | # replication offset (more data from the master processed). | ||
847 | # Slaves will try to get their rank by offset, and apply to the start | ||
848 | # of the failover a delay proportional to their rank. | ||
849 | # | ||
850 | # 2) Every single slave computes the time of the last interaction with | ||
851 | # its master. This can be the last ping or command received (if the master | ||
852 | # is still in the "connected" state), or the time that elapsed since the | ||
853 | # disconnection with the master (if the replication link is currently down). | ||
854 | # If the last interaction is too old, the slave will not try to failover | ||
855 | # at all. | ||
856 | # | ||
857 | # The point "2" can be tuned by user. Specifically a slave will not perform | ||
858 | # the failover if, since the last interaction with the master, the time | ||
859 | # elapsed is greater than: | ||
860 | # | ||
861 | # (node-timeout * slave-validity-factor) + repl-ping-slave-period | ||
862 | # | ||
863 | # So for example if node-timeout is 30 seconds, and the slave-validity-factor | ||
864 | # is 10, and assuming a default repl-ping-slave-period of 10 seconds, the | ||
865 | # slave will not try to failover if it was not able to talk with the master | ||
866 | # for longer than 310 seconds. | ||
867 | # | ||
868 | # A large slave-validity-factor may allow slaves with too old data to failover | ||
869 | # a master, while a too small value may prevent the cluster from being able to | ||
870 | # elect a slave at all. | ||
871 | # | ||
872 | # For maximum availability, it is possible to set the slave-validity-factor | ||
873 | # to a value of 0, which means, that slaves will always try to failover the | ||
874 | # master regardless of the last time they interacted with the master. | ||
875 | # (However they'll always try to apply a delay proportional to their | ||
876 | # offset rank). | ||
877 | # | ||
878 | # Zero is the only value able to guarantee that when all the partitions heal | ||
879 | # the cluster will always be able to continue. | ||
880 | # | ||
881 | # cluster-slave-validity-factor 10 | ||
882 | |||
883 | # Cluster slaves are able to migrate to orphaned masters, that are masters | ||
884 | # that are left without working slaves. This improves the cluster ability | ||
885 | # to resist to failures as otherwise an orphaned master can't be failed over | ||
886 | # in case of failure if it has no working slaves. | ||
887 | # | ||
888 | # Slaves migrate to orphaned masters only if there are still at least a | ||
889 | # given number of other working slaves for their old master. This number | ||
890 | # is the "migration barrier". A migration barrier of 1 means that a slave | ||
891 | # will migrate only if there is at least 1 other working slave for its master | ||
892 | # and so forth. It usually reflects the number of slaves you want for every | ||
893 | # master in your cluster. | ||
894 | # | ||
895 | # Default is 1 (slaves migrate only if their masters remain with at least | ||
896 | # one slave). To disable migration just set it to a very large value. | ||
897 | # A value of 0 can be set but is useful only for debugging and dangerous | ||
898 | # in production. | ||
899 | # | ||
900 | # cluster-migration-barrier 1 | ||
901 | |||
902 | # By default Redis Cluster nodes stop accepting queries if they detect there | ||
903 | # is at least an hash slot uncovered (no available node is serving it). | ||
904 | # This way if the cluster is partially down (for example a range of hash slots | ||
905 | # are no longer covered) all the cluster becomes, eventually, unavailable. | ||
906 | # It automatically returns available as soon as all the slots are covered again. | ||
907 | # | ||
908 | # However sometimes you want the subset of the cluster which is working, | ||
909 | # to continue to accept queries for the part of the key space that is still | ||
910 | # covered. In order to do so, just set the cluster-require-full-coverage | ||
911 | # option to no. | ||
912 | # | ||
913 | # cluster-require-full-coverage yes | ||
914 | |||
915 | # In order to setup your cluster make sure to read the documentation | ||
916 | # available at http://redis.io web site. | ||
917 | |||
918 | ########################## CLUSTER DOCKER/NAT support ######################## | ||
919 | |||
920 | # In certain deployments, Redis Cluster nodes address discovery fails, because | ||
921 | # addresses are NAT-ted or because ports are forwarded (the typical case is | ||
922 | # Docker and other containers). | ||
923 | # | ||
924 | # In order to make Redis Cluster working in such environments, a static | ||
925 | # configuration where each node knows its public address is needed. The | ||
926 | # following two options are used for this scope, and are: | ||
927 | # | ||
928 | # * cluster-announce-ip | ||
929 | # * cluster-announce-port | ||
930 | # * cluster-announce-bus-port | ||
931 | # | ||
932 | # Each instruct the node about its address, client port, and cluster message | ||
933 | # bus port. The information is then published in the header of the bus packets | ||
934 | # so that other nodes will be able to correctly map the address of the node | ||
935 | # publishing the information. | ||
936 | # | ||
937 | # If the above options are not used, the normal Redis Cluster auto-detection | ||
938 | # will be used instead. | ||
939 | # | ||
940 | # Note that when remapped, the bus port may not be at the fixed offset of | ||
941 | # clients port + 10000, so you can specify any port and bus-port depending | ||
942 | # on how they get remapped. If the bus-port is not set, a fixed offset of | ||
943 | # 10000 will be used as usually. | ||
944 | # | ||
945 | # Example: | ||
946 | # | ||
947 | # cluster-announce-ip 10.1.1.5 | ||
948 | # cluster-announce-port 6379 | ||
949 | # cluster-announce-bus-port 6380 | ||
950 | |||
434 | ################################## SLOW LOG ################################### | 951 | ################################## SLOW LOG ################################### |
435 | 952 | ||
436 | # The Redis Slow Log is a system to log queries that exceeded a specified | 953 | # The Redis Slow Log is a system to log queries that exceeded a specified |
@@ -439,7 +956,7 @@ lua-time-limit 5000 | |||
439 | # but just the time needed to actually execute the command (this is the only | 956 | # but just the time needed to actually execute the command (this is the only |
440 | # stage of command execution where the thread is blocked and can not serve | 957 | # stage of command execution where the thread is blocked and can not serve |
441 | # other requests in the meantime). | 958 | # other requests in the meantime). |
442 | # | 959 | # |
443 | # You can configure the slow log with two parameters: one tells Redis | 960 | # You can configure the slow log with two parameters: one tells Redis |
444 | # what is the execution time, in microseconds, to exceed in order for the | 961 | # what is the execution time, in microseconds, to exceed in order for the |
445 | # command to get logged, and the other parameter is the length of the | 962 | # command to get logged, and the other parameter is the length of the |
@@ -455,6 +972,73 @@ slowlog-log-slower-than 10000 | |||
455 | # You can reclaim memory used by the slow log with SLOWLOG RESET. | 972 | # You can reclaim memory used by the slow log with SLOWLOG RESET. |
456 | slowlog-max-len 128 | 973 | slowlog-max-len 128 |
457 | 974 | ||
975 | ################################ LATENCY MONITOR ############################## | ||
976 | |||
977 | # The Redis latency monitoring subsystem samples different operations | ||
978 | # at runtime in order to collect data related to possible sources of | ||
979 | # latency of a Redis instance. | ||
980 | # | ||
981 | # Via the LATENCY command this information is available to the user that can | ||
982 | # print graphs and obtain reports. | ||
983 | # | ||
984 | # The system only logs operations that were performed in a time equal or | ||
985 | # greater than the amount of milliseconds specified via the | ||
986 | # latency-monitor-threshold configuration directive. When its value is set | ||
987 | # to zero, the latency monitor is turned off. | ||
988 | # | ||
989 | # By default latency monitoring is disabled since it is mostly not needed | ||
990 | # if you don't have latency issues, and collecting data has a performance | ||
991 | # impact, that while very small, can be measured under big load. Latency | ||
992 | # monitoring can easily be enabled at runtime using the command | ||
993 | # "CONFIG SET latency-monitor-threshold <milliseconds>" if needed. | ||
994 | latency-monitor-threshold 0 | ||
995 | |||
996 | ############################# EVENT NOTIFICATION ############################## | ||
997 | |||
998 | # Redis can notify Pub/Sub clients about events happening in the key space. | ||
999 | # This feature is documented at http://redis.io/topics/notifications | ||
1000 | # | ||
1001 | # For instance if keyspace events notification is enabled, and a client | ||
1002 | # performs a DEL operation on key "foo" stored in the Database 0, two | ||
1003 | # messages will be published via Pub/Sub: | ||
1004 | # | ||
1005 | # PUBLISH __keyspace@0__:foo del | ||
1006 | # PUBLISH __keyevent@0__:del foo | ||
1007 | # | ||
1008 | # It is possible to select the events that Redis will notify among a set | ||
1009 | # of classes. Every class is identified by a single character: | ||
1010 | # | ||
1011 | # K Keyspace events, published with __keyspace@<db>__ prefix. | ||
1012 | # E Keyevent events, published with __keyevent@<db>__ prefix. | ||
1013 | # g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... | ||
1014 | # $ String commands | ||
1015 | # l List commands | ||
1016 | # s Set commands | ||
1017 | # h Hash commands | ||
1018 | # z Sorted set commands | ||
1019 | # x Expired events (events generated every time a key expires) | ||
1020 | # e Evicted events (events generated when a key is evicted for maxmemory) | ||
1021 | # A Alias for g$lshzxe, so that the "AKE" string means all the events. | ||
1022 | # | ||
1023 | # The "notify-keyspace-events" takes as argument a string that is composed | ||
1024 | # of zero or multiple characters. The empty string means that notifications | ||
1025 | # are disabled. | ||
1026 | # | ||
1027 | # Example: to enable list and generic events, from the point of view of the | ||
1028 | # event name, use: | ||
1029 | # | ||
1030 | # notify-keyspace-events Elg | ||
1031 | # | ||
1032 | # Example 2: to get the stream of the expired keys subscribing to channel | ||
1033 | # name __keyevent@0__:expired use: | ||
1034 | # | ||
1035 | # notify-keyspace-events Ex | ||
1036 | # | ||
1037 | # By default all notifications are disabled because most users don't need | ||
1038 | # this feature and the feature has some overhead. Note that if you don't | ||
1039 | # specify at least one of K or E, no events will be delivered. | ||
1040 | notify-keyspace-events "" | ||
1041 | |||
458 | ############################### ADVANCED CONFIG ############################### | 1042 | ############################### ADVANCED CONFIG ############################### |
459 | 1043 | ||
460 | # Hashes are encoded using a memory efficient data structure when they have a | 1044 | # Hashes are encoded using a memory efficient data structure when they have a |
@@ -463,14 +1047,39 @@ slowlog-max-len 128 | |||
463 | hash-max-ziplist-entries 512 | 1047 | hash-max-ziplist-entries 512 |
464 | hash-max-ziplist-value 64 | 1048 | hash-max-ziplist-value 64 |
465 | 1049 | ||
466 | # Similarly to hashes, small lists are also encoded in a special way in order | 1050 | # Lists are also encoded in a special way to save a lot of space. |
467 | # to save a lot of space. The special representation is only used when | 1051 | # The number of entries allowed per internal list node can be specified |
468 | # you are under the following limits: | 1052 | # as a fixed maximum size or a maximum number of elements. |
469 | list-max-ziplist-entries 512 | 1053 | # For a fixed maximum size, use -5 through -1, meaning: |
470 | list-max-ziplist-value 64 | 1054 | # -5: max size: 64 Kb <-- not recommended for normal workloads |
1055 | # -4: max size: 32 Kb <-- not recommended | ||
1056 | # -3: max size: 16 Kb <-- probably not recommended | ||
1057 | # -2: max size: 8 Kb <-- good | ||
1058 | # -1: max size: 4 Kb <-- good | ||
1059 | # Positive numbers mean store up to _exactly_ that number of elements | ||
1060 | # per list node. | ||
1061 | # The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size), | ||
1062 | # but if your use case is unique, adjust the settings as necessary. | ||
1063 | list-max-ziplist-size -2 | ||
1064 | |||
1065 | # Lists may also be compressed. | ||
1066 | # Compress depth is the number of quicklist ziplist nodes from *each* side of | ||
1067 | # the list to *exclude* from compression. The head and tail of the list | ||
1068 | # are always uncompressed for fast push/pop operations. Settings are: | ||
1069 | # 0: disable all list compression | ||
1070 | # 1: depth 1 means "don't start compressing until after 1 node into the list, | ||
1071 | # going from either the head or tail" | ||
1072 | # So: [head]->node->node->...->node->[tail] | ||
1073 | # [head], [tail] will always be uncompressed; inner nodes will compress. | ||
1074 | # 2: [head]->[next]->node->node->...->node->[prev]->[tail] | ||
1075 | # 2 here means: don't compress head or head->next or tail->prev or tail, | ||
1076 | # but compress all nodes between them. | ||
1077 | # 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail] | ||
1078 | # etc. | ||
1079 | list-compress-depth 0 | ||
471 | 1080 | ||
472 | # Sets have a special encoding in just one case: when a set is composed | 1081 | # Sets have a special encoding in just one case: when a set is composed |
473 | # of just strings that happens to be integers in radix 10 in the range | 1082 | # of just strings that happen to be integers in radix 10 in the range |
474 | # of 64 bit signed integers. | 1083 | # of 64 bit signed integers. |
475 | # The following configuration setting sets the limit in the size of the | 1084 | # The following configuration setting sets the limit in the size of the |
476 | # set in order to use this special memory saving encoding. | 1085 | # set in order to use this special memory saving encoding. |
@@ -482,20 +1091,34 @@ set-max-intset-entries 512 | |||
482 | zset-max-ziplist-entries 128 | 1091 | zset-max-ziplist-entries 128 |
483 | zset-max-ziplist-value 64 | 1092 | zset-max-ziplist-value 64 |
484 | 1093 | ||
1094 | # HyperLogLog sparse representation bytes limit. The limit includes the | ||
1095 | # 16 bytes header. When an HyperLogLog using the sparse representation crosses | ||
1096 | # this limit, it is converted into the dense representation. | ||
1097 | # | ||
1098 | # A value greater than 16000 is totally useless, since at that point the | ||
1099 | # dense representation is more memory efficient. | ||
1100 | # | ||
1101 | # The suggested value is ~ 3000 in order to have the benefits of | ||
1102 | # the space efficient encoding without slowing down too much PFADD, | ||
1103 | # which is O(N) with the sparse encoding. The value can be raised to | ||
1104 | # ~ 10000 when CPU is not a concern, but space is, and the data set is | ||
1105 | # composed of many HyperLogLogs with cardinality in the 0 - 15000 range. | ||
1106 | hll-sparse-max-bytes 3000 | ||
1107 | |||
485 | # Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in | 1108 | # Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in |
486 | # order to help rehashing the main Redis hash table (the one mapping top-level | 1109 | # order to help rehashing the main Redis hash table (the one mapping top-level |
487 | # keys to values). The hash table implementation Redis uses (see dict.c) | 1110 | # keys to values). The hash table implementation Redis uses (see dict.c) |
488 | # performs a lazy rehashing: the more operation you run into an hash table | 1111 | # performs a lazy rehashing: the more operation you run into a hash table |
489 | # that is rehashing, the more rehashing "steps" are performed, so if the | 1112 | # that is rehashing, the more rehashing "steps" are performed, so if the |
490 | # server is idle the rehashing is never complete and some more memory is used | 1113 | # server is idle the rehashing is never complete and some more memory is used |
491 | # by the hash table. | 1114 | # by the hash table. |
492 | # | 1115 | # |
493 | # The default is to use this millisecond 10 times every second in order to | 1116 | # The default is to use this millisecond 10 times every second in order to |
494 | # active rehashing the main dictionaries, freeing memory when possible. | 1117 | # actively rehash the main dictionaries, freeing memory when possible. |
495 | # | 1118 | # |
496 | # If unsure: | 1119 | # If unsure: |
497 | # use "activerehashing no" if you have hard latency requirements and it is | 1120 | # use "activerehashing no" if you have hard latency requirements and it is |
498 | # not a good thing in your environment that Redis can reply form time to time | 1121 | # not a good thing in your environment that Redis can reply from time to time |
499 | # to queries with 2 milliseconds delay. | 1122 | # to queries with 2 milliseconds delay. |
500 | # | 1123 | # |
501 | # use "activerehashing yes" if you don't have such hard requirements but | 1124 | # use "activerehashing yes" if you don't have such hard requirements but |
@@ -509,9 +1132,9 @@ activerehashing yes | |||
509 | # | 1132 | # |
510 | # The limit can be set differently for the three different classes of clients: | 1133 | # The limit can be set differently for the three different classes of clients: |
511 | # | 1134 | # |
512 | # normal -> normal clients | 1135 | # normal -> normal clients including MONITOR clients |
513 | # slave -> slave clients and MONITOR clients | 1136 | # slave -> slave clients |
514 | # pubsub -> clients subcribed to at least one pubsub channel or pattern | 1137 | # pubsub -> clients subscribed to at least one pubsub channel or pattern |
515 | # | 1138 | # |
516 | # The syntax of every client-output-buffer-limit directive is the following: | 1139 | # The syntax of every client-output-buffer-limit directive is the following: |
517 | # | 1140 | # |
@@ -534,17 +1157,158 @@ activerehashing yes | |||
534 | # Instead there is a default limit for pubsub and slave clients, since | 1157 | # Instead there is a default limit for pubsub and slave clients, since |
535 | # subscribers and slaves receive data in a push fashion. | 1158 | # subscribers and slaves receive data in a push fashion. |
536 | # | 1159 | # |
537 | # Both the hard or the soft limit can be disabled just setting it to zero. | 1160 | # Both the hard or the soft limit can be disabled by setting them to zero. |
538 | client-output-buffer-limit normal 0 0 0 | 1161 | client-output-buffer-limit normal 0 0 0 |
539 | client-output-buffer-limit slave 256mb 64mb 60 | 1162 | client-output-buffer-limit slave 256mb 64mb 60 |
540 | client-output-buffer-limit pubsub 32mb 8mb 60 | 1163 | client-output-buffer-limit pubsub 32mb 8mb 60 |
541 | 1164 | ||
542 | ################################## INCLUDES ################################### | 1165 | # Client query buffers accumulate new commands. They are limited to a fixed |
1166 | # amount by default in order to avoid that a protocol desynchronization (for | ||
1167 | # instance due to a bug in the client) will lead to unbound memory usage in | ||
1168 | # the query buffer. However you can configure it here if you have very special | ||
1169 | # needs, such us huge multi/exec requests or alike. | ||
1170 | # | ||
1171 | # client-query-buffer-limit 1gb | ||
543 | 1172 | ||
544 | # Include one or more other config files here. This is useful if you | 1173 | # In the Redis protocol, bulk requests, that are, elements representing single |
545 | # have a standard template that goes to all Redis server but also need | 1174 | # strings, are normally limited ot 512 mb. However you can change this limit |
546 | # to customize a few per-server settings. Include files can include | 1175 | # here. |
547 | # other files, so use this wisely. | ||
548 | # | 1176 | # |
549 | # include /path/to/local.conf | 1177 | # proto-max-bulk-len 512mb |
550 | # include /path/to/other.conf | 1178 | |
1179 | # Redis calls an internal function to perform many background tasks, like | ||
1180 | # closing connections of clients in timeout, purging expired keys that are | ||
1181 | # never requested, and so forth. | ||
1182 | # | ||
1183 | # Not all tasks are performed with the same frequency, but Redis checks for | ||
1184 | # tasks to perform according to the specified "hz" value. | ||
1185 | # | ||
1186 | # By default "hz" is set to 10. Raising the value will use more CPU when | ||
1187 | # Redis is idle, but at the same time will make Redis more responsive when | ||
1188 | # there are many keys expiring at the same time, and timeouts may be | ||
1189 | # handled with more precision. | ||
1190 | # | ||
1191 | # The range is between 1 and 500, however a value over 100 is usually not | ||
1192 | # a good idea. Most users should use the default of 10 and raise this up to | ||
1193 | # 100 only in environments where very low latency is required. | ||
1194 | hz 10 | ||
1195 | |||
1196 | # When a child rewrites the AOF file, if the following option is enabled | ||
1197 | # the file will be fsync-ed every 32 MB of data generated. This is useful | ||
1198 | # in order to commit the file to the disk more incrementally and avoid | ||
1199 | # big latency spikes. | ||
1200 | aof-rewrite-incremental-fsync yes | ||
1201 | |||
1202 | # Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good | ||
1203 | # idea to start with the default settings and only change them after investigating | ||
1204 | # how to improve the performances and how the keys LFU change over time, which | ||
1205 | # is possible to inspect via the OBJECT FREQ command. | ||
1206 | # | ||
1207 | # There are two tunable parameters in the Redis LFU implementation: the | ||
1208 | # counter logarithm factor and the counter decay time. It is important to | ||
1209 | # understand what the two parameters mean before changing them. | ||
1210 | # | ||
1211 | # The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis | ||
1212 | # uses a probabilistic increment with logarithmic behavior. Given the value | ||
1213 | # of the old counter, when a key is accessed, the counter is incremented in | ||
1214 | # this way: | ||
1215 | # | ||
1216 | # 1. A random number R between 0 and 1 is extracted. | ||
1217 | # 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1). | ||
1218 | # 3. The counter is incremented only if R < P. | ||
1219 | # | ||
1220 | # The default lfu-log-factor is 10. This is a table of how the frequency | ||
1221 | # counter changes with a different number of accesses with different | ||
1222 | # logarithmic factors: | ||
1223 | # | ||
1224 | # +--------+------------+------------+------------+------------+------------+ | ||
1225 | # | factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits | | ||
1226 | # +--------+------------+------------+------------+------------+------------+ | ||
1227 | # | 0 | 104 | 255 | 255 | 255 | 255 | | ||
1228 | # +--------+------------+------------+------------+------------+------------+ | ||
1229 | # | 1 | 18 | 49 | 255 | 255 | 255 | | ||
1230 | # +--------+------------+------------+------------+------------+------------+ | ||
1231 | # | 10 | 10 | 18 | 142 | 255 | 255 | | ||
1232 | # +--------+------------+------------+------------+------------+------------+ | ||
1233 | # | 100 | 8 | 11 | 49 | 143 | 255 | | ||
1234 | # +--------+------------+------------+------------+------------+------------+ | ||
1235 | # | ||
1236 | # NOTE: The above table was obtained by running the following commands: | ||
1237 | # | ||
1238 | # redis-benchmark -n 1000000 incr foo | ||
1239 | # redis-cli object freq foo | ||
1240 | # | ||
1241 | # NOTE 2: The counter initial value is 5 in order to give new objects a chance | ||
1242 | # to accumulate hits. | ||
1243 | # | ||
1244 | # The counter decay time is the time, in minutes, that must elapse in order | ||
1245 | # for the key counter to be divided by two (or decremented if it has a value | ||
1246 | # less <= 10). | ||
1247 | # | ||
1248 | # The default value for the lfu-decay-time is 1. A Special value of 0 means to | ||
1249 | # decay the counter every time it happens to be scanned. | ||
1250 | # | ||
1251 | # lfu-log-factor 10 | ||
1252 | # lfu-decay-time 1 | ||
1253 | |||
1254 | ########################### ACTIVE DEFRAGMENTATION ####################### | ||
1255 | # | ||
1256 | # WARNING THIS FEATURE IS EXPERIMENTAL. However it was stress tested | ||
1257 | # even in production and manually tested by multiple engineers for some | ||
1258 | # time. | ||
1259 | # | ||
1260 | # What is active defragmentation? | ||
1261 | # ------------------------------- | ||
1262 | # | ||
1263 | # Active (online) defragmentation allows a Redis server to compact the | ||
1264 | # spaces left between small allocations and deallocations of data in memory, | ||
1265 | # thus allowing to reclaim back memory. | ||
1266 | # | ||
1267 | # Fragmentation is a natural process that happens with every allocator (but | ||
1268 | # less so with Jemalloc, fortunately) and certain workloads. Normally a server | ||
1269 | # restart is needed in order to lower the fragmentation, or at least to flush | ||
1270 | # away all the data and create it again. However thanks to this feature | ||
1271 | # implemented by Oran Agra for Redis 4.0 this process can happen at runtime | ||
1272 | # in an "hot" way, while the server is running. | ||
1273 | # | ||
1274 | # Basically when the fragmentation is over a certain level (see the | ||
1275 | # configuration options below) Redis will start to create new copies of the | ||
1276 | # values in contiguous memory regions by exploiting certain specific Jemalloc | ||
1277 | # features (in order to understand if an allocation is causing fragmentation | ||
1278 | # and to allocate it in a better place), and at the same time, will release the | ||
1279 | # old copies of the data. This process, repeated incrementally for all the keys | ||
1280 | # will cause the fragmentation to drop back to normal values. | ||
1281 | # | ||
1282 | # Important things to understand: | ||
1283 | # | ||
1284 | # 1. This feature is disabled by default, and only works if you compiled Redis | ||
1285 | # to use the copy of Jemalloc we ship with the source code of Redis. | ||
1286 | # This is the default with Linux builds. | ||
1287 | # | ||
1288 | # 2. You never need to enable this feature if you don't have fragmentation | ||
1289 | # issues. | ||
1290 | # | ||
1291 | # 3. Once you experience fragmentation, you can enable this feature when | ||
1292 | # needed with the command "CONFIG SET activedefrag yes". | ||
1293 | # | ||
1294 | # The configuration parameters are able to fine tune the behavior of the | ||
1295 | # defragmentation process. If you are not sure about what they mean it is | ||
1296 | # a good idea to leave the defaults untouched. | ||
1297 | |||
1298 | # Enabled active defragmentation | ||
1299 | # activedefrag yes | ||
1300 | |||
1301 | # Minimum amount of fragmentation waste to start active defrag | ||
1302 | # active-defrag-ignore-bytes 100mb | ||
1303 | |||
1304 | # Minimum percentage of fragmentation to start active defrag | ||
1305 | # active-defrag-threshold-lower 10 | ||
1306 | |||
1307 | # Maximum percentage of fragmentation at which we use maximum effort | ||
1308 | # active-defrag-threshold-upper 100 | ||
1309 | |||
1310 | # Minimal effort for defrag in CPU percentage | ||
1311 | # active-defrag-cycle-min 25 | ||
1312 | |||
1313 | # Maximal effort for defrag in CPU percentage | ||
1314 | # active-defrag-cycle-max 75 | ||
diff --git a/meta-oe/recipes-extended/redis/redis/remove-atomics.patch b/meta-oe/recipes-extended/redis/redis/remove-atomics.patch new file mode 100644 index 0000000000..23b2f2aaf0 --- /dev/null +++ b/meta-oe/recipes-extended/redis/redis/remove-atomics.patch | |||
@@ -0,0 +1,72 @@ | |||
1 | From c486455e0691f9915018b9d8b133200a6c61a3c5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Thu, 24 May 2018 09:58:42 -0700 | ||
4 | Subject: [PATCH] Remove atomics | ||
5 | |||
6 | Based on this patch: | ||
7 | https://github.com/patrikx3/lede-redis/blob/master/redis/patches/010-redis.patch | ||
8 | |||
9 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
10 | --- | ||
11 | deps/jemalloc/src/pages.c | 22 +--------------------- | ||
12 | src/atomicvar.h | 4 ++-- | ||
13 | 2 files changed, 3 insertions(+), 23 deletions(-) | ||
14 | |||
15 | diff --git a/deps/jemalloc/src/pages.c b/deps/jemalloc/src/pages.c | ||
16 | index 83a167f6..8e82c78d 100644 | ||
17 | --- a/deps/jemalloc/src/pages.c | ||
18 | +++ b/deps/jemalloc/src/pages.c | ||
19 | @@ -147,27 +147,7 @@ pages_purge(void *addr, size_t size) | ||
20 | { | ||
21 | bool unzeroed; | ||
22 | |||
23 | -#ifdef _WIN32 | ||
24 | - VirtualAlloc(addr, size, MEM_RESET, PAGE_READWRITE); | ||
25 | - unzeroed = true; | ||
26 | -#elif defined(JEMALLOC_HAVE_MADVISE) | ||
27 | -# ifdef JEMALLOC_PURGE_MADVISE_DONTNEED | ||
28 | -# define JEMALLOC_MADV_PURGE MADV_DONTNEED | ||
29 | -# define JEMALLOC_MADV_ZEROS true | ||
30 | -# elif defined(JEMALLOC_PURGE_MADVISE_FREE) | ||
31 | -# define JEMALLOC_MADV_PURGE MADV_FREE | ||
32 | -# define JEMALLOC_MADV_ZEROS false | ||
33 | -# else | ||
34 | -# error "No madvise(2) flag defined for purging unused dirty pages." | ||
35 | -# endif | ||
36 | - int err = madvise(addr, size, JEMALLOC_MADV_PURGE); | ||
37 | - unzeroed = (!JEMALLOC_MADV_ZEROS || err != 0); | ||
38 | -# undef JEMALLOC_MADV_PURGE | ||
39 | -# undef JEMALLOC_MADV_ZEROS | ||
40 | -#else | ||
41 | - /* Last resort no-op. */ | ||
42 | - unzeroed = true; | ||
43 | -#endif | ||
44 | + unzeroed = false; | ||
45 | return (unzeroed); | ||
46 | } | ||
47 | |||
48 | diff --git a/src/atomicvar.h b/src/atomicvar.h | ||
49 | index 84a5bbc5..f9b563c2 100644 | ||
50 | --- a/src/atomicvar.h | ||
51 | +++ b/src/atomicvar.h | ||
52 | @@ -68,7 +68,7 @@ | ||
53 | * is reported. */ | ||
54 | // #define __ATOMIC_VAR_FORCE_SYNC_MACROS | ||
55 | |||
56 | -#if !defined(__ATOMIC_VAR_FORCE_SYNC_MACROS) && defined(__ATOMIC_RELAXED) && !defined(__sun) && (!defined(__clang__) || !defined(__APPLE__) || __apple_build_version__ > 4210057) | ||
57 | +#if defined(CONFIG_EDAC_ATOMIC_SCRUB) && !defined(__ATOMIC_VAR_FORCE_SYNC_MACROS) && defined(__ATOMIC_RELAXED) && !defined(__sun) && (!defined(__clang__) || !defined(__APPLE__) || __apple_build_version__ > 4210057) | ||
58 | /* Implementation using __atomic macros. */ | ||
59 | |||
60 | #define atomicIncr(var,count) __atomic_add_fetch(&var,(count),__ATOMIC_RELAXED) | ||
61 | @@ -82,7 +82,7 @@ | ||
62 | #define atomicSet(var,value) __atomic_store_n(&var,value,__ATOMIC_RELAXED) | ||
63 | #define REDIS_ATOMIC_API "atomic-builtin" | ||
64 | |||
65 | -#elif defined(HAVE_ATOMIC) | ||
66 | +#elif defined(CONFIG_EDAC_ATOMIC_SCRUB) && defined(HAVE_ATOMIC) | ||
67 | /* Implementation using __sync macros. */ | ||
68 | |||
69 | #define atomicIncr(var,count) __sync_add_and_fetch(&var,(count)) | ||
70 | -- | ||
71 | 2.17.0 | ||
72 | |||
diff --git a/meta-oe/recipes-extended/redis/redis_3.0.2.bb b/meta-oe/recipes-extended/redis/redis_4.0.8.bb index 9395b33b08..b6f37e9db8 100644 --- a/meta-oe/recipes-extended/redis/redis_3.0.2.bb +++ b/meta-oe/recipes-extended/redis/redis_4.0.8.bb | |||
@@ -13,11 +13,12 @@ SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \ | |||
13 | file://redis.conf \ | 13 | file://redis.conf \ |
14 | file://init-redis-server \ | 14 | file://init-redis-server \ |
15 | file://redis.service \ | 15 | file://redis.service \ |
16 | file://hiredis-update-Makefile-to-add-symbols-to-staticlib.patch \ | ||
17 | " | 16 | " |
18 | 17 | ||
19 | SRC_URI[md5sum] = "87be8867447f62524b584813e5a7bd14" | 18 | SRC_URI_append_mips = " file://remove-atomics.patch" |
20 | SRC_URI[sha256sum] = "93e422c0d584623601f89b956045be158889ebe594478a2c24e1bf218495633f" | 19 | |
20 | SRC_URI[md5sum] = "c75b11e4177e153e4dc1d8dd3a6174e4" | ||
21 | SRC_URI[sha256sum] = "ff0c38b8c156319249fec61e5018cf5b5fe63a65b61690bec798f4c998c232ad" | ||
21 | 22 | ||
22 | inherit autotools-brokensep update-rc.d systemd useradd | 23 | inherit autotools-brokensep update-rc.d systemd useradd |
23 | 24 | ||