You are not logged in.
Pages: 1
Hi!
I'm getting my first computer with an SSD (Laptop with 256GB SSD) and getting slightly paranoid about all the responses to people saying swap is bad and I was curious about a few things
- Is swap still that bad with new SSD's?
- If I was to have a swap partition that was 8GB, if the swap eventually started to slow down the SSD would it only affect those 8GB allocated to swap or would it affect the whole SSD?
- If you didn't set swap, I assume when you closed the laptop the power would just stay on and waste more battery? Assuming Suspend to RAM wasn't in use
- At what amount of RAM does it become unnecessary to use swap?
Thanks
Offline
Offline
- Is swap still that bad with new SSD's?
That depends how it is used. I only have one machine with swap activated at all - and I don't recall the last time the swap space was even touched by the system.
If swap space is abused, then it potentially can achieive *very* high numbers of write cycles over the same area of this disk. This isn't nearly as big of a concern with modern SSDs, but at some point they too could be affected.
- If I was to have a swap partition that was 8GB, if the swap eventually started to slow down the SSD would it only affect those 8GB allocated to swap or would it affect the whole SSD?
Slow down? That is not the risk. If (big if) there are too many write cycles on a region of an SSD, that region will not slow down, it will wear out and be completely non-functional. But this would only affect that region, the rest of the disk would be unaffected.
- If you didn't set swap, I assume when you closed the laptop the power would just stay on and waste more battery?
This has nothing to do with whether or not you have swap set up. What happens when you close a lid is dictated by how you configure systemd or another relevant power manager. Options include doing nothing, turning off the screen, suspending, hybernating, and powering off. Of course hibernation will fail if you do not have swap.
- At what amount of RAM does it become unnecessary to use swap?
256MB. YMMV.
Last edited by Trilby (2018-08-13 23:23:01)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
gribblygood wrote:- If I was to have a swap partition that was 8GB, if the swap eventually started to slow down the SSD would it only affect those 8GB allocated to swap or would it affect the whole SSD?
Slow down? That is not the risk. If (big if) there are too many write cycles on a region of an SSD, that region will not slow down, it will wear out and be completely non-functional. But this would only affect that region, the rest of the disk would be unaffected.
I thought all modern SSDs had wear levelling which would distribute the wear across the device?
Offline
Across the device? Not that I know of, but I could be wrong. Across the file system sure. But the swap filesystem would be relatively small, so each sector would still be written to frequently. I can't imagine wear leveling would be rearranging the physical sectors assigned to different partitions.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
"Swap is bad" is an over-simplification.
The worst thing about swap, is swappiness defaulting to 60, so it's *overly* used.
The next worst thing about swap, is the confusion it causes
Offline
Consider using a swap file instead of a swap partition. A swap file provides the exact same functionality and speed as a partition, but can also easily be resized or deleted at any time.
My computer had 4 GB of RAM. Over the past 10 years using Arch Linux I have never needed to use swap space because of insufficient RAM, so I don't bother setting up swap space any more.
Please understand the differences between Suspend to RAM and Suspend to Disk. If you end up telling your laptop to Suspend to RAM when you close the lid, then you have no need for swap space in that regard.
In summary, you probably don't need any swap space. If you do need swap space, create a swap file instead of a swap partition.
...as for me, I HATE it when my laptops sleep when I close the lid. Instead, I just configure it so the screen turns off when the lid is closed, and I'd try to set it up to boot as quickly as possible. If I really want the computer to sleep, I'll press the "sleep" button that's on every laptop keyboard.
Offline
Consider using a swap file instead of a swap partition. A swap file provides the exact same functionality and speed as a partition, but can also easily be resized or deleted at any time.
It provides mostly the same functionality.
One functionality it does not provide, is "works on btrfs filesystems".
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
your browser is probably doing more writes to your disk than swap will ever do.
https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...
Offline
Pages: 1