Performance Characteristics
Timeplus Proton delivers exceptional performance:- Throughput: Up to 90 million events per second (EPS) on modern hardware
- Latency: As low as 4 milliseconds end-to-end latency
- Cardinality: Handles 1 million unique keys in aggregations
- Resource Efficient: Runs on as little as 0.5 GB RAM (AWS t2.nano)
Memory Optimization
Memory Configuration
Configure memory limits based on available RAM:Memory Limit Recommendations
| RAM Available | max_server_memory | mark_cache | uncompressed_cache |
|---|---|---|---|
| 4 GB | 0.7 | 512 MB | 1 GB |
| 8 GB | 0.8 | 1 GB | 2 GB |
| 16 GB | 0.85 | 2 GB | 4 GB |
| 32 GB | 0.9 | 5 GB | 8 GB |
| 64 GB+ | 0.9 | 10 GB | 16 GB |
Per-Query Memory Limits
Configure inusers.yaml:
Monitor Memory Usage
CPU Optimization
Thread Pool Configuration
Optimize thread pools for your CPU core count:Thread Pool Sizing Guidelines
| CPU Cores | background_pool | merge_pool | streaming_pool |
|---|---|---|---|
| 2-4 | 4 | 4 | 50 |
| 8 | 8 | 8 | 100 |
| 16 | 16 | 16 | 200 |
| 32+ | 32 | 32 | 300 |
CPU Affinity
For dedicated servers, pin Proton to specific CPU cores:SIMD Optimization
Proton uses SIMD instructions for performance. Ensure your CPU supports:- x86_64: AVX2 (minimum), AVX-512 (optimal)
- ARM: NEON (included in ARM64)
Query Concurrency Tuning
Concurrent Query Limits
Environment Variable Override
Adjust Based on Workload
- High read throughput: Increase
max_concurrent_select_queries - High write throughput: Increase
max_concurrent_insert_queries - Many streaming queries: Increase
streaming_processing_pool_size - Limited resources: Reduce all limits to prevent overload
Storage Optimization
Disk Selection
- Best: NVMe SSD for data and checkpoints
- Good: SATA SSD for data, separate disk for checkpoints
- Minimum: SSD (avoid HDD for production)
Data Path Configuration
Compression Settings
Balance compression ratio vs. CPU usage:- ZSTD(1): Fastest, lower compression
- ZSTD(3): Balanced (recommended)
- ZSTD(9): Higher compression, slower
- LZ4: Faster than ZSTD, lower ratio
Network Optimization
TCP Settings
Kafka/Redpanda Tuning
Optimize external stream storage:Latency vs. Throughput Tradeoff
For minimum latency (< 10ms):Checkpoint Optimization
For stateful streaming queries:Checkpoint Best Practices
- Use fast storage (NVMe) for checkpoint directory
- Tune intervals based on state size
- Monitor checkpoint latency in query logs
- Clean up old checkpoints via TTL settings
- Separate checkpoint disk from data disk if possible
Streaming Query Optimization
Window Function Tuning
Optimize tumble/hop/session windows:Materialized View Optimization
Avoid Common Pitfalls
- Don’t use
SELECT *- specify only needed columns - Avoid unbounded state - use time windows
- Limit JOIN complexity - pre-aggregate when possible
- Use appropriate data types - smaller types = better performance
- Partition large tables - by date or other key
Scaling Strategies
Vertical Scaling
- Add more RAM - improves caching and query parallelism
- Upgrade CPU - faster cores with AVX-512
- Use NVMe storage - reduces I/O bottlenecks
- Increase network bandwidth - for Kafka integration
Horizontal Scaling Patterns
Pattern 1: Dedicated Compute Nodes
Pattern 2: Topic Partitioning
Partition Kafka topics and assign partitions to different Proton instances:Load Balancing
Use a load balancer for query distribution:Performance Monitoring
Key Metrics to Track
Benchmark Your Configuration
Performance Troubleshooting
Slow Queries
- Add indexes on filter columns
- Reduce data scanned (use time filters)
- Increase
max_memory_usage - Optimize JOIN order
High Memory Usage
- Reduce query concurrency
- Decrease cache sizes
- Lower
max_memory_usage_to_ram_ratio - Add more RAM
Low Throughput
Diagnose:- Check CPU utilization
- Monitor disk I/O wait
- Verify network bandwidth
- Review query complexity
- Increase thread pool sizes
- Use faster storage
- Batch smaller queries
- Scale horizontally
Performance Best Practices
- Right-size memory allocation - 70-90% of available RAM
- Use fast storage - NVMe SSD for production
- Optimize thread pools - match CPU core count
- Monitor query performance - track p95/p99 latency
- Tune Kafka settings - balance latency vs. throughput
- Checkpoint on fast disks - reduce state overhead
- Use appropriate data types - smaller = faster
- Partition large tables - improve query pruning
- Limit query complexity - simpler queries perform better
- Scale horizontally - when vertical limits reached
Next Steps
- Set up comprehensive Monitoring
- Review Configuration settings
- Plan your Deployment architecture