Raja's Exocortex

Proxmox Best Practices

NTP Settings

Proxmox uses chrony for NTP sync from preconfigured public servers. If these servers cannot be reached due to network policy, configure chrony to use a local NTP server in the LAN (eg fireall, Active Directory server, etc).

Create the below file then run chronyc reload sources.

# Filename: /etc/chrony/sources.d/local-ntp-server.sources
# After modifyint this file, `chronyc reload sources`.
server 172.16.1.153 iburst

See /etc/chrony/sources.d/README.

Enable no-subscription Repos

Proxmox ships with the Enterprise repository enabled in /etc/apt/sources.list.d/* and thus apt update; apt upgrade will fail.

Delete the pve-enterprise and ceph repo lists from /etc/apt/sources.list.d and add the below files.

# Filename: /etc/apt/sources.list.d/pve-no-subscription.list
# This is for Proxmox 8.x only
# Proxmox VE pve-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
# Filename: /etc/apt/sources.list.d/ceph.list
# This is for Proxmox 8.x only
deb http://download.proxmox.com/debian/ceph-quincy bookworm no-subscription

See Proxmox Package Repositories.

RAM Management

Enable Kernel Shared Memory

Kernel Shared Memory (KSM) deduplicates RAM by sharing common pages. On Prox hosts that run VMs with the same guest OS (eg. Win11), several GB of RAM can be saved if KSM is enabled. In Proxmox 8.x, Kernel Shared Memory is enabled by default.

In /etc/ksmtuned.conf set KSM_THRES_COEF=50 so KSM starts when less than 50% of RAM is free. On Prox hosts with low RAM, eg 32GB, just increasing KSM_THRES_COEF from the default 20 to 50 is sufficient.

Memory Balooning for Guest VMs

Linux guest VMs support Memory Balooning by default and simply enable Memory Balooning in the VM settings will release free RAM from the guest automatically to the Prox host.

For Windows guest VMs, installing qemu guest agent will enable the Memory Balooning service.

In Guest VM settings, set the Minimum Memory to 2GB for Windows guest and 1GB for Linxu guests and ensure Balooning Device is enabled.

Kernel Command Line

Set the CPU to power save, on modern Intel and AMD servers this will reduce the CPU clock down to 400MHz when idle. Also disable CPU mitigations (Spectre, Meltdown, etc).

If booting on ZFS root:

  1. edit the /etc/kernel/cmdline file and append cpufreq.default_governor=powersave mitigations=off to the end of the kernel boot commandline.
  2. run proxmox-boot-tool refresh to updated the bootloader.
  3. after rebooting, watch -n.5 grep MHz /proc/cpuinfo to verify the real time CPU frequency scaling.

See Host Bootloader.

ZFS zpool Flags

Enabling zfs to run async improves disk performance by 10x. With sync disabled, zfs will flush writes to disk every 5 seconds only and not on every write. This has the downside of data loss, use only when uninterrupted power supply is available and data loss can be tolerated.

root@mox:~# zfs get sync rpool
NAME   PROPERTY  VALUE     SOURCE
rpool  sync      standard  local

root@mox:~# zfs set sync=disabled rpool

root@mox:~# zfs get sync rpool
NAME   PROPERTY  VALUE     SOURCE
rpool  sync      disabled  local

Download Container Templates

Proxmox downloads LXC container templates every 24 hours. For initial update, run pveam update on proxmox shell. After this we can install any CT from the Proxmox container template repository.

Guest VMs

Windows VMs

Install the QEMU accelerated drivers Windows VirtIO Drivers. Mount the ISO within the Windows guest and run virtio-win-guest-tools from the base folder.

Linux VMs

Linux guests natively support qemu paravirtualized drivers. However, it's still recommended to apt install qemu-guest-agent QEMU Guest Agent for better support (filesystem freeze, trim and shutdown support).