Advanced Configuration
Production tuning and environment-based settings.
Environment Variables
| Variable | Default | Description |
|---|---|---|
| TUBOX_HOST | localhost | Server hostname or IP address |
| TUBOX_PORT | 7188 | Binary protocol port |
| TUBOX_LOG_LEVEL | INFO | Logging verbosity (DEBUG, INFO, WARNING, ERROR) |
.env
TUBOX_HOST=tubox.production.com
TUBOX_PORT=7188
TUBOX_LOG_LEVEL=WARNING
Retry Configuration
The SDK implements exponential backoff with jitter for transient failures.
Max Attempts
3
Initial Delay
100ms
Backoff Factor
2.0x
config = ClientConfig(
retry_max_attempts=5,
retry_initial_delay=0.2, # 200ms
retry_max_delay=30.0, # 30 seconds cap
retry_backoff_factor=2.5 # Aggressive backoff
)
Performance Tuning
High-Throughput Workloads
config = ClientConfig(
max_pool_size=50, # Large pool for concurrent ops
max_connections=200, # High concurrency limit
request_timeout=60.0, # Long-running queries
pool_timeout=10.0 # Wait for available connection
)
Low-Latency Applications
config = ClientConfig(
max_pool_size=10, # Smaller pool, faster acquisition
connect_timeout=2.0, # Fast-fail on network issues
request_timeout=5.0, # Short timeout for quick responses
retry_max_attempts=1 # No retries for lowest latency
)
Logging Configuration
import logging
config = ClientConfig(log_level="DEBUG")
logger = config.configure_logging()
# Logs include:
# - Connection lifecycle (acquire/release)
# - Request/response details
# - Pool metrics and health checks
# - Authentication events
Last updated: Dec 14, 2025