From 1aefa7a85f2ece8b4f6e019f37da3b286a1527d4 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Tue, 22 Apr 2025 15:51:59 +0800 Subject: [PATCH] perf: update max_connections to use configurable setting in Redis configuration --- apps/jumpserver/conf.py | 1 + apps/jumpserver/settings/base.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index 597ca3872..654b6fcef 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -204,6 +204,7 @@ class Config(dict): 'REDIS_SSL_CERT': None, 'REDIS_SSL_CA': None, 'REDIS_SSL_REQUIRED': 'none', + 'REDIS_MAX_CONNECTIONS': 100, # Redis Sentinel 'REDIS_SENTINEL_HOSTS': '', 'REDIS_SENTINEL_PASSWORD': '', diff --git a/apps/jumpserver/settings/base.py b/apps/jumpserver/settings/base.py index 00bb729c4..a336536b2 100644 --- a/apps/jumpserver/settings/base.py +++ b/apps/jumpserver/settings/base.py @@ -364,7 +364,7 @@ REDIS_OPTIONS = { "health_check_interval": 30 }, "CONNECTION_POOL_KWARGS": { - 'max_connections': 100, + 'max_connections': CONFIG.REDIS_MAX_CONNECTIONS, } } if REDIS_USE_SSL: