Files
linux_system_tuning/PROXMOX_COMPATIBILITY.md
mindesbunister 8683739f21 Integrate Proxmox host optimization into one-button optimizer
Major changes:
- Added Proxmox detection with interactive mode selection
- Mode 1: Proxmox Host (hypervisor-optimized)
  - Different kernel parameters (swappiness=10, BBR, FQ)
  - Minimal tmpfs (2GB APT cache only)
  - No zram (VMs need direct RAM)
  - No desktop app configuration
- Mode 2: Desktop (original behavior with warnings)
- Mode 3: Abort (recommends running in VMs)

Technical implementation:
- check_proxmox() now offers mode selection
- analyze_and_prompt() branches on PROXMOX_MODE
- tune_kernel() handles both desktop and proxmox profiles
- setup_tmpfs() handles minimal proxmox tmpfs
- Updated PROXMOX_COMPATIBILITY.md with new behavior

Result: One unified script for both desktop and Proxmox use cases
2025-10-06 10:51:40 +02:00

6.5 KiB
Raw Blame History

Proxmox Host Compatibility Analysis

NEW: Integrated Proxmox Support!

The one-button optimizer now automatically detects Proxmox hosts and offers two modes:

sudo ./one-button-optimizer.sh

When run on Proxmox host, you'll see:

⚠️  Proxmox VE host detected!

<0A>  System: Proxmox VE (5 VMs, 2 containers)

This tool has TWO modes:

  1⃣  Proxmox Host Mode (Hypervisor Optimization)
     • Optimized kernel params for VM workloads
     • Minimal RAM allocation (2GB for APT cache only)
     • CPU performance governor
     • Network optimization (BBR, FQ)
     • 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]:

🎯 Proxmox Host Mode Optimizations

When you select Mode 1 (Proxmox Host Mode), you get:

1. Kernel Parameters

vm.swappiness = 10              # Allow some swap (not aggressive like desktop)
vm.dirty_ratio = 10             # Handle VM write bursts
vm.dirty_background_ratio = 5    # Start background writes earlier
vm.vfs_cache_pressure = 50      # Balance inode/dentry cache
vm.min_free_kbytes = 67584      # Keep minimum free RAM

# Networking (optimized for VM/CT traffic)
net.core.default_qdisc = fq                    # Fair Queue
net.ipv4.tcp_congestion_control = bbr          # Better bandwidth
net.core.netdev_max_backlog = 5000
net.ipv4.tcp_max_syn_backlog = 8192

2. Minimal tmpfs (Optional)

  • Only 2GB for APT package cache
  • Minimal RAM impact
  • Speeds up apt upgrade operations

3. No zram

  • Skipped entirely in Proxmox mode
  • VMs need direct RAM access

4. No Desktop Apps

  • Skips browser/IDE configuration
  • Focus on hypervisor performance

What's NOT Safe (Still Applies if You Choose Mode 2)

If you mistakenly choose Desktop Mode on Proxmox host:

1. zram Configuration

  • Issue: Creates compressed swap in RAM
  • Impact on Proxmox:
    • Reduces available RAM for VMs/containers
    • Can cause memory pressure affecting VM performance
    • Proxmox already manages memory efficiently for VMs
  • Risk Level: 🔴 HIGH - Can destabilize VMs

2. tmpfs Mounts

  • Issue: Creates multiple tmpfs filesystems (browser, IDE, packages)
  • Impact on Proxmox:
    • Allocates significant RAM (up to 40% by default)
    • RAM allocated to tmpfs cannot be used by VMs
    • Desktop-oriented paths may not exist on server
  • Risk Level: 🟡 MEDIUM - Reduces VM memory

3. Kernel Parameters (vm.swappiness, vm.dirty_ratio)

  • Issue: Tunes for desktop workload
  • Impact on Proxmox:
    • vm.swappiness=1: Too aggressive for hypervisor
    • vm.dirty_ratio=3: May cause I/O issues under VM load
    • Proxmox has its own memory management for KVM
  • Risk Level: 🟡 MEDIUM - Suboptimal for VMs

4. Desktop Application Configuration

  • Issue: Configures Firefox, Brave, Chromium, IDEs
  • Impact on Proxmox:
    • Not applicable (no GUI applications on host)
    • Harmless but useless
  • Risk Level: 🟢 LOW - Just unnecessary

What's Safe to Use

Monitoring/Analysis Tools (Read-Only)

These scripts are safe to run on Proxmox as they only read information:

./quick-status-check.sh    # System overview (safe)
./tmpfs-info.sh             # tmpfs information (safe)
./benchmark-tmpfs.sh        # Performance tests (safe)
./benchmark-realistic.sh    # Cache simulation (safe)

Option 1: Use Inside VMs Only

  • Run the optimizer inside your desktop VMs, not on the host
  • Perfect for workstation VMs running KDE/GNOME
  • Won't affect Proxmox host or other VMs

Option 2: Custom Proxmox Tuning (Advanced)

If you want to optimize the Proxmox host, use Proxmox-specific tuning:

# Proxmox-recommended settings
cat >> /etc/sysctl.conf << 'EOF'
# Proxmox VM host optimization
vm.swappiness = 10          # Not 1 (allow some swap for cache)
vm.dirty_ratio = 10         # Not 3 (handle VM write bursts)
vm.dirty_background_ratio = 5
vm.vfs_cache_pressure = 50
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
EOF

sysctl -p

🛡️ Safety Checklist

Before running on Proxmox host, answer these:

  • Do I understand this removes RAM from VM allocation?
  • Are my VMs okay with reduced available memory?
  • Do I have a backup/snapshot of the host?
  • Can I access the host console if SSH breaks?
  • Do I know how to revert kernel parameter changes?

If you answered NO to any: DON'T RUN IT on the Proxmox host.


🔧 Creating a Proxmox-Safe Version

If you really want to run optimizations on Proxmox host, here's what needs modification:

Changes Required:

  1. Disable zram (keep for VMs only)

    • Remove zram setup entirely
    • Proxmox manages memory differently
  2. Reduce tmpfs allocation

    • Instead of 40% of RAM, use max 5-10%
    • Only for logs/temporary package cache
  3. Adjust kernel parameters

    • vm.swappiness = 10 (not 1)
    • vm.dirty_ratio = 10 (not 3)
    • Add VM-specific tuning
  4. Skip desktop applications

    • No browser/IDE configuration
    • Focus on APT cache, logs

📋 Summary

Component Desktop VM Proxmox Host
zram Recommended Don't use
tmpfs (40%) Great Too much
tmpfs (5-10%) ⚠️ Optional Acceptable
Desktop apps Perfect N/A
Kernel params Optimized ⚠️ Wrong values
Monitoring Use anytime Use anytime

🎯 Final Recommendation

For Proxmox Users:

  1. Run optimizer INSIDE your desktop VMs - fully safe and beneficial
  2. Don't run on Proxmox host - wrong optimizations for hypervisor
  3. Use Proxmox-specific tuning - if you need host optimization
  4. Monitor tools are safe - run anytime to check system status

Need help? Create a Proxmox-specific profile or use inside VMs only.


🚀 Quick Test (Safe)

Want to see what would happen without making changes?

# This is safe - just shows what it would do
sudo ./one-button-optimizer.sh

# When prompted, answer 'N' to all changes
# You'll see the analysis without modifications

Then decide if you want to:

  • Use inside VMs (recommended)
  • Create custom Proxmox version
  • Skip host optimization entirely