feat: update Redis connection pool configuration #4086
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces updates to Redis configuration defaults and enhancements to Redis connection pool management across the codebase. The changes include adjustments to default Redis connection settings, the addition of new configuration options (
PoolSize
andPoolTimeout
), and updates to relevant test cases and configuration files.Redis Configuration Updates:
internal/job/constants.go
: ReducedDefaultRedisMaxIdle
from 10 to 5 andDefaultRedisMaxActive
from 50 to 20 to optimize resource usage.manager/config/constants.go
: Added defaults forDefaultRedisPoolSize
(20) andDefaultRedisPoolTimeout
(10 seconds) and reducedDefaultLFUCacheSize
from 10,000 to 8,000. [1] [2]New Redis Connection Pool Options:
manager/config/config.go
: IntroducedPoolSize
andPoolTimeout
fields in theRedisConfig
struct to allow configuration of the Redis connection pool. These fields were also initialized with default values in theNew()
function. [1] [2]manager/cache/cache.go
: Updated theNew
function to pass the newPoolSize
andPoolTimeout
options to the Redis client configuration.Test and Configuration File Updates:
manager/config/config_test.go
: Updated test cases to includePoolSize
(10) andPoolTimeout
(1 second) in the Redis configuration.manager/config/testdata/manager.yaml
: AddedpoolSize
andpoolTimeout
fields to the Redis configuration in the test YAML file.Related Issue
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist