View previous topic :: View next topic |
Author |
Message |
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3632 Location: Rasi, Finland
|
Posted: Tue Apr 09, 2024 11:39 am Post subject: Optane, swap ,zRAM and backing device |
|
|
There's been quite a sale for optane based SSDs so I decided to bite the bullet.
I have envisioned a lot of use-cases for optane- filesystem cache (bcachefs and zfs could greatly benefit from it)
- swap on low memory systems
- zRAM backing device
... Which led me to here asking few questions regarding zRAM.
- If I have zRAM device of size 4Gb and 4Gb size backing device, do the size add up or not? So do I get 4Gb zRAM device or 8Gb?
- Is the data also compressed on the backing device?
Then there's the case of swap. Oh boy, do we have choices:- swap on optane
- swap on optane + zswap
- swap on zram + optane backing device
... the first would be the choice if using hibernate-to-disk, but which one's the best (in most cases)? _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9775 Location: almost Mile High in the USA
|
Posted: Thu Apr 11, 2024 4:42 pm Post subject: |
|
|
I don't get what the value add of "optane" is... as far as I know it's just another m.2 SSD, and you treat it as such.
Some optanes may be high endurance units so they would be good for caches and swap. But some appear to be rudimentary TLC and QLC units and wear fairly quickly.
Perhaps I've got too many aging machines and memory seems to be no longer an issue these days - swapping is rare or at least code memory is small compared to data memory - and data memory, well, the code should be smart about what needs to really be in memory and what can be kept on slow medium (versus code memory should not be swapped out whenever possible.)
As far as I know about swap on zram, seems android phones use it. How it deals with backing store I'm not sure, hearing conflicting reports on whether pages are decompressed when writing to backing store or not, might be a difference between zram or zswap or neither.. In any case a zram device uses your RAM so you can't count on adding the two together, it depends on compression ratio.
Fortunately hibernate is compressed, and seems to not write unused pages to disk. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3632 Location: Rasi, Finland
|
Posted: Thu Apr 11, 2024 4:54 pm Post subject: |
|
|
I have one ThinkCentre... or was it Station... Anyways those Lenovo 1 litre units. One such which has a specifically marked place for Optane.
I guess I start experimenting with it then. _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9775 Location: almost Mile High in the USA
|
Posted: Thu Apr 11, 2024 5:16 pm Post subject: |
|
|
Currently I run a regular SATA SSD (MLC) as a cache for one of my arrays, it does help a bit... but not super fast as if all SSD mostly because I set up a write through policy as the array is not battery backed and would lose the benefit of journaling of the filesystem. Don't need another write hole (cache -> RAID5 -> filesystem)... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2222
|
Posted: Thu Apr 11, 2024 5:51 pm Post subject: |
|
|
If you want a backing device use zswap. Having Zram + backing device will give you 8Gb of swap space but I'm not aware if you can prioritize one of them, while zswap has that by design.
Have in mind zram consumes ~10% of the declared device size only to keep the data structures up, even when the device is empty.
However I'm not sure how much sense buying a device just to make it a swap drive makes.
Best Regards,
Georgi |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3632 Location: Rasi, Finland
|
Posted: Thu Apr 11, 2024 9:37 pm Post subject: |
|
|
Thanks for the responses, guys.
I'm not necessarily putting all of the optane to swap usage. But if my system has Optane, it is the place to put swap. Very low latency, and good endurance.
Like I stated on my first post, Optane as filesystem cache is one choice too. Other one would be zram backing device for portage temp dir.
Optane could also really help when I have several VMs running. Freeze one, have its state stored on Optane, etc etc...
I need to experiment this. _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
|