πŸ› οΈTuning a Solana Node [ENG]

🎯 Finer tuning of a Solana validator

Steps:

  1. Choose optimal CPU Pick a modern AMD EPYC (e.g., 9275F) with high base clock and boost. Prioritize single-core perf for PoH. Reference: SolanaHCL Hardware Guidearrow-up-right

  2. Enable AMD P-State Scaling Driver

    • Use kernel 6.1+ (preferably 6.5 or higher for Zen4/5 support)

    • Recommended mode: amd_pstate=active instead of passive Add to /etc/default/grub:

      GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_pstate=active nohz_full=2,26 isolcpus=2,26 rcu_nocbs=2,26 irqaffinity=0-1,3-25,27-47 idle=poll mitigations=off nvme_core.default_ps_max_latency_us=0 pcie_aspm=off"

      Then:

      sudo update-grub && reboot
  3. Set CPU governor to performance

    sudo apt install -y cpufrequtils
    echo 'GOVERNOR="performance"' | sudo tee /etc/default/cpufrequtils
    sudo systemctl disable --now ondemand
    sudo systemctl enable --now cpufrequtils
  4. Apply kernel & sysctl tweaks See: Solana Tuning Guide - Sysctlarrow-up-right

  5. Disk layout

    • Format NVMes as:

      • XFS with noatime for ledger and snapshots

      • ext4 with noatime for accounts

    • Example:

      mkfs.xfs -f -m reflink=1 -L ledger -d su=512k,sw=1 /dev/nvmeXn1
      mkfs.ext4 -F -O ^has_journal -L accounts /dev/nvmeYn1
  6. Use multiple NVMes

    • Store ledger, snapshots, and accounts on three separate Gen4+ NVMe devices

    • Split accounts across 3+ paths using --accounts /mnt/a1,/mnt/a2,/mnt/a3

  7. Enable RamDisk for Index & Hash cache

    • Use --accounts-index-path /dev/shm/idx and --accounts-hash-cache-path /dev/shm/hash

    • Ensure /dev/shm is large enough (sysctl -w kernel.shmmax if needed)

  8. Enable unified scheduler for catch-up

    --block-verification-method unified-scheduler
  9. Optimize accounts hash threads

    --accounts-db-hash-threads 2

    If snapshots are disabled:

    --accounts-db-hash-threads 1
  10. Snapshot tuning for HA setup

    --snapshot-interval-slots 0
  11. Non-voting hot spare setup See Pumpkin Pool's blog post on high-availability validator setups.

  12. Disable Ubuntu 24.04's automatic restarts

    sudo systemctl disable systemd-reboot.service
    sudo systemctl mask systemd-reboot.service
  13. Check PCIe link speeds

    sudo nvme list
    sudo lspci -vv | grep -i width
  14. Pick a data center with excellent peering & low latency

  15. Use mods and tweaks at your own risk


πŸ”§ Core Isolation for PoH

Why:

Dedicated PoH thread = higher priority, lower latency, less jitter.

How:

  1. Know your topology

  2. Find core & hyperthread Example for core 2:

  3. Edit GRUB Example (core 2 + HT core 26):

    Then:

  4. Pin PoH thread Add to validator args:


🧠 solPohTickProd Affinity Script

Because of this bugarrow-up-right, core pinning doesn’t always work if cores are isolated. Use this workaround:

Script:

  • Wait until the ledger is loaded before executing.

  • You can call it manually or via cron, ExecStartPost, or systemd.timer.

Example logs:


πŸ“Š Benchmarking PoH performance

Check in logs:


πŸ§ͺ Other user scripts

Last updated