OK so here goes. I’m buying a new system with an AMD Threadripper 3960x processor and 64 GB of memory. In the past, 64 GB was a lot of memory, but this processor has 24 cores and 48 threads! Simply dividing the memory up by thread, it comes to [only] about 1.3 GB per thread! Now this is an over-simplification as the threads can share memory [sometimes]. One exception is when you assign a few cores(like say 4 cores) to a virtual machine, say running Windows. There are other instances, but this is a classic. In that case, the cores are dedicated to that process. This complicates things considerably.
So I’ve decided to solve this problem with swap. New SSD drives are cheap and huge. So I decided to use swap to solve the problem where a small number of cores might not have enough memory. I’m aware that ssd drives may fail due to a large number of writes using swap so I approached this issue with a 2 pronged approach.
I bought a standard ssd and will dedicate it to swap only to ensure I lose no data on the drive, only the immediate swap if it fails. The main drive is a 5000/5400 PCIE4 NVMe and can’t afford to lose one of those, they’re expensive and I’ve got data on them.
The ssd will be an enterprise-grade Samsung 850 DCT with 3D NAND to ensure lots of reads/writes.
Now I intended to buy a 128 or 256 GB hard drive, which would be a closer match to memory size, but the cheapest one in this class of drive ($100) was 400GB. This caused an even bigger quandary. So the questions I have for your amusement and mine are:
The recommended size for swap is typically 2 times the system memory. Is this per core? Per thread? Because remember I have 24 cores and 48 threads. Some cores will undoubtedly be dedicated to virtual machines. Remember, my memory size at 64GB is only about 1.3 GB per core. Also, ssd swap will be phenomenally faster at 580/500 MB/sec. Does the speed mitigate some of the need to restrict the size of swap in this case?
I have this really big hard drive dedicated to swap. Can I split it into 2 or 4 swap partitions and will it help/hurt with an ssd?
Should I just use a small part of it in a partition, and if it starts to fail, make another partition and use that? Will the extra sectors on the drive already be used up?
With a faster medium like ssd, can I use a larger swap partition than we used to without worrying it will drag the system down?
I’m currently planning 128GB of swap for 64GB of ram, does that sound reasonable? Perhaps will the multiple processors keep the machine from bogging down with swap as machines have done in the past?
Thanks for any comments/considerations.