Fredrik Fornwall
6 years ago
5 changed files with 65 additions and 58 deletions
@ -1,55 +0,0 @@ |
|||
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 |
@ -0,0 +1,30 @@ |
|||
diff -u -r ../redis-5.0.0/redis.conf ./redis.conf
|
|||
--- ../redis-5.0.0/redis.conf 2018-10-17 15:31:39.000000000 +0000
|
|||
+++ ./redis.conf 2018-10-18 17:33:32.672423453 +0000
|
|||
@@ -98,7 +98,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 127
|
|||
|
|||
# Unix socket. |
|||
# |
|||
@@ -528,7 +528,7 @@
|
|||
################################### CLIENTS #################################### |
|||
|
|||
# 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 512 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). |
|||
@@ -536,7 +536,7 @@
|
|||
# Once the limit is reached Redis will close all the new connections sending |
|||
# an error 'max number of clients reached'. |
|||
# |
|||
-# maxclients 10000
|
|||
+# maxclients 512
|
|||
|
|||
############################## MEMORY MANAGEMENT ################################ |
|||
|
@ -0,0 +1,12 @@ |
|||
diff -u -r ../redis-5.0.0/src/Makefile ./src/Makefile
|
|||
--- ../redis-5.0.0/src/Makefile 2018-10-17 15:31:39.000000000 +0000
|
|||
+++ ./src/Makefile 2018-10-18 17:20:36.811751940 +0000
|
|||
@@ -100,7 +100,7 @@
|
|||
else |
|||
# All the other OSes (notably Linux) |
|||
FINAL_LDFLAGS+= -rdynamic |
|||
- FINAL_LIBS+=-ldl -pthread -lrt
|
|||
+ FINAL_LIBS+=-ldl
|
|||
endif |
|||
endif |
|||
endif |
@ -0,0 +1,21 @@ |
|||
diff -u -r ../redis-5.0.0/src/server.h ./src/server.h
|
|||
--- ../redis-5.0.0/src/server.h 2018-10-17 15:31:39.000000000 +0000
|
|||
+++ ./src/server.h 2018-10-18 17:32:04.424841206 +0000
|
|||
@@ -84,7 +84,7 @@
|
|||
#define CONFIG_MAX_HZ 500 |
|||
#define MAX_CLIENTS_PER_CLOCK_TICK 200 /* HZ is adapted based on that. */ |
|||
#define CONFIG_DEFAULT_SERVER_PORT 6379 /* TCP port. */ |
|||
-#define CONFIG_DEFAULT_TCP_BACKLOG 511 /* TCP listen backlog. */
|
|||
+#define CONFIG_DEFAULT_TCP_BACKLOG 127 /* TCP listen backlog. */
|
|||
#define CONFIG_DEFAULT_CLIENT_TIMEOUT 0 /* Default client timeout: infinite */ |
|||
#define CONFIG_DEFAULT_DBNUM 16 |
|||
#define CONFIG_MAX_LINE 1024 |
|||
@@ -100,7 +100,7 @@
|
|||
#define AOF_READ_DIFF_INTERVAL_BYTES (1024*10) |
|||
#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 512
|
|||
#define CONFIG_AUTHPASS_MAX_LEN 512 |
|||
#define CONFIG_DEFAULT_SLAVE_PRIORITY 100 |
|||
#define CONFIG_DEFAULT_REPL_TIMEOUT 60 |
Loading…
Reference in new issue