- Fixed 104 broken references in 59 files - Consolidated 40+ duplicate status files - Archived duplicates to reports/archive/duplicates/ - Created scripts for reference fixing and consolidation - Updated content inconsistency reports All optional cleanup tasks complete.
6.0 KiB
Performance Tuning Guide
Last Updated: 2025-01-20
Document Version: 1.0
Status: Active Documentation
Overview
This guide provides performance tuning recommendations for Proxmox infrastructure, including host optimization, VM/container optimization, storage optimization, and network optimization.
Host Performance Tuning
CPU Optimization
Settings:
-
CPU Governor:
# Set performance governor cpupower frequency-set -g performance # Make permanent echo 'GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_pstate=disable"' >> /etc/default/grub update-grub -
CPU Affinity:
- Pin critical VMs to specific CPU cores
- Isolate CPU cores for host operations
- Use CPU sets for resource allocation
Memory Optimization
Settings:
-
Transparent Huge Pages:
# Check current setting cat /sys/kernel/mm/transparent_hugepage/enabled # Set to always (for performance) echo always > /sys/kernel/mm/transparent_hugepage/enabled -
Swappiness:
# Reduce swappiness (default is 60) echo 10 > /proc/sys/vm/swappiness # Make permanent echo 'vm.swappiness=10' >> /etc/sysctl.conf -
Memory Overcommit:
# Allow memory overcommit (for Proxmox) echo 1 > /proc/sys/vm/overcommit_memory
Storage Optimization
ZFS Tuning:
-
ARC Size:
# Set ARC max size (adjust based on RAM) echo 'options zfs zfs_arc_max=4294967296' >> /etc/modprobe.d/zfs.conf -
ZFS Recordsize:
# Set recordsize for database workloads zfs set recordsize=16k <pool>/<dataset> -
ZFS Compression:
# Enable compression (lz4 recommended) zfs set compression=lz4 <pool>/<dataset>
LVM Tuning:
- I/O Scheduler:
# Set to deadline or noop for SSDs echo deadline > /sys/block/sda/queue/scheduler
VM/Container Performance
VM Optimization
CPU Settings:
-
CPU Type:
- Use
hostCPU type for best performance - Or use specific CPU model matching host
- Use
-
CPU Cores:
- Allocate appropriate number of cores
- Avoid over-allocation
- Consider CPU pinning for critical VMs
Memory Settings:
-
Memory Allocation:
- Allocate sufficient memory
- Use ballooning for dynamic allocation
- Monitor memory usage
-
Memory Ballooning:
# Enable ballooning in VM config balloon: 1024
Storage Settings:
-
Disk Cache:
- Use
writebackcache for better performance - Use
nonefor critical data integrity
- Use
-
Disk I/O:
- Set appropriate I/O limits
- Use SSD storage for high I/O workloads
- Consider separate storage pools
Container Optimization
Resource Limits:
-
CPU Limits:
# Set CPU limit in container config lxc.cgroup.cpuset.cpus = "0-3" -
Memory Limits:
# Set memory limit lxc.cgroup.memory.limit_in_bytes = 2147483648 -
I/O Limits:
# Set I/O limits lxc.cgroup.blkio.weight = 500
Network Performance
Network Optimization
Settings:
-
Network Interface:
- Use virtio network drivers
- Enable SR-IOV if available
- Tune network buffer sizes
-
Bridge Optimization:
# Increase bridge forward delay echo 0 > /sys/class/net/vmbr0/bridge/forward_delay -
TCP Tuning:
# Increase TCP buffer sizes echo 'net.core.rmem_max = 16777216' >> /etc/sysctl.conf echo 'net.core.wmem_max = 16777216' >> /etc/sysctl.conf sysctl -p
Monitoring Performance
Key Metrics
-
CPU:
- CPU utilization
- CPU wait time
- CPU steal time
-
Memory:
- Memory usage
- Swap usage
- Memory pressure
-
Storage:
- I/O wait
- Disk utilization
- I/O throughput
-
Network:
- Network throughput
- Packet loss
- Latency
Monitoring Tools
-
Proxmox Built-in:
- Resource usage graphs
- Performance metrics
- Historical data
-
External Tools:
- Prometheus + Grafana
- Zabbix
- Custom monitoring scripts
Performance Benchmarks
Baseline Measurements
Before Optimization:
- Document current performance
- Identify bottlenecks
- Set performance targets
After Optimization:
- Measure improvements
- Document results
- Adjust as needed
Benchmark Tools
-
CPU:
# CPU benchmark sysbench cpu --cpu-max-prime=20000 run -
Memory:
# Memory benchmark sysbench memory --memory-total-size=10G run -
Disk:
# Disk I/O benchmark fio --name=test --ioengine=libaio --iodepth=16 --rw=read --bs=4k --size=1G
Troubleshooting Performance Issues
Common Issues
-
High CPU Usage:
- Check for runaway processes
- Review CPU allocation
- Consider CPU pinning
-
High Memory Usage:
- Check for memory leaks
- Review memory allocation
- Enable ballooning
-
High I/O Wait:
- Check disk I/O
- Review storage configuration
- Consider SSD storage
-
Network Latency:
- Check network configuration
- Review network drivers
- Tune network settings
Best Practices
-
Regular Monitoring:
- Monitor performance metrics
- Identify trends
- Proactive optimization
-
Baseline Measurements:
- Document baseline performance
- Track changes over time
- Set performance targets
-
Gradual Optimization:
- Make one change at a time
- Measure impact
- Document results
-
Resource Planning:
- Plan for growth
- Monitor resource usage
- Scale proactively
Related Documentation
- MONITORING_SUMMARY.md - Monitoring setup
- TROUBLESHOOTING_FAQ.md - Troubleshooting
- RECOMMENDATIONS_AND_SUGGESTIONS.md - Best practices
Last Updated: 2025-01-20
Review Cycle: Quarterly