Redis RESP3 Configuration Guide
Redis RESP3 Configuration Guide
Comprehensive configuration reference for HeliosDB’s Redis protocol support.
Connection Configuration
Basic Connection
import redis
# Simple connectionclient = redis.Redis( host='localhost', port=6379, protocol=3, # RESP3 decode_responses=True)Connection Pooling
# Connection pool with multiple connectionspool = redis.ConnectionPool( host='localhost', port=6379, max_connections=50, protocol=3, socket_keepalive=True, socket_keepalive_options={ 1: 3, # TCP_KEEPIDLE - idle time 2: 3, # TCP_KEEPINTVL - interval 3: 3 # TCP_KEEPCNT - max probes })
client = redis.Redis(connection_pool=pool)Connection Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
host | string | localhost | Server hostname |
port | int | 6379 | Redis protocol port |
protocol | int | 3 | RESP version (2 or 3) |
password | string | None | Authentication password |
username | string | default | ACL username |
db | int | 0 | Database number |
decode_responses | bool | False | Auto-decode bytes to str |
socket_timeout | float | None | Socket timeout (seconds) |
socket_connect_timeout | float | None | Connection timeout |
retry_on_timeout | bool | False | Retry on timeout |
Authentication
Password Authentication
# Simple password (AUTH command)client = redis.Redis( host='localhost', port=6379, password='your_password', protocol=3)ACL Authentication (Redis 6.0+)
# Username + password (ACL)client = redis.Redis( host='localhost', port=6379, username='analytics_user', password='secure_password', protocol=3)
# ACL operationsclient.acl_setuser( 'alice', '>password123', permissions=['+@all', '~*'])client.acl_getuser('alice')TLS/SSL Configuration
Basic TLS
import redisimport ssl
# TLS connectionclient = redis.Redis( host='localhost', port=6380, protocol=3, ssl=True, ssl_certfile='/path/to/client.crt', ssl_keyfile='/path/to/client.key', ssl_ca_certs='/path/to/ca.crt', ssl_check_hostname=True)Custom SSL Context
# Custom verification contextssl_context = ssl.create_default_context()ssl_context.check_hostname = Falsessl_context.verify_mode = ssl.CERT_NONE
client = redis.Redis( host='localhost', port=6380, protocol=3, ssl_context=ssl_context)TLS Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ssl | bool | False | Enable TLS |
ssl_certfile | string | None | Client certificate path |
ssl_keyfile | string | None | Client key path |
ssl_ca_certs | string | None | CA certificate path |
ssl_check_hostname | bool | False | Verify hostname |
ssl_cert_reqs | string | required | Certificate requirements |
Connection Pool Settings
Pool Configuration
pool = redis.ConnectionPool( host='localhost', port=6379, max_connections=100, timeout=30, retry_on_error=[TimeoutError, ConnectionError], health_check_interval=30)Pool Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
max_connections | int | 10 | Maximum pool connections |
timeout | float | 20 | Pool wait timeout |
retry_on_error | list | [] | Exception types to retry |
health_check_interval | int | 0 | Connection health check interval |
Cluster Configuration
Redis Cluster Mode
from redis.cluster import RedisCluster
# Cluster connectioncluster = RedisCluster( host='localhost', port=7000, decode_responses=True)
# Multiple startup nodescluster = RedisCluster( startup_nodes=[ {'host': 'node1', 'port': 7000}, {'host': 'node2', 'port': 7001}, {'host': 'node3', 'port': 7002} ], decode_responses=True)Sentinel Configuration
High Availability Setup
from redis.sentinel import Sentinel
# Sentinel connectionsentinel = Sentinel([ ('sentinel1', 26379), ('sentinel2', 26379), ('sentinel3', 26379)], socket_timeout=0.5)
# Get master connectionmaster = sentinel.master_for( 'mymaster', socket_timeout=0.5, password='master_password')
# Get replica connectionreplica = sentinel.slave_for( 'mymaster', socket_timeout=0.5, password='replica_password')Performance Tuning
Socket Options
import socket
pool = redis.ConnectionPool( host='localhost', port=6379, socket_keepalive=True, socket_keepalive_options={ socket.TCP_KEEPIDLE: 3, # Start keepalive after 3s idle socket.TCP_KEEPINTVL: 3, # Probe every 3s socket.TCP_KEEPCNT: 3 # Max 3 probes })Timeout Configuration
client = redis.Redis( host='localhost', port=6379, socket_timeout=5.0, # Read/write timeout socket_connect_timeout=2.0, # Connection timeout retry_on_timeout=True, # Retry on timeout retry_on_error=[ConnectionError, TimeoutError])Pipeline Configuration
# Batch operations for performancepipeline = client.pipeline(transaction=False)for i in range(1000): pipeline.set(f'key:{i}', f'value:{i}')pipeline.execute()HeliosDB-Specific Settings
Server Configuration
[redis]enabled = trueport = 6379bind = "0.0.0.0"max_connections = 10000timeout = 300protocol_version = 3
[redis.auth]password = "your_secure_password"acl_enabled = trueacl_file = "/etc/heliosdb/users.acl"
[redis.tls]enabled = falsecert_file = "/path/to/server.crt"key_file = "/path/to/server.key"ca_file = "/path/to/ca.crt"Environment Variables
| Variable | Description |
|---|---|
HELIOSDB_REDIS_PORT | Redis protocol port |
HELIOSDB_REDIS_PASSWORD | Authentication password |
HELIOSDB_REDIS_MAX_CONNECTIONS | Maximum connections |
HELIOSDB_REDIS_TLS_ENABLED | Enable TLS (true/false) |
Related: README.md | COMPATIBILITY.md | EXAMPLES.md
Last Updated: December 2025