Skip to content

Latest commit

 

History

History
178 lines (132 loc) · 3.97 KB

File metadata and controls

178 lines (132 loc) · 3.97 KB

Quick Start Guide

Installation

# Build from source
cd proxmox-optimizer
go build -ldflags="-s -w" -o proxmox-optimizer

# Install system-wide
sudo cp proxmox-optimizer /usr/local/bin/
sudo chmod +x /usr/local/bin/proxmox-optimizer

Common Commands

# Show system information
sudo proxmox-optimizer -info

# Generate sample configuration (conservative)
proxmox-optimizer -generate-config

# Generate aggressive configuration
proxmox-optimizer -generate-config -aggressive

# Dry-run to see what would be changed
sudo proxmox-optimizer -dry-run

# Apply all optimizations (creates automatic backup)
sudo proxmox-optimizer

# Apply specific optimizations
sudo proxmox-optimizer -optimize memory
sudo proxmox-optimizer -optimize disk
sudo proxmox-optimizer -optimize network
sudo proxmox-optimizer -optimize proxmox

# Apply aggressive optimizations
sudo proxmox-optimizer -aggressive

# Use custom configuration
sudo proxmox-optimizer -config optimizer-config.json

# Restore from backup
sudo proxmox-optimizer -restore /var/backups/proxmox-optimizer/backup-YYYYMMDD-HHMMSS.tar.gz

Workflow

  1. Check system info: sudo proxmox-optimizer -info
  2. Test with dry-run: sudo proxmox-optimizer -dry-run
  3. Apply optimizations: sudo proxmox-optimizer
  4. Verify changes: Check /etc/sysctl.d/99-proxmox-optimizer.conf
  5. Reboot (optional but recommended for full effect)

What Gets Modified

Files Created/Modified

  • /etc/sysctl.d/99-proxmox-optimizer.conf - Kernel parameters
  • /etc/udev/rules.d/60-proxmox-optimizer-disk.rules - Disk I/O settings

System Services

  • qemu-guest-agent - Installed and enabled
  • rng-tools - Installed and enabled (if hardware RNG available)
  • systemd-timesyncd - Enabled for time sync

Backups

  • Automatic backups stored in /var/backups/proxmox-optimizer/
  • Named: backup-YYYYMMDD-HHMMSS.tar.gz

Safety Features

  • Automatic backup before changes
  • Dry-run mode to preview changes
  • Full rollback capability
  • Persistent settings across reboots

Rollback

If you experience issues:

# List available backups
ls -lh /var/backups/proxmox-optimizer/

# Restore from latest backup
LATEST=$(ls -t /var/backups/proxmox-optimizer/backup-*.tar.gz | head -1)
sudo proxmox-optimizer -restore "$LATEST"

# Reboot
sudo reboot

Configuration Profiles

Conservative (default)

  • Balanced settings for general use
  • vm.swappiness = 10
  • Standard TCP buffer sizes
  • Safe I/O schedulers

Aggressive (-aggressive flag)

  • Maximum performance settings
  • vm.swappiness = 1
  • BBR congestion control
  • Performance CPU governor
  • Larger buffer sizes
  • Cache dropping

Verification

# Check sysctl settings
sysctl vm.swappiness
sysctl net.ipv4.tcp_congestion_control
cat /etc/sysctl.d/99-proxmox-optimizer.conf

# Check disk settings
cat /sys/block/sda/queue/scheduler
cat /sys/block/sda/queue/read_ahead_kb

# Check services
systemctl status qemu-guest-agent
systemctl status rng-tools

# Check udev rules
cat /etc/udev/rules.d/60-proxmox-optimizer-disk.rules

Troubleshooting

Permission denied

Make sure you run with sudo:

sudo proxmox-optimizer -info

BBR not available

BBR requires kernel 4.9+ and the tcp_bbr module:

# Check if BBR is available
modprobe tcp_bbr
lsmod | grep bbr

# If not available, tool will fallback to cubic

Settings not persisting

Reload system settings:

sudo sysctl --system
sudo udevadm control --reload-rules
sudo udevadm trigger

Performance Testing

Test before and after:

# Network throughput (requires iperf3 server)
iperf3 -c server-ip

# Disk I/O (requires fio)
sudo fio --name=test --ioengine=libaio --iodepth=16 --rw=randrw --bs=4k --direct=1 --size=1G --numjobs=4 --runtime=60 --group_reporting

# System benchmark
sysbench cpu run
sysbench memory run

Support

For issues or questions, check:

  • README.md for detailed documentation
  • /var/log/syslog for system messages
  • Run with -dry-run to see what would be changed