❓ What?
There are a few tweaks I make after installing proxmox. This is when installing Proxmox is done through the provided liveiso. Usually though however I use the OpenZFS guide to install Debian first and I then install Proxmox on top of it so I can apply all the tweaks right during installation.
After installation, I create a separate dataset for Proxmox CT/VMs as zfs create rpool/pve
. I name the storage is proxmox as zfs-<deviceclass>
to keep it really simple and consistent across different installations, and also for migration to be possible without using shared storage.
Tweaks after Installation
The changes are automatically inherited from the parent dataset, so there’s no need to set it for nested datasets. Also, these modifications will only apply to new files. The default proxmox installation is quite small at 1.2G
so I don’t really mind. Finally, the tweaks:
- Disable access time updation completely. This information is irrelevant to me and I only care about when a file was last modified. So it’s disabled with
zfs set atime=off rpool
globally. - Enable extended attribute storage for POSIX ACLs with
zfs set xattr=sa rpool
. This apparently improves xattr performance significantly. - It’s not recommended to set
dnodesize=auto
globally as GRUB2 still does not support all features of zfs anddnodesize=auto
is one of them. So it can be set only for VM dataset like so:zfs set dnodesize=auto rpool/pve
For reference, Proxmox’s default installation partitioning looks like this:
- Enable POSIX ACLs globally with
zfs set acltype=posixacl rpool
. This is just a preference that helps to create snapshots on LXCs. - Enable TRIM automatically on the pool so you don’t have to worry about ZFS not sending DISCARD messages to the nvme firmware. This is done on a pool level with
zpool set autotrim=on rpool
.
Tweaks during Installation
During installation too, I make some really general tweaks such as:
- Increase
ashift
to12
because all modern drives have 4K physical sectore sizes and there’s no need to live with the old emulated 512 bytes sectors. - Select
compression
method aszstd
instead of the defaultlz4
. I mean, compression is cheap, doesn’t really hinder cpu time noticeably so if I can save some space, why not save it where I can? - Increase ARC size max to (1/2) x RAM. Proxmox recently introduced a change to lower the amount of RAM ZFS is allowed to use for its cache to 10% of the total available RAM. I know ZFS loves RAM and I have 32G of it, and I don’t really mind zfs using half of it as long as zfs gives it back to applications when they ask for it, which it does.
Summary
In a nutshell, these are the commands to run:
At the end of it, the properties look like this.