L2ARC cache with or w\o swap on zfs

werter

Well-Known Member
Dec 10, 2017
91
9
48
Hi.
I have 128GB RAM + zfs raid10 with 4 hdd + l2arc cache on nvme ssd 1TB.
I have a question. Do I need swap partition \file in this case?
Thx.
 
Swap is still useful as without it PVE will kill your VM/LXCs in case the node is running out of RAM. But swap on top of ZFS should be avoided as this might crash your server. So no swap file on a dataset and no zvol formated for swap.
You would need some unallocated disk space and create a normal swap partition there. But then the swap isn't redundant and a failing disk will crash your server too. Didn't found a way yet to mirror a swap partition with software raid, as mdadm should be avoided for swap too.

Not sure if there is a solution. Looks like the PVE team isn't seeing a way to solve this too, as PVE installs LVM with swap but ZFS without. And no one answer my thread so far:

https://forum.proxmox.com/threads/best-way-to-setup-swap-partition.116781/
 
Last edited:
No.
ARC is basically doing the opposite of swap. Swap will swap out data from RAM to disk to save some RAM. ARC will cache data from disks into RAM for better performance.
L2ARC will then move cached data from ARC in RAM back to a disk.

So L2ARC and swap do something similar, but swap can contain any data and L2ARC just cached ZFS data.
 
So can you tell me exactly if I need a swap if I have l2arc? :)
 
Last edited:
Depends on if you want swap or not. L2ARC is something different and for example won't prevent your PVE from killing guests on OOM conditions.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!