Solved ZFS on low-end computer?

When 13.0 comes out i want to do a new install on a low-end computer which has 1GB of RAM.
Code:
root@xxx:~ # grep memory /var/run/dmesg.boot
real memory  = 1077936128 (1028 MB)
avail memory = 959516672 (915 MB)
agp0: aperture size is 256M, detected 32764k stolen memory

The current installation of 12.2 on this computer uses UFS as a filesystem because i heard that ZFS needs at least 1GB of RAM to function.
Is that still the case for 13.0 or can i use ZFS for the new install?
 
When 13.0 comes out i want to do a new install on a low-end computer which has 1GB of RAM.
Code:
root@xxx:~ # grep memory /var/run/dmesg.boot
real memory  = 1077936128 (1028 MB)
avail memory = 959516672 (915 MB)
agp0: aperture size is 256M, detected 32764k stolen memory

The current installation of 12.2 on this computer uses UFS as a filesystem because i heard that ZFS needs at least 1GB of RAM to function.
Is that still the case for 13.0 or can i use ZFS for the new install?
Stick with UFS my friend. But believe me, you can't do anything useful with only 1G of RAM. Time to upgrade it, at least to 4G.
 
But believe me, you can't do anything useful with only 1G of RAM. Time to upgrade it, at least to 4G.
I have to say contra here. IMHO you can install the i386 versions of FreeBSD & the ports(7) you're using; the binaries are smaller & use less RAM & disk space. Since i386 was Tier-1, it will get better support than the other Tier-2 architectures, because all the infrastructure is already there. At least that's what I was reading here (sorry for the noise if you were the one in that other thread).

1st, for a CLI-only server offering a few services on a SOHO network, 1 GB RAM can be fully sufficient, depending on the service & usage counts.

2nd, desktop use case: I ran a KDE desktop on a 1 GB RAM laptop with UFS. It will not thrill your head off, but it's not at all painfully slow, and it's a myth that KDE is RAM-hungry. In contrast, it adopts well to low RAM (best-in-class), slightly better even than XfCE. To run bigger apps, e.g. an office suite, naturally you'll need to have swap >= 2 x RAM (I'd recommend 4 GB).

In both cases, my recommendation is UFS on a gjournal(8)'ed device, you may want to read the article on that (can be @top of a partition or mirror/RAID-x). Then add my script to insert the I/O scheduler gsched(8), and you can enjoy that old low-tech machine for some another 5+ years, if the hardware holds. Maybe you can lower that AGP RAM thief in the BIOS. If you're curious, IIUC you can install on ZFS, but you'll need to adjust it to shrink it's RAM usage (a sysctl knob & KVA_PAGES>=4 in the kernel config in case of i386, IIRC). You'll find that if you really want it. ZFS really wants a 64-bit machine for it's checksums & compression & all the internal block refs etc., but it can live with low RAM for it's caches.
 
With ZFS I personally consider 4GB as absolute minimum.

For a retro 1GB computer I would suggest this 9GB DVD bootable image of the Lehmanns FreeBSD 5.2.1 edition.
It is full-packed with all possible things, KDE, GNOME, thousands of apps, easily installable directly via DVD (use /stand/sysinstall, the predecessor of bsdinstall).
NetBSD and OpenBSD are also on the DVD.
And you will just be amazed how fast that all runs ;)
Download here.
MD5 265eb8c6d04130e8079e9efe9c82b62b
 
With ZFS I personally consider 4GB as absolute minimum.
D'accord, but...
For a retro 1GB computer I would suggest this 9GB DVD bootable image of the Lehmanns FreeBSD 5.2.1 edition.
👎 that would be the ultimate RetroBSD on retro-hardware...
Other than calling him/her self noob, the OP is clever enough not to blindly follow any of our suggestions, but to think & read before type. That's the true BSD spirit.
 
Other than calling him/her self noob, the OP is clever enough not to blindly follow any of our suggestions, but to think & read before type. That's the true BSD spirit.
I have 20 years experience of running Debian Linux. It thaught me to not blindly follow random suggestions on the internet. The 'noob' part in my handle only refers to FreeBSD. ;)

Thanks for all your answers, guys. I think i'll stick to UFS and in addition, i'll look at gjournal.
I really have to tune this old lady.
 
I have to say contra here. IMHO you can install the i386 versions of FreeBSD & the ports(7) you're using; the binaries are smaller & use less RAM & disk space. Since i386 was Tier-1, it will get better support than the other Tier-2 architectures, because all the infrastructure is already there. At least that's what I was reading here (sorry for the noise if you were the one in that other thread).

1st, for a CLI-only server offering a few services on a SOHO network, 1 GB RAM can be fully sufficient, depending on the service & usage counts.

2nd, desktop use case: I ran a KDE desktop on a 1 GB RAM laptop with UFS. It will not thrill your head off, but it's not at all painfully slow, and it's a myth that KDE is RAM-hungry. In contrast, it adopts well to low RAM (best-in-class), slightly better even than XfCE. To run bigger apps, e.g. an office suite, naturally you'll need to have swap >= 2 x RAM (I'd recommend 4 GB).

In both cases, my recommendation is UFS on a gjournal(8)'ed device, you may want to read the article on that (can be @top of a partition or mirror/RAID-x). Then add my script to insert the I/O scheduler gsched(8), and you can enjoy that old low-tech machine for some another 5+ years, if the hardware holds. Maybe you can lower that AGP RAM thief in the BIOS. If you're curious, IIUC you can install on ZFS, but you'll need to adjust it to shrink it's RAM usage (a sysctl knob & KVA_PAGES>=4 in the kernel config in case of i386, IIRC). You'll find that if you really want it. ZFS really wants a 64-bit machine for it's checksums & compression & all the internal block refs etc., but it can live with low RAM for it's caches.
I expect the use case of the OP to be a desktop system like mine. Maybe you could have a desktop environment up and running, but any kind of modern web browsers will not work, unless you use something like netsurf.
 
but any kind of modern web browsers will not work, unless you use something like netsurf
This machine runs Firefox from latest packages. The speed is ok. (Making heavy use of swap)
2021-02-26-101620_1920x1080_scrot.png
 
I expect the use case of the OP to be a desktop system like mine. Maybe you could have a desktop environment up and running, but any kind of modern web browsers will not work, unless you use something like netsurf.
That's simply not true. Of course, Firefox is a no-go. It's crap anyway (has always been, espc. in terms of security), so it doesn't hurt not to use it. I surfed the net with KDE's x11-fm/konqueror on that 1 GB laptop. Honestly I do not remember if it had the KHTML engine or the newer WebEngine, but I'd strongly guess this doesn't make any difference in terms of RAM usage; maybe the newer is even smarter than KHTML. Yes, when you want to have more than, let's say 3 tabs open, it starts to swap. But if you restrict yourself & comply to some discipline, e.g. only a (very) few adblock lists, few tabs, then it is usable. I wrote above: it's speed will not thrilll you, and noone would expect that. But it's reasponably usable. Even a writing a letter or editing a spreadsheet with KDE's office suite is doable, since these already have some underlying libraries loaded when you use KDE. LibreOffice would definitely need more; likewise Firefox needs more, since it has to load gtk libraries, and these are much more memory-hungry than Qt+KDE's new kf5-* stuff. Naturally the choice of DE is your free decision, like any other. But if you step aside & give KDE a try, you might find that it runs smoother & uses less RAM (if you just let it auto-tune) than most hand-crafted DE on such low-end hardware.
 
The current installation of 12.2 on this computer uses UFS as a filesystem because i heard that ZFS needs at least 1GB of RAM to function.
Is that still the case for 13.0 or can i use ZFS for the new install?
I haven't tried 13.0 yet, but ZFS works fine on FreeBSD 11.x and 12.x i386 with 1GB of RAM. I have a number of 32-bit systems running VIA Eden (i686 class) cpu with only 1GB of RAM. The default ZFS settings wont work well, they have to be tweaked a bit in /boot/loader.conf

This works for me:
vm.kmem_size_max="330M" vm.kmem_size="330M" vfs.zfs.arc_max="40M" vfs.zfs.vdev.cache.size="5M"
 
That's only the window manager. You have to sum up the DE's total. And you have to see for yourself how "smooth" it runs. Should KDE's x11-wm/plasma5-kwin:kwin_x11 use significantly more RAM (RSS), you can replace it. I can't tell how difficult that is, since I only tried that once long ago & didn't succeed, but IIRC it's documented to be possible & I'd guess there's a howto on some of KDE's websites (techbase?), or maybe on KDE-FreeBSD. Sorry I don't have a link in my pocket right here & now. If you don't like KDE for some good reason, don't use it. If you think you're biased against it, give it try. OTT, I really like that you've managed to run & use a desktop on that ancient hardware. Chapeau!
PS: insert that I/O scheduler, it really makes a difference on concurrent tasks, and that's normal in the desktop use case. The scheduler is mature & in base for years. I only wrote the rc(8) service script to start/insert it. E.g. surf the net while doing some find or \nohup nice make -C /usr/ports/xyz -j 2 & in a terminal window. Another tuning knob could be to steal some cache from UFS: sysctl -d vfs.vmiodirenable. See tuning(7). If that slows down you typical workload, keep the default (1). Else echo vfs.vmiodirenable=0 >> sysctl.conf(5)
vmb: on that vfs.zfs.arc_max: what you want is not that ZFS doesn't use RAM as cache when it's available. In contrast, you want it's lower bound to be small, because that's the one that's applied on memory pressure, right?! Yes, right, I'd say that's the better knob to tune. EDIT Please correct me if I'm wrong.
 
That's simply not true. Of course, Firefox is a no-go. It's crap anyway (has always been, espc. in terms of security), so it doesn't hurt not to use it.
Can you or anyone expand on this? I use FF but a lot of websites don't work on it. What do you recommend?
 
When 13.0 comes out i want to do a new install on a low-end computer which has 1GB of RAM.
Code:
root@xxx:~ # grep memory /var/run/dmesg.boot
real memory  = 1077936128 (1028 MB)
avail memory = 959516672 (915 MB)
agp0: aperture size is 256M, detected 32764k stolen memory

The current installation of 12.2 on this computer uses UFS as a filesystem because i heard that ZFS needs at least 1GB of RAM to function.
Is that still the case for 13.0 or can i use ZFS for the new install?
I have used ZFS on 512 MB RAM system with two 2 TB drives in ZFS mirror for many years. This was FreeBSD on amd64 system - two low power (35W then) 1.6GHz Celeron cores. The only time I needed to reboot was the system updates. I also run NFS/SAMBA/SYNCTTHING/RSYNC there if that helps.

... about tuning ... the vfs.zfs.arc_max sysctl(8) is not that much respected.

The only way I was able to trim the ARC size was this in /etc/sysctl.conf file for 16 GB system:

Code:
# ZFS ARC ENFORCE @ 1024 \* 1024 \* 3
  vfs.zfs.arc_free_target=3145728

With these settings I have that much ARC:

Code:
% top -b | grep -A 1 ARC
ARC: 195M Total, 85M MFU, 41M MRU, 1932K Anon, 2852K Header, 64M Other
     25M Compressed, 104M Uncompressed, 4.24:1 Ratio

I think that you will have to find your value for your amount of RAM.

You do not need to reboot to check new value.

The larger the value (for vfs.zfs.arc_free_target) the smaller the ARC.

Hope that helps.
 
vmb: on that vfs.zfs.arc_max: what you want is not that ZFS doesn't use RAM as cache when it's available. In contrast, you want it's lower bound to be small, because that's the one that's applied on memory pressure, right?! Yes, right, I'd say that's the better knob to tune. EDIT Please correct me if I'm wrong.
I spent a couple of days a few years ago testing settings for my use case. I used this guide. I started with 512MB/512MB for kmem sizes and 160MB for ARC max. Reducing the kmem by 64MB and the ARC max by 16MB until I had reliable operation for more than a few hours. About a week later I had a problem with my test machine that I suspected was due to ZFS and memory. I decided to use the low settings published in the guide and increase values incrementally. The 40MB ARC max gave the best reliability. I have kept those settings and use them on all 1GB-2GB machines.
 
[Firefox alternative] Can you or anyone expand on this? I use FF but a lot of websites don't work on it. What do you recommend?
Well,... äh,... Any! ;) 1st, most sites should work ok viewn with Firefox, because that's among the most used, so the most website creators will test their sites with Firefox. I.e., I'd suspect you have some misconfiguration, e.g. some bad adblock rules, or some misbehaving plugin. Back on topic: this is a highly personal choice. The Webkit/WebEngine is very mature & stable, it complies well to the relevant standards. But other web engines do as well. The browser is only a "shell", a UI to comfortably use the underlying web engine. I use Falkon & Konqueror, 'cause I'm a KDE guy. Falkon will go away (not supported in the ports anymore), so then I'll only use Konqueror or look out for an alternative. pkg install psearch & psearch -c www browser |wc -l: 71. Pick one but FF.
vmb, did you try to set vfs.zfs.arc_min instead? Take a snapshot, try it, you can't loose. It will not smash your data. ZFS is copy-on-write...
 
Well,... äh,... Any! ;) 1st, most sites should work ok viewn with Firefox, because that's among the most used, so the most website creators will test their sites with Firefox. I.e., I'd suspect you have some misconfiguration, e.g. some bad adblock rules, or some misbehaving plugin. Back on topic: this is a highly personal choice. The Webkit/WebEngine is very mature & stable, it complies well to the relevant standards. But other web engines do as well. The browser is only a "shell", a UI to comfortably use the underlying web engine. I use Falkon & Konqueror, 'cause I'm a KDE guy. Falkon will go away (not supported in the ports anymore), so then I'll only use Konqueror or look out for an alternative. pkg install psearch & psearch -c www browser |wc -l: 71. Pick one but FF.
vmb, did you try to set vfs.zfs.arc_min instead? Take a snapshot, try it, you can't loose. It will not smash your data. ZFS is copy-on-write...
Thanks for that. I will try Falkon. I dunno if I want to try Konqueror because of the dependencies. I used to use KDE about 12 years ago on a Pentium 4 machine that had only 640MB of ram and it was perfectly smooth. Thanks for the advice! 😁
 
I know the whole thing is already resolved but still wanted to butt in a bit... Until December 2019 I've been using a low end 32bit home server which only had 2Gb of memory and I used ZFS on it. Things ran pretty smoothly, but then again I never used it for something excessive. It was merely a mail and Intranet server (and a Tomcat test environment, I kid you not) and I coped easily.

While I do agree that 4Gb is a decent minimum amount it's also fair to say that if you know what you're doing then you can squeeze plenty of performance out of an old box. Of course context is a thing, a lot depends on what you plan to do with said box, but even so...

A real decent memory minimum requirement is 2Gb, not 4. Four could even be considered overkill.

And it would seem even Synology agrees with me here 😁 This year I bought myself a DS420+ Synology NAS because I got a bit tired of swapping HD's for external backups. I already had experience with their 920 series which I had installed elsewhere, but that was a bit overkill for my home situation since I was mostly going to use it for storage / backup. Well, this system uses a 4 drive RAID ("Synology Hybrid (SHR)") which allows for hot swapping and it relies on the btrfs filesystem which includes options for compression, encryption on specific filesystems and extensive checksums. It comes with a web interface (which provides https support) by default and provides tons of extra options if you want to use them (from being a DHCP server to a mailserver, media server (which I am using), ldap, GIT, node.js... it even supports Java and PHP and you can utilize that yourself as well, it also provides a command line (SSH, FTP, etc,).

So how much memory do you think it has and uses? Yah, 2Gb, and my monitoring services showed me that this is more than enough. Sure, when I started dumping my data from some other remote HD's and backups from 2 machines on it at once then it had to cope a bit, but it kept its performance and it worked things out easily.

Once again, 4Gb makes for a safe memory setup, true, but it's hardly an absolute minimum. That would be 2Gb.
 
I know the whole thing is already resolved
Not at all. Most people say that it won't work but https://wiki.freebsd.org/ZFSTuningGuide states that
There is one example of ZFS running nicely on a laptop with 768 Megs of physical RAM with the following settings in /boot/loader.conf
I said that i will keep using UFS but i would be glad if a can use ZFS next on this machine. If there are parameters that i can tune to make it work, why not?
 
I said that i will keep using UFS but i would be glad if a can use ZFS next on this machine. If there are parameters that i can tune to make it work, why not?
Because ZFS really wants a 64-bit CPU to run smoothly -> you loose some amount of precious RAM due to bigger sized pointers. Even if you install the 32-bit versions of your port's (that's possible), you may find you're better off giving this RAM to your apps, than to give it "for nothing", because it's simply not necessary to have 64-bit pointers for the kernel & base on a machine with 1 GB RAM. Doesn't mean ZFS can't be run in 32-bit mode; but it will be more or less a PITA. Very very likely your CPU has this PAE feature (or was it PSE36? dunno) i.e. you can have > 4GB VM total (RAM+swap) in 32-bit mode. IMHO the benefits of ZFS - I do like ZFS, it's a gift, even on desktop systems - do not justify to make the real pupose of your system harder/worse: to run a desktop + apps as smooth as possible. Therefore you want RAM for your apps. YMMV. If you'd like to run a small SOHO server @1 GB RAM, then yes, you can go ZFS for light workload. You'll have to backup your data anyway (64 GB USB stick: ~20€), so you can just try both options for a week or two, then decide again.
 
Back
Top