rych wrote: ↑10 Sep 2023, 10:32
Alternatively, a swapfile on the host NTFS disk, which should be still better than a linux native swap partition on USB, right?
Depends.
when you have an external drive on either eSATA or USB-3 (which internally is also eSATA) a swap partition would be better performance-wise than a swap file on the internal drive.
When you can move partitions around on your internal drive having a swap partition there is the best. (Also, to have rely on an external drive is a bother, what if there is data on there you need to move to some other place? E.g. umount and swapoff all devices. swapoff can take a while to free the drive, and usually that would be less than ideal.)
Like I did, making my sda7 smaller by approx 4GB to double the size of my sda6 swap.
Added in 5 minutes 37 seconds:
Just to show how my swap fills up after a while (mainly due to Palemoon, but also a bit due to interlink and other programs)
Code: Select all
root@rava:/# type sx
sx is a function
sx ()
{
echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________;
{
read firstLine;
echo "$firstLine";
while read f t s u p; do
let "s2 = $s / 1024";
let "u2 = $u / 1024";
printf '%-40s%-16s%-8s%-8s%-8s\n' $f $t $s2 $u2 $p;
done
} < /proc/swaps
}
Code: Select all
root@rava:/# uptime
15:38:25 up 2 days, 2:11, 4 users, load average: 0.99, 1.02, 1.12
root@rava:/# sx
10.09.2023 15:31:33 ____________________________________________________________
Filename Type Size Used Priority
/dev/sdb1 partition 4095 0 1
/dev/sda6 partition 8703 934 5
/dev/zram0 partition 309 309 100
As you can see, the sda6 starts filling up. The zram0 is already full, and only as a last resort would the system use sdb1 (but that hardly ever happens now that I set the priority during boot to have the internal swap sda6 of higher priority than the external ones (these would all get 1 by default)
FYI: "priority is a value between -1 and 32767. Higher numbers indicate higher priority. See swapon(2) for a full description of swap priorities. "
(quote from man swapon(8))
Added in 4 minutes 39 seconds:
And last but not least:
I realized that my approx 4 GB internal swap partition is not enough was when I used that very external drive with also 4 GB swap partition, all in a sudden my system had less issues going into suspend due to running out of RAM.
That was the main reason why I doubled my internal swap partition so that I get the same performance even without the external drive.