deb-bootc-compose/configs/performance.yaml
2025-08-18 23:32:51 -07:00

400 lines
9.2 KiB
YAML

# Performance Configuration for deb-bootc-compose
# This file demonstrates comprehensive performance optimization and scaling features
performance:
enabled: true
# Performance Profiling Configuration
profiling:
enabled: true
interval: "30s"
max_history: 1000
metrics:
- "cpu_usage"
- "memory_usage"
- "disk_usage"
- "network_io"
- "goroutine_count"
- "heap_alloc"
- "compose_duration"
- "phase_duration"
- "variant_processing_time"
exporters:
- "prometheus"
- "influxdb"
- "elasticsearch"
custom:
alert_thresholds:
cpu_usage: 90.0
memory_usage: 85.0
disk_usage: 80.0
goroutine_count: 10000
# Horizontal Scaling Configuration
scaling:
enabled: true
strategy: "adaptive" # round_robin, least_connections, weighted_round_robin, random, least_response_time, ip_hash, adaptive
# Node Management
nodes:
- id: "node-1"
hostname: "compose-node-1.debian.org"
address: "192.168.1.10"
port: 8080
tags:
priority: "high"
environment: "production"
region: "eu-west"
capabilities:
architecture: ["amd64", "arm64"]
max_jobs: 10
features: ["ostree", "container", "disk_image"]
- id: "node-2"
hostname: "compose-node-2.debian.org"
address: "192.168.1.11"
port: 8080
tags:
priority: "medium"
environment: "production"
region: "eu-west"
capabilities:
architecture: ["amd64"]
max_jobs: 8
features: ["ostree", "container"]
- id: "node-3"
hostname: "compose-node-3.debian.org"
address: "192.168.1.12"
port: 8080
tags:
priority: "low"
environment: "staging"
region: "eu-west"
capabilities:
architecture: ["amd64"]
max_jobs: 5
features: ["ostree"]
# Auto-scaling Configuration
autoscaling:
enabled: true
min_nodes: 2
max_nodes: 10
scale_up_threshold: 80.0 # Scale up when utilization > 80%
scale_down_threshold: 20.0 # Scale down when utilization < 20%
scale_up_cooldown: "5m" # Wait 5 minutes before scaling up again
scale_down_cooldown: "10m" # Wait 10 minutes before scaling down again
check_interval: "30s" # Check scaling every 30 seconds
# Scaling policies
policies:
- name: "cpu_based_scaling"
trigger: "cpu_usage > 85% for 2 minutes"
action: "add_node"
cooldown: "5m"
- name: "memory_based_scaling"
trigger: "memory_usage > 90% for 1 minute"
action: "add_node"
cooldown: "3m"
- name: "queue_based_scaling"
trigger: "pending_jobs > 50"
action: "add_node"
cooldown: "2m"
# Load Balancing Configuration
load_balancing:
enabled: true
health_check_interval: "10s"
health_check_timeout: "5s"
max_failures: 3
failover_timeout: "30s"
# Health check configuration
health_checks:
- path: "/health"
method: "GET"
expected_status: 200
timeout: "5s"
- path: "/metrics"
method: "GET"
expected_status: 200
timeout: "10s"
# Sticky sessions (for stateful operations)
sticky_sessions:
enabled: true
duration: "1h"
cookie_name: "compose_session"
# Circuit breaker configuration
circuit_breaker:
enabled: true
failure_threshold: 5
recovery_timeout: "1m"
half_open_max_requests: 3
# Resource Management
resources:
# Memory management
memory:
max_heap_size: "4GB"
gc_target_percentage: 100
gc_trigger_percentage: 200
memory_profiling: true
# CPU management
cpu:
max_goroutines: 10000
worker_pool_size: 100
cpu_profiling: true
# Disk management
disk:
max_disk_usage: "80%"
cleanup_interval: "1h"
temp_file_ttl: "24h"
compression_enabled: true
# Network management
network:
connection_pool_size: 100
keep_alive_timeout: "30s"
max_idle_connections: 10
idle_connection_timeout: "90s"
# Caching Configuration
caching:
enabled: true
# In-memory cache
memory:
max_size: "1GB"
ttl: "1h"
cleanup_interval: "10m"
# Redis cache (if available)
redis:
enabled: false
address: "localhost:6379"
password: ""
db: 0
pool_size: 10
ttl: "24h"
# File-based cache
file:
enabled: true
directory: "/var/cache/deb-bootc-compose"
max_size: "10GB"
cleanup_interval: "1h"
# Cache policies
policies:
- pattern: "compose:metadata:*"
ttl: "24h"
strategy: "lru"
- pattern: "variant:config:*"
ttl: "1h"
strategy: "lru"
- pattern: "phase:result:*"
ttl: "30m"
strategy: "fifo"
# Performance Tuning
tuning:
# Go runtime tuning
go_runtime:
gomaxprocs: 0 # Use all available CPUs
gc_percent: 100
memory_limit: "4GB"
# HTTP server tuning
http_server:
read_timeout: "30s"
write_timeout: "30s"
idle_timeout: "120s"
max_header_bytes: 1048576
max_connections: 1000
# Database tuning (if applicable)
database:
max_open_connections: 100
max_idle_connections: 25
connection_max_lifetime: "5m"
connection_max_idle_time: "1m"
# File I/O tuning
file_io:
buffer_size: "64KB"
async_io: true
prefetch_size: "1MB"
# Monitoring and Observability
monitoring:
enabled: true
# Metrics collection
metrics:
collection_interval: "15s"
retention_period: "30d"
aggregation_intervals:
- "1m"
- "5m"
- "15m"
- "1h"
- "1d"
# Health checks
health_checks:
enabled: true
interval: "30s"
timeout: "10s"
endpoints:
- "/health"
- "/ready"
- "/live"
# Performance dashboards
dashboards:
enabled: true
refresh_interval: "30s"
panels:
- "system_metrics"
- "compose_performance"
- "scaling_metrics"
- "resource_utilization"
# Optimization Strategies
optimization:
# Compose optimization
compose:
parallel_phases: true
max_parallel_phases: 4
phase_timeout: "30m"
resource_pooling: true
incremental_builds: true
# Variant optimization
variant:
parallel_processing: true
max_parallel_variants: 8
shared_dependencies: true
incremental_updates: true
# Build optimization
build:
parallel_builds: true
max_parallel_builds: 6
build_caching: true
dependency_caching: true
incremental_compilation: true
# Example performance scenarios
scenarios:
# High-throughput scenario
high_throughput:
description: "Optimized for maximum compose throughput"
settings:
scaling:
max_nodes: 20
scale_up_threshold: 70.0
resources:
memory:
max_heap_size: "8GB"
cpu:
max_goroutines: 20000
worker_pool_size: 200
optimization:
compose:
max_parallel_phases: 8
variant:
max_parallel_variants: 16
build:
max_parallel_builds: 12
# Low-latency scenario
low_latency:
description: "Optimized for minimum response time"
settings:
scaling:
max_nodes: 5
scale_up_threshold: 60.0
resources:
memory:
max_heap_size: "2GB"
cpu:
max_goroutines: 5000
worker_pool_size: 50
optimization:
compose:
max_parallel_phases: 2
variant:
max_parallel_variants: 4
build:
max_parallel_builds: 3
# Resource-efficient scenario
resource_efficient:
description: "Optimized for minimal resource usage"
settings:
scaling:
max_nodes: 3
scale_up_threshold: 90.0
resources:
memory:
max_heap_size: "1GB"
cpu:
max_goroutines: 2000
worker_pool_size: 20
optimization:
compose:
max_parallel_phases: 1
variant:
max_parallel_variants: 2
build:
max_parallel_builds: 1
# Performance testing configuration
testing:
enabled: true
# Load testing
load_testing:
enabled: true
scenarios:
- name: "normal_load"
concurrent_users: 10
duration: "5m"
ramp_up_time: "1m"
- name: "peak_load"
concurrent_users: 50
duration: "10m"
ramp_up_time: "2m"
- name: "stress_test"
concurrent_users: 100
duration: "15m"
ramp_up_time: "5m"
# Performance benchmarks
benchmarks:
enabled: true
metrics:
- "compose_duration"
- "memory_usage"
- "cpu_usage"
- "throughput"
- "latency"
thresholds:
compose_duration: "5m"
memory_usage: "2GB"
cpu_usage: "80%"
throughput: "10_composes_per_minute"
latency: "30s"