🚀YAML Configuration
Strategic configuration for performance optimization and system tuning
Overview
Tasker's execution configuration system provides fine-grained control over performance characteristics while maintaining carefully chosen architectural constants. This design separates configurable system tuning from Ruby-specific optimizations that should remain fixed.
🎯 CONFIGURATION PHILOSOPHY
✅ CONFIGURABLE SETTINGS
These affect performance characteristics and should vary by deployment environment:
Concurrency bounds - Different systems have different optimal ranges
Timeout configuration - Heavily dependent on workload characteristics
Cache duration - Varies based on system stability vs responsiveness needs
🏗️ ARCHITECTURAL CONSTANTS
These are carefully chosen based on Ruby/Rails characteristics and should NOT be configurable:
Future cleanup timing - Based on Ruby Concurrent::Future characteristics
GC trigger thresholds - Based on Ruby memory management patterns
Memory management constants - Based on Ruby GC timing characteristics
⚙️ CONFIGURATION REFERENCE
Basic Configuration
Environment-Specific Examples
Development Environment
Production Environment
High-Performance System
🔧 CONFIGURATION DETAILS
Concurrency Settings
min_concurrent_steps
Conservative lower bound
Ensures system stability under extreme load
max_concurrent_steps_limit
Upper bound for dynamic calculation
Should align with database connection pool size
concurrency_cache_duration
How long to cache concurrency calculations
Balance between responsiveness and performance
Dynamic Calculation: Tasker automatically calculates optimal concurrency between min and max based on:
System health metrics
Database connection pool utilization
Current workload patterns
Timeout Configuration
batch_timeout_base_seconds
Starting timeout
Base time before per-step adjustments
batch_timeout_per_step_seconds
Per-step addition
base + (steps * per_step)
max_batch_timeout_seconds
Absolute maximum
Prevents runaway timeouts
Example Calculations:
Architectural Constants
These values are NOT configurable and are based on Ruby characteristics:
future_cleanup_wait_seconds
1 second
Optimal for Ruby Concurrent::Future cleanup
gc_trigger_batch_size_threshold
6 operations
Ruby memory pressure detection point
gc_trigger_duration_threshold
30 seconds
Ruby GC timing characteristics
📊 PERFORMANCE TUNING GUIDE
Identifying Optimal Settings
Start with defaults for initial deployment
Monitor system metrics:
Database connection pool utilization
Step execution times
Memory usage patterns
Error rates
Adjust based on patterns:
High connection pressure → Reduce
max_concurrent_steps_limitFrequent timeouts → Increase timeout settings
Slow response to load changes → Reduce
concurrency_cache_duration
Common Tuning Scenarios
API-Heavy Workflows
Database-Intensive Workflows
Mixed Workload System
🔍 VALIDATION & MONITORING
Configuration Validation
Tasker automatically validates configuration on startup:
Runtime Monitoring
Monitor these metrics to optimize configuration:
Structured Logging Integration
Tasker logs configuration-related decisions:
🚨 BEST PRACTICES
✅ DO
Start with defaults and measure before optimizing
Test configuration changes in staging before production
Monitor system metrics after configuration changes
Use environment-specific settings for development vs production
Validate configuration during deployment
❌ DON'T
Set extreme values without understanding implications
Ignore validation errors - they prevent runtime issues
Use same settings everywhere - environments have different needs
Change multiple settings simultaneously - makes troubleshooting difficult
Set
minhigher thanmax- validation will catch this but avoid it
⚠️ CAUTION
Database connection exhaustion: Ensure
max_concurrent_steps_limitrespects your connection poolMemory pressure: Very high concurrency can cause memory issues
Timeout cascades: Very short timeouts can cause cascading failures
Cache duration: Very short cache duration increases CPU overhead
🔧 TROUBLESHOOTING
Common Issues
"Connection pool exhausted" errors
Frequent timeout errors
Slow response to load changes
High CPU from concurrency calculation
Validation Errors
"min_concurrent_steps must be positive"
Zero or negative minimum
Set to positive value (≥1)
"min cannot exceed max"
Invalid bounds
Ensure min < max
"max_batch_timeout_seconds must be greater than base"
Invalid timeout relationship
Ensure max > base
📈 PERFORMANCE IMPACT
Expected Improvements
With proper configuration tuning:
200-300% throughput increase through optimal concurrency
40% reduction in timeout-related failures through proper timeout settings
30% faster response to load changes through optimal cache duration
Reduced database connection pressure through intelligent concurrency limiting
Monitoring Success
Track these metrics to validate configuration effectiveness:
Conclusion
Tasker's execution configuration system provides powerful tuning capabilities while maintaining architectural integrity. By separating configurable performance characteristics from Ruby-specific optimizations, developers can optimize for their specific deployment environment while benefiting from carefully chosen defaults.
Effective configuration requires measurement-driven optimization: start with defaults, monitor system behavior, and adjust based on observed patterns rather than assumptions.
For additional support or advanced configuration scenarios, refer to the main Tasker documentation or reach out to the development team.
Last updated