Performance & Stability Optimizations
Performance & Stability Optimizations
This page documents the specific kernel and hardware tweaks applied to Terra (Ryzen 5950X / Ubuntu 24.04) to optimize for container performance, storage throughput, and long-term stability.
🛡️ Stability & Power Management (The "Golden Config")
Typical Current Idle (UEFI)
Processor C-State Limit (Kernel)
processor.max_cstate=1
Benefit: Software-side enforcement of the Idle fix. Limits the CPU to C1 (Halt/Idle) instead of deeper sleep states (C6), preventing interrupt processing delays and hardware hangs.
Configuration: Added to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.
65W Eco Mode (Manual PBO)
⚡ CPU & Power ManagementPerformance
AMD P-State (Active Mode)
- Driver:
amd_pstate=active(EPP - Energy Performance Preference) - Benefit: Allows the kernel to communicate directly with the Zen 3 power management controller. Enables a wider frequency range (550MHz - 5000MHz)
and more granular boost control.
GRUB_CMDLINE_LINUX_DEFAULT/etc/default/grub.
IRQ Balancing
- Service:
irqbalance(Installed/Enabled) - Benefit: Distributes hardware interrupts (HBA, NVMe, NIC) across all
32threads,threads. Preventspreventing Core 0from becoming a bottleneck during high I/O tasks.bottlenecks.
🧠 Memory Tuning
Speed & Stability
Static Hugepages
- Setting:
hugepages=2048(Reserving 4GB total as 2MB pages) - Benefit: Reduces TLB
(Translation Lookaside Buffer)misses for memory-heavy apps like Minecraft(Java)andPostgres/AI services.
GRUB_CMDLINE_LINUX_DEFAULT/etc/default/grubKernel Memory Guard
init_on_alloc=0💾 I/O & Network Tuning (sysctl)
ZFS Write Buffering
Configuration:/etc/sysctl.d/50-dirtybytes.conf
vm.dirty_background_bytes = 268435456, vm.dirty_bytes = 1073741824RedisFluent-bit OvercommitBatching (ClickHouse)
- Setting:
vm.overcommit_memoryFlush=601influent-bit.conf - Benefit:
NecessaryReducedforClickHouseRedis/ValkeyCPUbackgroundusagesnapshots.fromAllows80%the kernelspikes togrant<5%memorybyforkreducingrequeststransactioneven if it exceeds current estimated availability.
HTTP/3 & QUIC Buffers (Caddy)
/etc/sysctl.d/99-caddy.confnet.core.rmem_max = 7500000net.core.wmem_max = 7500000🎮 GPU Optimization (Quadro P2200)
Persistence Mode
- Command:
sudo nvidia-smi -pm 1 - Benefit:
Keeps the Nvidia driver loaded in memory regardless of active load.Eliminates the1-22-second initialization delaywhenforaAIcontainerinference(Immich, OpenWebUI) calls the GPU forand transcodingor inference.containers.