feat: update Redis connection pool configuration#4086
Merged
Conversation
Signed-off-by: Gaius <gaius.qi@gmail.com>
gaius-qi
added a commit
that referenced
this pull request
May 20, 2025
Signed-off-by: Gaius <gaius.qi@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 (
PoolSizeandPoolTimeout), and updates to relevant test cases and configuration files.Redis Configuration Updates:
internal/job/constants.go: ReducedDefaultRedisMaxIdlefrom 10 to 5 andDefaultRedisMaxActivefrom 50 to 20 to optimize resource usage.manager/config/constants.go: Added defaults forDefaultRedisPoolSize(20) andDefaultRedisPoolTimeout(10 seconds) and reducedDefaultLFUCacheSizefrom 10,000 to 8,000. [1] [2]New Redis Connection Pool Options:
manager/config/config.go: IntroducedPoolSizeandPoolTimeoutfields in theRedisConfigstruct 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 theNewfunction to pass the newPoolSizeandPoolTimeoutoptions 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: AddedpoolSizeandpoolTimeoutfields to the Redis configuration in the test YAML file.Related Issue
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist