Browse Source
Merge pull request #13827 from pon0marev/improvement/redis-pool-config
Redis pool latency optimization by reducing excessive pings
pull/13838/head
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with
14 additions and
14 deletions
-
application/src/main/resources/thingsboard.yml
-
common/cache/src/main/java/org/thingsboard/server/cache/TBRedisCacheConfiguration.java
-
transport/coap/src/main/resources/tb-coap-transport.yml
-
transport/http/src/main/resources/tb-http-transport.yml
-
transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml
-
transport/mqtt/src/main/resources/tb-mqtt-transport.yml
-
transport/snmp/src/main/resources/tb-snmp-transport.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 |
|
|
|
|
|
|
|
@ -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}") |
|
|
|
|
|
|
|
@ -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 |
|
|
|
|
|
|
|
@ -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 |
|
|
|
|
|
|
|
@ -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 |
|
|
|
|
|
|
|
@ -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 |
|
|
|
|
|
|
|
@ -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 |
|
|
|
|