On 9/30/23 07:46, Andy Smith wrote:
Hello,
On Sat, Sep 30, 2023 at 03:26:19AM -0400, gene heskett wrote:
On 9/29/23 17:32, Andy Smith wrote:
On Fri, Sep 29, 2023 at 04:36:04PM -0400, gene heskett wrote:
Swap file is the last thing I want, much slower than a swap partition.
There has been no performance difference between swap files and
swap partitions for more than a decade.
Maybe on wintel stuff, but the u-sd card the pi runs on has a write speed
below 10 megs/second, an extremely obvious performance hit, and wearing out
the u-sd card rapidly.
Please show evidence or retract your claim that on a raspberry pi a
swap partition performs better than a swap file (when they are both
on the same storage device). I believe you are making it up, as it
isn't the case in the kernel code and should not make any difference
by architecture.
There is a huge difference in the write speeds between a modern SSD that
can be written at usb3 speeds, and the write speed of a micro-sd card
the pi boots from.
This is a real world fact Andy C. Tested, verified FACT.
For small writes it might approach the BS claims on the blister card but
rarely gets there, for megabyte and up writes its often below 10 megs a
second. The blister card may claim up to 120M/S, but dd shows that
outright lie when imaging a 64GB card with a 7G image, doing the last
75% of that 7G at less then 10M/S. On raspios-wheezy, swap was on the
u-sd card. And it took me 3 hours & change to build a realtime preempt
4.19 kernel for the pi, on the pi. Switch the swap to a sata-iii SSD on
a startech usb3-sata adapter, and that same kernel build is 23 minutes
on the pi, for the pi.
Testimony from one of the maintainers of the memory management and
ext filesystems in the Linux kernel:
https://lkml.org/lkml/2005/6/29/11
https://lkml.org/lkml/2005/7/7/326
TL,DR, my experience is a fact. The medium differences which you keep
ignoring, is in FACT important.
Swapping on SD cards in general is a bad idea regardless of
architecture, but there should be no difference between swap file or
swap partition. I did not suggest you swap to a file on SD card. I
suggested that whether you swap to a file on SSD or a partition on
SSD, the performance will be the same.
True, as long as both are on the SAME medium. However my experience with
swap files on pi's has been with swap files on the u-sd. They do work,
If you plan on a long nap while they work, and the u-sd card doesn't
wear out, which I have had happen on smaller cards. That upset me, a lot
as I had to rewrite a couple gigs of gcode that disappeared. That
taught me to include the pi in my amanda backups. Then I bought two
seacrate 2T rust buckets, spent about 6 weeks building up a buster on
the new, faster drives. And both drives disappeared off the end of the
cables 4 days apart a week later losing everything. Junk I didn't even
try to warranty. Burn me a third time and I'm all done with that name on
the box. Now I'm collecting 2T gigastones to do it again, about the same
price as the SamSung's, but turn them over and read "made in Taiwan"
Its been hell trying to make bookworm usable. And I seem to be headed
to do it again, the raid10 I built on bullseye for /home, is not
compatible with bookworm and no one can tell me what to do to fix it.
The problem is that ANYTHING that wants write access to that raid10 has
to wait anywhere from 30 seconds to 5 minutes to open the requestor. It
always works, all I have to do is wait, then wait some more. Wash, rinse
and repeat. That's BS and you all wonder why I am in such a bad mood.
It's also a puzzle. I have an AppImages directory off of /home/gene on
that raid10, and those AppImages work as instantly as one would expect
from a raid10 made of 4 1T SamSung 870 SSD's. 2, maybe 3 seconds to a
fully drawn screen ready to do work. Yet when one of those apps want to
write, its always blocked the first time by this wait but not there
after. But leave it running overnight, wash, rinse, repeat the delay
again the next day. Why?
Here is the current fstab:
cnc@rpi4:~$ cat /etc/fstab
UUID=8E25-4B18 /boot/broadcom vfat defaults,flush
0 2
UUID=47946eb6-d88c-4331-bba9-cbe269a35925 / ext4
defaults,noatime,commit=600,errors=remount-ro 0 1
tmpfs /tmp tmpfs
defaults,nosuid 0 0
# to which I've added but commented ATM
#LABEL=TEMP1 /tmp ext4
defaults,noatime,errors=remount-ro 0 1
There's no swap listed there and the only thing you've added seems
to have a comment in front of it, so you've effectively added
nothing so I don't understand why you expect something to change now.
cnc@rpi4:/etc$ sudo swapon -s
Filename Type Size Used
Priority
/dev/zram0 partition 1048572 98304
100
/dev/sda2 partition 9859068 0
-3
I need it to forget zram0 and use the swap on sda2
You didn't respond to the part about /etc/fstab so we have no idea
if you found the information you needed.
I didn't find the swap listed in the fstab, its apparently setup someplace
else in debian 12 for arm64's, so I've not finalized that yet. Awaiting
guidance.
This isn't Debian 12 though is it? Debian doesn't use zram by
default so this is something else. As usual we struggle to answer
your questions as they're off-topic here, amongst other
difficulties.
As the other poster mentioned, zram is set up by a systemd unit but I
don't know more about it off the top of my head.
1. swapoff -a
2. edit /etc/fstab to be correct
3. swapon -a
I'd also point out that despite the presence of the above listed swap,
swapon -a and swapoff -a, does not enable it, I have to mount it by hand.
As I said, your fstab as shown does not contain any reference to
swap, so I'm not surprised that you have to manually tell it to use
/dev/sda2.
First tackle disabling the zram (or making it use sda2).
Which is what I want to do. How? is the question...
Thank you, take care and stay well, Andy.
Thanks,
Andy
Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>