Browse Source

redis: Lower some default values

This avoids a warning on startup.
android-5
Fredrik Fornwall 8 years ago
parent
commit
25340ac1f5
  1. 55
      packages/redis/lower-default-values.patch

55
packages/redis/lower-default-values.patch

@ -0,0 +1,55 @@
Avoid warnings on startup due to trying to set too high maxclients
and tcp-backlog.
Values observed on a Xperia Z4 Tablet running Android 7.0.
diff -u -r ../redis-3.2.8/redis.conf ./redis.conf
--- ../redis-3.2.8/redis.conf 2017-02-12 16:14:57.000000000 +0100
+++ ./redis.conf 2017-03-07 14:38:42.825991097 +0100
@@ -90,7 +90,7 @@
# will silently truncate it to the value of /proc/sys/net/core/somaxconn so
# make sure to raise both the value of somaxconn and tcp_max_syn_backlog
# in order to get the desired effect.
-tcp-backlog 511
+tcp-backlog 128
# Unix socket.
#
@@ -501,7 +501,7 @@
################################### LIMITS ####################################
# Set the max number of connected clients at the same time. By default
-# this limit is set to 10000 clients, however if the Redis server is not
+# this limit is set to 4000 clients, however if the Redis server is not
# able to configure the process file limit to allow for the specified limit
# the max number of allowed clients is set to the current file limit
# minus 32 (as Redis reserves a few file descriptors for internal uses).
@@ -509,7 +509,7 @@
# Once the limit is reached Redis will close all the new connections sending
# an error 'max number of clients reached'.
#
-# maxclients 10000
+# maxclients 4000
# Don't use more memory than the specified amount of bytes.
# When the memory limit is reached Redis will try to remove keys
diff -u -r ../redis-3.2.8/src/server.h ./src/server.h
--- ../redis-3.2.8/src/server.h 2017-02-12 16:14:57.000000000 +0100
+++ ./src/server.h 2017-03-07 14:38:53.357859408 +0100
@@ -79,7 +79,7 @@
#define CONFIG_MIN_HZ 1
#define CONFIG_MAX_HZ 500
#define CONFIG_DEFAULT_SERVER_PORT 6379 /* TCP port */
-#define CONFIG_DEFAULT_TCP_BACKLOG 511 /* TCP listen backlog */
+#define CONFIG_DEFAULT_TCP_BACKLOG 128 /* TCP listen backlog */
#define CONFIG_DEFAULT_CLIENT_TIMEOUT 0 /* default client timeout: infinite */
#define CONFIG_DEFAULT_DBNUM 16
#define CONFIG_MAX_LINE 1024
@@ -94,7 +94,7 @@
#define AOF_REWRITE_ITEMS_PER_CMD 64
#define CONFIG_DEFAULT_SLOWLOG_LOG_SLOWER_THAN 10000
#define CONFIG_DEFAULT_SLOWLOG_MAX_LEN 128
-#define CONFIG_DEFAULT_MAX_CLIENTS 10000
+#define CONFIG_DEFAULT_MAX_CLIENTS 4000
#define CONFIG_AUTHPASS_MAX_LEN 512
#define CONFIG_DEFAULT_SLAVE_PRIORITY 100
#define CONFIG_DEFAULT_REPL_TIMEOUT 60
Loading…
Cancel
Save