Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on sh.itjust.works

20 replies

Great send up of Swap!

Swap is great though. And to point out again that there are ratings on quality SSDs for the lifetime writes. Pull up the data sheet and look for "DWPD", which is "Disk Writes Per Day". Typical numbers for good swap drives are 1 and 3. If DWPD is not listed, then plan for frequent drive failures if using heavy, heavy swap (like for ZFS swap drives (Yes, these are different from a OS swap partition)).

Anyway, I just wanted to point out the DWPD statistic.

1

Please, for the love of who ever you hold in high esteem, use swap. See: https://chrisdown.name/2018/01/02/in-defence-of-swap.html Now I don't really like the whole "Heres an article from some rando to prove my point" thing, but anecdotally, the article does line up with my experience (with 32 gigs of system memory). Namely, when I went without swap I experienced frequent system lock-ups, when I added swap on zram, lock ups still happened but less frequently, and when I eventually added disk swap on the recommendation of this article lock ups never happened again.

2

To add some nuance to this, do not use ZRAM in combination with swap. There's ZSWAP for that which does what you would expect, without clogging up your RAM and gracefully handling a hacking device. (ZRAM is just another block device for the kernel, so you will get LRU inversion if it fills up and you have another layer of swap on disk. Meaning your cold pages will be in needlessly stuck zram.)

1

I know right now you're stuck exclusively using swap, but If you work hard and apply yourself, you may one day be able to afford one whole gigabyte of ram without going more than five figures into debt.

15
lemmy.ml

Remember when they said “swap should be 2 times the amount of RAM”.

Why would I waste 128 GiB of storage for nothing?

18
istdaslolreply
feddit.org

Did the same thing but some apps are designed with that in mind and I had worse performance so had to do a swap file again

3
lemmy.ml

Never have I ever heard about apps that need a swap file to operate normally.

6
istdaslolreply
feddit.org

Me neither but creating one fixed my performance issues so I figured that was the issue. TBF it was a pagefile under windows so it might be a windows specific quirk but the main point still stands

1

Yeah, your first mistake was using Windows and expecting performance.

0

I usually make swap partitions on hdds tho never on ssds. I can happily spare ~10GB hdd space in this memory drought.

2

If you need swap, you probably should look at the tradeoffs of a file vs. a partition, or maybe even adding another entire disk.

But if you don't know if you'll need it, it's because you won't.

6

You reached the end