From c24b44b7620c30a8f52dff2a397c067af1f3cf6b Mon Sep 17 00:00:00 2001 From: pon0marev Date: Wed, 6 Aug 2025 15:18:23 +0300 Subject: [PATCH] Optimize Redis pool ping parameters --- application/src/main/resources/thingsboard.yml | 4 ++-- .../thingsboard/server/cache/TBRedisCacheConfiguration.java | 4 ++-- transport/coap/src/main/resources/tb-coap-transport.yml | 4 ++-- transport/http/src/main/resources/tb-http-transport.yml | 4 ++-- transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml | 4 ++-- transport/mqtt/src/main/resources/tb-mqtt-transport.yml | 4 ++-- transport/snmp/src/main/resources/tb-snmp-transport.yml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index 0c1d419da2..c99163b833 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -742,9 +742,9 @@ redis: # Minumum number of idle connections that can be maintained in the pool without being closed minIdle: "${REDIS_POOL_CONFIG_MIN_IDLE:16}" # Enable/Disable PING command sent when a connection is borrowed - testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:true}" + testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:false}" # The property is used to specify whether to test the connection before returning it to the connection pool. - testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:true}" + testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:false}" # The property is used in the context of connection pooling in Redis testWhileIdle: "${REDIS_POOL_CONFIG_TEST_WHILE_IDLE:true}" # Minimum time that an idle connection should be idle before it can be evicted from the connection pool. The value is set in milliseconds diff --git a/common/cache/src/main/java/org/thingsboard/server/cache/TBRedisCacheConfiguration.java b/common/cache/src/main/java/org/thingsboard/server/cache/TBRedisCacheConfiguration.java index 8e06913d2c..8f51afed66 100644 --- a/common/cache/src/main/java/org/thingsboard/server/cache/TBRedisCacheConfiguration.java +++ b/common/cache/src/main/java/org/thingsboard/server/cache/TBRedisCacheConfiguration.java @@ -79,10 +79,10 @@ public abstract class TBRedisCacheConfiguration { @Value("${redis.pool_config.minIdle:16}") private int minIdle; - @Value("${redis.pool_config.testOnBorrow:true}") + @Value("${redis.pool_config.testOnBorrow:false}") private boolean testOnBorrow; - @Value("${redis.pool_config.testOnReturn:true}") + @Value("${redis.pool_config.testOnReturn:false}") private boolean testOnReturn; @Value("${redis.pool_config.testWhileIdle:true}") diff --git a/transport/coap/src/main/resources/tb-coap-transport.yml b/transport/coap/src/main/resources/tb-coap-transport.yml index c54bf038f2..f40a09c753 100644 --- a/transport/coap/src/main/resources/tb-coap-transport.yml +++ b/transport/coap/src/main/resources/tb-coap-transport.yml @@ -114,9 +114,9 @@ redis: # Minumum number of idle connections that can be maintained in the pool without being closed minIdle: "${REDIS_POOL_CONFIG_MIN_IDLE:16}" # Enable/Disable PING command send when a connection is borrowed - testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:true}" + testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:false}" # The property is used to specify whether to test the connection before returning it to the connection pool. - testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:true}" + testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:false}" # The property is used in the context of connection pooling in Redis testWhileIdle: "${REDIS_POOL_CONFIG_TEST_WHILE_IDLE:true}" # Minimum amount of time that an idle connection should be idle before it can be evicted from the connection pool. Value set in milliseconds diff --git a/transport/http/src/main/resources/tb-http-transport.yml b/transport/http/src/main/resources/tb-http-transport.yml index 3a3725edef..587894d5ce 100644 --- a/transport/http/src/main/resources/tb-http-transport.yml +++ b/transport/http/src/main/resources/tb-http-transport.yml @@ -147,9 +147,9 @@ redis: # Minumum number of idle connections that can be maintained in the pool without being closed minIdle: "${REDIS_POOL_CONFIG_MIN_IDLE:16}" # Enable/Disable PING command send when a connection is borrowed - testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:true}" + testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:false}" # The property is used to specify whether to test the connection before returning it to the connection pool. - testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:true}" + testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:false}" # The property is used in the context of connection pooling in Redis testWhileIdle: "${REDIS_POOL_CONFIG_TEST_WHILE_IDLE:true}" # Minimum amount of time that an idle connection should be idle before it can be evicted from the connection pool. Value set in milliseconds diff --git a/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml b/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml index 60568a6a4e..0895bfa676 100644 --- a/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml +++ b/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml @@ -114,9 +114,9 @@ redis: # Minumum number of idle connections that can be maintained in the pool without being closed minIdle: "${REDIS_POOL_CONFIG_MIN_IDLE:16}" # Enable/Disable PING command send when a connection is borrowed - testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:true}" + testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:false}" # The property is used to specify whether to test the connection before returning it to the connection pool. - testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:true}" + testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:false}" # The property is used in the context of connection pooling in Redis testWhileIdle: "${REDIS_POOL_CONFIG_TEST_WHILE_IDLE:true}" # Minimum amount of time that an idle connection should be idle before it can be evicted from the connection pool. Value set in milliseconds diff --git a/transport/mqtt/src/main/resources/tb-mqtt-transport.yml b/transport/mqtt/src/main/resources/tb-mqtt-transport.yml index 55781abeeb..fae10cc892 100644 --- a/transport/mqtt/src/main/resources/tb-mqtt-transport.yml +++ b/transport/mqtt/src/main/resources/tb-mqtt-transport.yml @@ -115,9 +115,9 @@ redis: # Minumum number of idle connections that can be maintained in the pool without being closed minIdle: "${REDIS_POOL_CONFIG_MIN_IDLE:16}" # Enable/Disable PING command send when a connection is borrowed - testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:true}" + testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:false}" # The property is used to specify whether to test the connection before returning it to the connection pool. - testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:true}" + testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:false}" # The property is used in the context of connection pooling in Redis testWhileIdle: "${REDIS_POOL_CONFIG_TEST_WHILE_IDLE:true}" # Minimum amount of time that an idle connection should be idle before it can be evicted from the connection pool. Value set in milliseconds diff --git a/transport/snmp/src/main/resources/tb-snmp-transport.yml b/transport/snmp/src/main/resources/tb-snmp-transport.yml index 746e8f2173..79aee31921 100644 --- a/transport/snmp/src/main/resources/tb-snmp-transport.yml +++ b/transport/snmp/src/main/resources/tb-snmp-transport.yml @@ -114,9 +114,9 @@ redis: # Minumum number of idle connections that can be maintained in the pool without being closed minIdle: "${REDIS_POOL_CONFIG_MIN_IDLE:16}" # Enable/Disable PING command send when a connection is borrowed - testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:true}" + testOnBorrow: "${REDIS_POOL_CONFIG_TEST_ON_BORROW:false}" # The property is used to specify whether to test the connection before returning it to the connection pool. - testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:true}" + testOnReturn: "${REDIS_POOL_CONFIG_TEST_ON_RETURN:false}" # The property is used in the context of connection pooling in Redis testWhileIdle: "${REDIS_POOL_CONFIG_TEST_WHILE_IDLE:true}" # Minimum amount of time that an idle connection should be idle before it can be evicted from the connection pool. Value set in milliseconds