From 25340ac1f5bee2a1e13124f7e31cf8f7b6668f83 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 7 Mar 2017 14:47:01 +0100 Subject: [PATCH] redis: Lower some default values This avoids a warning on startup. --- packages/redis/lower-default-values.patch | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 packages/redis/lower-default-values.patch diff --git a/packages/redis/lower-default-values.patch b/packages/redis/lower-default-values.patch new file mode 100644 index 000000000..827745f0c --- /dev/null +++ b/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