Skip to main content

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)

    Setting: Advanced > AMD CBS > CPU Common > Power Supply Idle Control = "Typical Current Idle" Benefit: Prevents the Ryzen "Sleep of Death" where the PSU cuts power efficiency.during deep C-state transitions. Essential for 24/7 server stability on X570 boards.

    Processor C-State Limit (Kernel)

      Driver: 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)

        Settings: PPT: 88, TDC: 60, EDC: 90 Benefit: Drastically reduces thermals (peak temps dropped from ~90°C to 58°C) without significant impact on multi-core performance. Ideal for 4U rackmount chassis airflow. Configuration: UEFI > Precision Boost Overdrive > Manual.

        ⚡ 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.
        Configuration: Added to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.

        IRQ Balancing

        • Service: irqbalance (Installed/Enabled)
        • Benefit: Distributes hardware interrupts (HBA, NVMe, NIC) across all 32threads, threads. Preventspreventing Core 0 from becoming a bottleneck during high I/O tasks.bottlenecks.

        🧠 Memory Tuning

        Speed & Stability

          Configuration: Currently hard-coded to 2133MHz at AUTO voltage. Note: Troubleshooting in Feb 2026 confirmed that 3000MHz at 1.35V caused instantaneous reboots. Stability requires sticking to JEDEC defaults for now.

          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) and Postgres/AI services.
          Configuration: Added to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.

          Kernel Memory Guard

            Setting: init_on_alloc=0 Benefit: Disables the sanitization (zeroing) of memory pages at allocation time, reducing CPU overhead for high-frequency memory operations.Postgres.

            💾 I/O & Network Tuning (sysctl)

            ZFS Write Buffering

            • Configuration: /etc/sysctl.d/50-dirtybytes.conf
            Settings: vm.dirty_background_bytes = 268435456, vm.dirty_bytes = 1073741824 (256MB / 1GB) Benefit: Prevents the kernel from buffering massivetoo amounts of "dirty"much data in the 128GB RAM before flushing to HDDs,ZFS, which eliminateseliminating system-wide stutterUI/process during large I/O tasks.stutter.

            RedisFluent-bit OvercommitBatching (ClickHouse)

            • Setting: vm.overcommit_memoryFlush =60 1in fluent-bit.conf
            • Benefit: NecessaryReduced forClickHouse Redis/ValkeyCPU backgroundusage snapshots.from Allows80% the kernelspikes to grant<5% memoryby forkreducing requeststransaction even if it exceeds current estimated availability.

            HTTP/3 & QUIC Buffers (Caddy)

              Configuration: /etc/sysctl.d/99-caddy.conf Settings: net.core.rmem_max = 7500000, net.core.wmem_max = 7500000 (7.5MB) Benefit: Increases UDP receive/send window sizes, preventing packet dropfrequency and improvingoptimizing performanceZFS forwrite modern HTTP/3 and QUIC connections through Caddy.contiguousness.

              🎮 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 the 1-2 2-second initialization delay whenfor aAI containerinference (Immich, OpenWebUI) calls the GPU forand transcoding or inference.containers.

              🛡️ Future Considerations

                PBO (Precision Boost Overdrive): To be verified in UEFI/BIOS for improved multi-core boosting.