Saturday, April 20, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 3689  / 2 Years ago, mon, june 13, 2022, 4:57:46

SUMMARY

Does Ubuntu take advantage of multiple swap partitions on separate physical media, from a load sharing point of view? i.e. if one drive with a swap partition is burdened with i/o, will it utilise (other) swap space that resides on a different physical hard drive?



BACKGROUND

Building a headless home server (command-line only responses, please!). I usually put the o/s, the virtual/swap space and apps+data each on separate drives. While I think I've got directories and mount points clear (even managed to automount an NFS folder from a NAS), swap still seems a little hazy to me...




  1. The Ubuntu install sequence partitioned my main drive with LVM [still unsure if LVM was the best choice for a headless server; but this is not a question, just an observation]


  2. I've got two additional drives I'd like to use. While I see guides for GParted, detail regarding fdisk doesn't seem as thorough.


  3. I realise there's also the "swappiness" setting, but I'm more curious about the possible benefits if Ubuntu is sufficiently "device-aware" to take into account an i/o burdened device vs. an idle one, should it have multiple swap areas at its disposal.



More From » installation

 Answers
2

At boot mountall commands calls the swapon utility.



The swapon manpage says :



Calls to swapon normally occur in the system boot scripts making all swap devices available, so that the paging and swapping activity is interleaved across several devices and files.



As pages are interleaved across different devices one can assume that different swap spaces on different devices would performs better (like a RAID 0) than a single swap space on a single device.



My opinion is that tuning swap access is pointless, as when you got to a point where swap access is a critical resource, your system is almost unusable, disk access is 1000x slower than memory access.



Better tune the memory usage by removing unnecessary daemons, checking software parameters....



You should find useful informations on memory footprint here:
http://linux-mm.org/LinuxMMDocumentation


[#28226] Tuesday, June 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
erranbe

Total Points: 118
Total Questions: 95
Total Answers: 117

Location: Virgin Islands (U.S.)
Member since Tue, Jul 7, 2020
4 Years ago
erranbe questions
;