Files
linux_system_tuning/PROXMOX_ANALYSIS_EXAMPLE.md
2025-10-06 11:12:33 +02:00

6.7 KiB
Raw Permalink Blame History

Proxmox Host Analysis Example

What You'll See When Running on Proxmox

When you run sudo ./one-button-optimizer.sh on a Proxmox host, you'll now see a comprehensive analysis before making any changes:

⚠️  Proxmox VE host detected!

🔍 Proxmox Host Analysis
========================

📊 System Information:
  💾 RAM: 64GB (Used: 18GB, Available: 42GB)
  🖥️  CPU: 16 cores
  📦 Proxmox: pve-manager/8.0.4/8d2b43c4 (running kernel: 6.2.16-3-pve)

🖥️  Workload:
  🖼️  VMs: 5 total (3 running)
  📦 Containers: 2 total (2 running)
  📊 Total VM memory allocated: 48GB
  📈 Memory overcommit: 75.0%

💾 Storage:
  • local (dir): 145GB/450GB used
  • local-lvm (lvmthin): 892GB/1800GB used
  • backup (dir): 234GB/2000GB used

⚙️  Current Kernel Parameters:
  📊 Memory:
     vm.swappiness: 60 (Proxmox recommended: 10)
     vm.dirty_ratio: 20 (Proxmox recommended: 10)
     vm.dirty_background_ratio: 10 (Proxmox recommended: 5)
     vm.vfs_cache_pressure: 100 (Proxmox recommended: 50)

  📡 Network:
     net.core.default_qdisc: pfifo_fast (Proxmox recommended: fq)
     net.ipv4.tcp_congestion_control: cubic (Proxmox recommended: bbr)

🖥️  CPU Governor: ondemand (Recommended: performance)

🗄️  ZFS Configuration:
  📊 Current ARC max: 32GB
  💡 Recommended: 16GB (25% of RAM, leaves more for VMs)

🔍 Existing Optimizations:
  ❌ No custom sysctl configuration
  ✅ No tmpfs cache mounts (good for Proxmox)
  ✅ No zram (good for Proxmox)

📋 Assessment:
  ⚠️  Kernel parameters not optimized for hypervisor workload
  ⚠️  CPU governor not set to 'performance'
  ⚠️  ZFS ARC could be limited to give VMs more RAM

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This tool has TWO modes:

  1⃣  Proxmox Host Mode (Hypervisor Optimization)
     • Optimized kernel params for VM workloads
     • Minimal RAM allocation (2GB APT cache only)
     • CPU performance governor
     • ZFS ARC limiting (if applicable)
     • No desktop app configuration

  2⃣  Desktop Mode (NOT recommended for host)
     • Heavy RAM usage (zram + tmpfs = 40-50%)
     • Desktop-focused optimizations
     • Will reduce memory available for VMs

  3⃣  Abort (Recommended: Run inside your desktop VMs)

Choose mode (1=Proxmox/2=Desktop/3=Abort) [1]:

What Each Section Tells You

📊 System Information

  • RAM Usage: Shows how much RAM is used vs available
  • CPU Cores: Total cores available for VMs
  • Proxmox Version: Your current PVE version and kernel

🖥️ Workload

  • VM/CT Count: Total and running instances
  • Memory Allocation: Total RAM allocated to all VMs
  • Overcommit Ratio: % of RAM you've allocated to VMs
    • <100%: Conservative (VMs won't use all their allocation)
    • 100-150%: Normal (ballooning will handle it)
    • 150%: Aggressive (monitor for memory pressure)

💾 Storage

  • Shows all storage backends
  • Current usage per storage
  • Helps identify if you need more space

⚙️ Kernel Parameters

Compares current vs recommended for Proxmox:

Parameter Default Current Proxmox Optimal
vm.swappiness 60 ? 10
vm.dirty_ratio 20 ? 10
vm.dirty_background_ratio 10 ? 5
vm.vfs_cache_pressure 100 ? 50
qdisc pfifo_fast ? fq
tcp_congestion cubic ? bbr

🖥️ CPU Governor

  • ondemand/powersave: CPU scales down when idle (saves power, adds latency)
  • performance: CPU always at max speed (better for VMs, ~2-5W more power)

🗄️ ZFS Configuration

  • Shows current ARC (cache) size
  • Recommends 25% of RAM (leaves 75% for VMs)
  • Example: 64GB RAM → 16GB ARC, 48GB for VMs

🔍 Existing Optimizations

Detects if you've already optimized:

  • Good: No zram, no excessive tmpfs
  • ⚠️ Warning: Desktop optimizations found (uses VM RAM)

📋 Assessment

Quick summary of what needs attention:

  • Already optimal
  • ⚠️ Needs optimization

What Gets Optimized

When you choose Mode 1 (Proxmox Host):

1. Kernel Parameters

# Before
vm.swappiness = 60
vm.dirty_ratio = 20
net.core.default_qdisc = pfifo_fast
net.ipv4.tcp_congestion_control = cubic

# After
vm.swappiness = 10              ✅ Balanced for VMs
vm.dirty_ratio = 10             ✅ Handles VM writes
net.core.default_qdisc = fq     ✅ Fair queue
net.ipv4.tcp_congestion_control = bbr  ✅ Better throughput

2. CPU Governor

# Before
ondemand (scales with load)

# After  
performance (always full speed)

3. ZFS ARC (if ZFS present)

# Before
32GB (50% of RAM)

# After
16GB (25% of RAM)
# Frees 16GB for VMs!

4. Optional: APT Cache (2GB tmpfs)

# Minimal RAM impact
# Faster package updates

Example: Before vs After

Before Optimization:

RAM: 64GB total
  ├─ Used by host: 18GB
  ├─ ZFS ARC: 32GB (wasted for hypervisor)
  └─ Available for VMs: 14GB (only 22%!)

CPU: Scaling down when idle (latency spikes)
Network: Default cubic (suboptimal for VM traffic)
Kernel: Desktop-optimized values

After Optimization:

RAM: 64GB total
  ├─ Used by host: 10GB (optimized)
  ├─ ZFS ARC: 16GB (limited, still effective)
  └─ Available for VMs: 38GB (59%!)

CPU: Always at full speed (predictable performance)
Network: BBR congestion control (10-30% faster)
Kernel: Hypervisor-optimized values

Result: ~24GB more RAM for VMs! 🚀


When Analysis Shows "Already Optimized"

If you see:

📋 Assessment:
  ✅ System is already well-optimized for Proxmox!

The script will still run but make minimal changes. Safe to run anytime!


Use Cases

Fresh Proxmox Install

  • Shows default values (usually suboptimal)
  • Recommends all optimizations
  • Big performance gain expected

Previously Optimized

  • Shows current settings
  • Confirms they're good
  • Maybe updates to newer recommendations

Mixed/Desktop Mode

  • Detects if you ran desktop optimizations before
  • Warns about zram/tmpfs using VM RAM
  • Can clean up or reconfigure

Safety

The analysis is read-only - it just shows information. No changes until you:

  1. Choose Mode 1 (Proxmox)
  2. Confirm each optimization

You can abort at any time!


Summary

The new Proxmox analysis gives you:

Complete system overview before making changes Current vs recommended parameter comparison
VM workload context (memory allocation, count) Storage status at a glance Existing optimization detection Clear assessment of what needs work

Result: You know exactly what will be optimized and why! 📊