Current swap configuration: best practices?
Date: Tue, 07 Feb 2023 18:48:47 UTC
About to configure some new servers for production, and it feels like for this configuration, there is no good reason to enable or provision swap. Would love to understand if anyone has a different viewpoint. The configuration is such that the disks (NVMe) are only 4-8x the size of physical RAM, and there is a lot of RAM + cores (128GB/1TB & 256GB/1TB). Working sets will fit easily into RAM. From the handbook: * the swap partition should be about double the size of physical memory (RAM) From the Architecture Handbook: * You should have at least 2x the swap space as you have main memory, and possibly even more if you do not have a lot of memory. * You should also size your swap partition based on the maximum memory configuration you ever intend to put on the machine so you do not have to repartition your disks later on. Using ZFS: * enabling mirror swap will break crash dumps My previous typical setup: * tweaked bsdinstall to create freebsd-swap partition * use gmirror + geli to mirror and encrypt swap * no dumps currently enabled * zfs mirror + stripe data/root volume I've reviewed both: https://forums.freebsd.org/threads/exploring-swap-on-freebsd.78418/ and the message archives. I found the thread talking about ANON mmap'd pages, curious how those go with swap disabled, mmap(2) doesn't mention anything. It seems like with "large" RAM, no dumps, and "small" NVMe-backed storage, there is no reason to enable swap - and certainly not the official recommended 2xRAM. What am I missing here? Thanks, Derek