tencent cloud

Tencent Cloud Distributed Cache (Redis OSS-Compatible)

Release Notes and Announcements
Release Notes
Announcements
User Tutorial
Product Introduction
Overview
Product Strengths
Use Cases
Storage Engine
Product Series
Product Versions
Specifications and Performance
Read/Write Separation
Multi-AZ Deployment
Regions and AZs
Terms
Service Regions and Service Providers
Purchase Guide
Billing Overview
Pricing Center
Instance Purchasing
Renewal (Yearly/Monthly Subscription)
Refund (Yearly/Monthly Subscription)
Overdue Payments
Switching from Pay-as-You-Go to Yearly/Monthly Subscription
Getting Started
Quickly Creating an Instance
Connecting to Redis Instance
Operation Guide
Operation Overview
Connecting to a Database Instance
Managing Instances
Upgrade Instance
Management Node (Redis/ValKey Edition)
Multi-AZ Deployment Management
Backup and Restoration
Managing Accounts
Parameter Configuration
Slow Query
Access Management
Network and Security
Monitoring and Alarms
Event Management (Redis/ValKey Edition)
Data Migration
Global Replication for Redis Edition
Database Audit
Performance Optimization
Sentinel Mode
Development Guidelines
Naming Rules
Basic Usage Guidelines
Design Principles of Key and Value
Command Usage Guidelines
Design Principles of Client Programs
Connection Pool Configuration
Command Reference
Command Reference Overview
Redis Edition and Valkey Edition Command Compatibility
Version Command Usage Differences
Differences Between the Proxy Architecture and Direct Connection Mode
More Command Operations (Redis/Valkey Edition)
Memcached Edition Command Compatibility
Practical Tutorial
Building TencentDB for Redis® Client Monitoring Based on Spring Boot
Redis Client Connection Configuration Policy and Practice
Global SCAN Guide for Cluster Architecture
Eliminating Instances Securely
Hot Key and Big Key
AZ Migration Scheme
Troubleshooting
Connection Exception
Exception Analysis and Solution of Redisson Client Timeout Reconnection
Performance Troubleshooting and Fine-Tuning
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Parameter Management APIs
Other APIs
Backup and Restoration APIs
Region APIs
Monitoring and Management APIs
Log APIs
Data Types
Error Codes
FAQs
General
Connection and Login
Purchase
Service Agreement
Service Level Agreement
Terms of Service
Glossary
Contact Us

Parameter Configuration

PDF
フォーカスモード
フォントサイズ
最終更新日: 2026-03-17 18:23:48
To connect to Redis via Lettuce and quickly build your client, see the table below for the recommended values of connection parameters and related connection pool configurations.
Parameter Name
Type
Default Value
Description
Recommended Value
connectTimeout
int
10s
Maximum waiting time for the client to attempt to establish a connection with Redis.
2s
commandTimeout
int
None
Timeout of Redis server response after the client sends a request.
2s
tcpKeepaliveTimeIdle
int
2h
After keepalive is enabled, the time duration the connection remains idle before the keepalive probe is sent.
30s
tcpKeepaliveTimeInterval
int
75s
The time interval between two keepalives after keepalive is enabled. The recommended value is 10s.
10s
tcpKeepaliveCount
int
9
After keepalive is enabled, the maximum number of Keepalive probes TCP should send before disconnecting the connection.
3
tcpUserTimeout
int
7875s
Maximum time TCP waits for acknowledgment before giving up retransmitting data and closing the connection.
30s
poolMaxwait
int
None
Maximum time a caller waits when no connections are available in the connection pool.
1000ms
poolMaxActive
int
8
Maximum total number of connections that the connection pool can allocate. Set this value according to specific business needs.
-
poolMaxIdle
int
8
Maximum number of idle connections allowed in the connection pool. Set this value according to specific business needs.
-
poolMinIdle
int
0
Minimum number of idle connections allowed in the connection pool. Set this value according to specific business needs.
-

application.properties Format

# Configure Host, Port, Database, and Password by one of two methods: file or code.
spring.data.redis.host=XX.XX.XX.XX
spring.data.redis.port=6379
spring.data.redis.password=XXXX
spring.data.redis.database=0

#tencent.redis.host=XX.XX.XX.XX
#tencent.redis.port=6379
#tencent.redis.database=0
#tencent.redis.password=XXXX
tencent.redis.connect.timeout=2000
tencent.redis.command.timeout=2000
tencent.redis.tcp.keepalive.time.idle=30
tencent.redis.tcp.keepalive.time.interval=10
tencent.redis.tcp.keepalive.count=3
tencent.redis.tcp.user.timeout=30

tencent.redis.pool.max-wait=1000
tencent.redis.pool.max-active=2000
tencent.redis.pool.max-idle=1000
tencent.redis.pool.min-idle=500

application.yml Format


# Default Redis configuration in Spring Boot
spring:
data:
redis:
host: XX.XX.XX.XX
port: 6379
password: XXXX
database: 0

# Custom Tencent Redis configuration
tencent:
redis:
# host: XX.XX.XX.XX
# port: 6379
# database: 0
# password: XXXX
connect.timeout: 2000
command.timeout: 2000
tcp:
keepalive:
time.idle: 30
time.interval: 10
count: 3
user.timeout: 30
pool:
max-wait: 1000
max-active: 2000
max-idle: 1000
min-idle: 500

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック