The entire point of swap is to have a place to put stuff that can't fit in main ram because "back in the day" ram was expensive so we almost always put too little of it in computers.
Today ram is cheap and the idea now is that they know you probably are going to have more ram than your programs need so modern OS's will commit the remaining unused ram to a big disk cache. Modern OS will also take little-used programs from core ram and deliberately swap them to disk with the idea that a program only running once in a while is better off swapped. So I generally just create swapfiles these days and dispense with the partitions Ted -----Original Message----- From: PLUG <[email protected]> On Behalf Of Keith Lofstrom Sent: Friday, July 28, 2023 3:46 PM To: [email protected] Subject: [PLUG] SSD swap partition and/or swap file Question about swap file vs swap partition. I have a dozen spinny disks with too many ancient distros on too many machines. I am slowly consolidating to a few Debian 12 Bookworm machines with Samsung terabyte SSDs. When large-RAM low-power fast motherboards become cheap enough, I will migrate to those. More RAM may imply larger swap areas (a semi-religious debate I hope to avoid). I want to be ready if the "large swap" zealots win the debate and design software dependent on swap. SSD swap seems MUCH better than spinny-disk swap, very fast access compared to moving a spinny disk head across a platter ... though way slower than RAM. ---- Large SSD swap also facilitates fast hibernate, though Debian startup and shutdown are amazingly fast using an SSD (10 seconds startup/login, 2 second shutdown). Perhaps I don't need hibernate-to-swap. ---- One of my recent SSD experiments resulted in a too-small swap partition. Inept resizing attempts borked the file system. But ... I can also create a huge swap file on a regular ext4 file system, and easily up-size the swap file when I install more RAM. Resizing a partition is more complex. I've read some online debates about swap partitions vs. swap files. Most of the debates are from the spinny disk era; the speed tradeoffs have changed radically. My main concern is reliability, software compatibility, and ease of maintenance rather than maximum speed. ---- I suspect I will need SOME separate-partition swap, but I hope I can get by with a few gigabytes, relying mostly on a big swap file, growing that swap file over time as I migrate to motherboards and laptops with more RAM. At 69.9 years of age, I should also minimize complexity, deploying systems that I can maintain with an 80 or 90 y.o. brain someday. My father-in-law is 105, and his Windoze computer took many days to decrapify. I won't have a son-in-law to do that for me. So, that's a lot of yammering, another sequela of excess age. In summary: "Optimum SSD swap? ?? ???" Keith -- Keith Lofstrom [email protected]
