Why are my ZFS disks so noisy?
allthingsopen.org
allthingsopen.org
1. Most hard drive noise is caused by mechanical vibrations being transmitted to the chassis the drive is mounted on.
2. Consequently the most effective way to reduce noise is to reduce the mechanical coupling in the drive mounting mechanism. Having the drives in a noise-isolating case is helpful too, but only as a secondary improvement. Optimizing the drive mounting should really be the first priority.
3. If space isn't a concern the optimal thing is to have a large case (like an ATX or larger) with a large number of HDD bays. The mounting should use soft rubber or silicon grommets. Some mounting systems can work with just the grommets, but systems that use screws are ok too as long as the screw couples to the grommet not the chassis. In a good case like this any number of hard drives can be made essentially inaudible.
4. If space is a concern, a special purpose "NAS like" case (example: the Jonsbo N line of cases) can approach the size of consumer NAS boxes. The lack of space makes optimal accoustics difficult, but it will still be a 10x improvement over typical consumers NASes.
5. Lastly what you shouldn't ever do is get one of those consumers NAS boxes. They are made with no concern for noise at all, and manufacturing cheapness constraints tend to make them literally pessimal at it. I had a QNAP I got rid of that couldn't have been more effective at amplifying drive noise if it had been designed for that on purpose.
I mean, you can hear it, but it's mostly just the fans and drives spinning, it's not loud at all.
The recommendations seem reasonable but for noise? If it's noisy probably something is wrong I think.
vfs.zfs.txg.timeout defaults to 5 seconds, but it can be set (much) higher if you wish.
I don't care if I lose up to a minute or two of work instead of <=5 seconds in the face of an unplanned failure, so I set it to a couple of minutes on my desktop rig years ago and never looked back.
AFAIK there's also no harm in setting it both dynamically and randomly. I haven't tried it, but periodically setting vfs.zfs.txg.timeout to a random value between [say] 60 and 240 seconds should go a long ways towards making it easier to ignore by breaking up the regularity.
(Or: Quieter disks. Some of mine are very loud; some are very quiet. Same box, same pool, just different models.
Or: Put the disks somewhere else, away from the user and the sleeping guests.)
0 - https://devblogs.microsoft.com/oldnewthing/20220816-00/?p=10...
The Define 7 has the same grommet system, but the trays can be fastened by screws to the support rails.
The difference in noise was significant. Even though I went from 6 to 10 disks it's much more quiet now.
P.S. I also talked to a customer in the past who stored their backups in an SSD-only Ceph cluster. They were citing higher reliability of SSDs and higher density, which was important because they had very limited physical space in the datacenter. In other words, traditional 3.5" HDDs would not have allowed them to store that much data in that many rack units.
But they're not great for low cost bulk storage. If you're putting together a home NAS, you probably want to do well on $/TB and don't care so much about transfer speeds.
But if you've found 10TB+ ssds for under $200, let us know where to find them.
An 8 TB SSD is >$600
$80/TB vs $20/TB is a four fold increase.
Also a 16 TB drive is $2,000 so more like a 5x increase in a data center setup.
Best I've found so far is cards like this[1] that allow for 8 U.2 drives, and then some M.2 to U.2 adapters like this[2] or this[3].
In a 2x RAID-Z1 or single RAID-Z2 setup that would give 24TB of redundant flash storage for a tad more than a single 16TB enterprise SSD.
[1]: https://www.aliexpress.com/item/1005005671021299.html
Perhaps it will be realized with higher PCIe versions, given how tight signalling margins will get. But the big guys have money to throw at this so yeah...
Lame
Also, you want to reduce vibrations because of this: https://www.youtube.com/watch?v=tDacjrSCeq4 (Shouting in the datacenter)
Is there any solution that lets me mix and match drive sizes as well as upgrade? I'm slowly getting more and more into self hosting as much of digital life as possible, so I don't want to be dependent on Synology, but they offered a product that let me go from a bunch of single drives with no redundancy to being able to repurpose them into a solution where I can swap out drives and most importantly grow. As far as I can tell theres no open source equivalent. As soon as I've set up a file system with the drives I already have the only solution is to buy the same amount of drives with more space once I run out.
Recent versions of zfs support raidz expansion [1], which let you add extra disks to a raidz1/2/3 pool. It has a number of limitations, for example you cannot change the type of pool (mirror to raidz1, raidz1 to raidz2 etc.) but if you plan to expand your pool one disk at a time it can be useful. Just remember that 1) old data will not take advantage of the extra disk until you copy it around and 2) the size of the pool is limited by the size of the smallest disk in the pool.
I've been running LVM and Linux software RAID for like 20 years now.
The only limits (for me at least) are:
smallest device in a raid determines size of that array. But that's fine since I then LVM them together anyhow. It does let you mix+match and upgrade though really I always just buy two drives but it helped when starting and I experimented with just LVM without RAID too.
I have to know RAID and LVM instead of trusting some vendor UI. That's a good thing. I can fix stuff in case it were to break.
I found as drives went to Terabytes it was better to have multiple smaller partitions as the raid devices even when on the same physical drive. Faster rebuild in case of a random read error. I use raid1. YMMV
I still have the same LVM partitions / data that I had 20 years ago but also not. All the hardware underneath has changed multiple times, especially drives. I still use HDDs and used to have root on RAID+LVM too but have switched for a single SSD. I reinstalled the OS for that part but the LVM+RAID setup and its data stayed intact. If anything ever happens to the SSD with the OS, I don't care. I'll buy a new one, install an OS and I'm good to go.I don't use any of their "personal cloud" stuff that relies on them. It's just a Linux box with some really good features for drive management and package updates. You can set up and maintain any other services you want without using their manager.
The ease with which I could set it up as a destination for Time Machine backups has absolutely saved my bacon on at least one occasion. My iMac drive fell to some strange data corruption and would not boot. I booted to recovery, pointed it at the Synology, and aside from the restore time, I only lost about thirty minutes' work. The drive checked out fine and is still going strong. Eventually it will die, and when it does I'll buy a new Mac and tell it to restore from the Synology. I have double-disk redundancy, so I can lose any two of five drives with no loss of data so long as I can get new drives to my house and striped in before a third fails. That would take about a week, so while it's possible, it's unlikely.
If I were really paranoid about that, I'd put together a group buy for hard drives from different manufacturers, different runs, different retailers, etc., and then swap them around so none of us were using drives that were all from the same manufacturer, factory, and date. But I'm not that paranoid. If I have a drive go bad, and it's one that I have more than one of the same (exact) model, I'll buy enough to replace them all, immediately replace the known-bad one, and then sell/give away the same-series.
It’s an 8Bay Synology 1821+. Cost about $1300 for the machine, 32GB of ECC memory, and the 10gbe network card.
I have 4 8Tb drives in a btrfs volume with 1 drive redundancy giving me 21TB of space.
All the important stuff gets also backed up to another 8TB drive periodically and sent to glacier.
The way synology’s shr1 setup works seems to be like RAID5 + a bit more flexibility so I can add more drives to the array but as long as they are 8TB or larger.
The docker manager seems to work pretty well. I run a few services there and mount certain volumes into them. A few DNS records and some entries into the reverse proxy in the control panel of it and you can run whatever you want.
Most critically power draw is very low and it’s very quiet which was an important consideration to me.
Probably more than one, but on my non-Synology box I use SnapRAID, which can take any number/size of drives. Downside is that it isn’t realtime, you have to schedule a process to sync your parity: http://www.snapraid.it/
Suspension of the drives with elastic bands used to be popular in the silent PC community.
I used to play with stuff like this. It was fun when I was single and had lots of free time. I don't play with it anymore. If I pay someone $500 over nominal value to provide me with 8-9 years of support for security updates, etc., and I just install their packages... that's worth it to me. My first Syno was a DS412+ and my second was a DS1621+. Nine years between introduction of the two. The 412+ is still running just fine at a friend's house. I gave it to him with ~12 TB total drive space, said just help me next time I need something done with car audio (he's a DJ and knows cars) and we're square.
He's happy, I'm happy. I go set up his network, he installs my head unit. We both win by doing what we're good at and letting someone else use their expertise instead of learning a lot of stuff we will almost never use again.
I have a somewhat large zfs array and it makes consistent noise as I stream videos from it. The streaming is basically a steady trickle compared to what the array is capable of. I'd rather incur all the noise up front, as fast as possible, then continue the stream from a silent SSD.
blockdev --setra <num_sectors> /dev/sdX
But I feel like there was a sysctl for this too in the past. I used it back in the day to make the HDD in my laptop spin down immediately after a new song started playing in rhythmbox by setting it to 16MB.Additionally, ZFS supports using SSDs to supplement the cache.
As a sibling says, ZFS should support this pretty transparently.
Another much simpler filesystem-agnostic alternative would be to copy it over to the SSD with a script and commence streaming from there. You'll have to wait for the entire file to copy for the stream to start, though. I think some streaming servers may actually support this natively if you mount /var and/or /var/tmp on the faster drive and configure it to utilize it as a "cache".
You may be interested in checking out bcache[1] or bcachefs[2].
[1] https://www.kernel.org/doc/html/latest/admin-guide/bcache.ht...
https://github.com/45Drives/autotier is exactly what they were asking for as well
Worked well enough on the small scale, but sadly haven't had the time or hardware to test it in a more production-like environment.
Also, it was starting to feel a bit like a Jenga tower, increasing the chances of bugs and other weird issues to strike.
I started thinking about this when considering using a SAN for the disks, so that write speed was limited by the 10GbE network I had. A local NVMe could then absorb write bursts, maintaining performance.
That said, it's not something I'd want to use in production that's for sure.
There was some work being done on writeback caching for ZFS[1], sadly it seems to have remained closed-source.
ZFS of course has its limits too. But in my experience I feel much more confident (re)configuring it. You can tune the real world performance well enough especially if you can utilize some of the advanced features of ZFS like snapshots/ bookmarks + zfs-send/recv for backups. Because with LVM/ XFS you can certainly hack something together which will work pretty reliably too but with ZFS it's all integrated and well tested (because it is a common use case).
I love ZFS overall, it's been rock solid for me in the almost 15 years I've used it. This is just that one area where I feel could do with some improvements.
Maybe there is some combination of settings that will get it to cache more aggressively; just saying that it's not a given that it will do so.
/sys/module/zfs/parameters/zfs_arc_max
or setting the module e.g. in /etc/modporbe.d/zfs.conf
to something like this options zfs zfs_arc_max=<size in bytes>
). But be careful, as the ZFS ARC does not play that nice with the OOM killer.I'm using Jellyfin server and Infuse on Apple TV, so I don't have a great way to force-slurp a file on first read, at least not without patching Jellyfin. And I'm not super eager to learn C#.
Even if I were streaming to mpv, most of my lan is only gigabit which is much less than what my storage array can put out.
http://jolly.jinx.de/teclog/2012.10.31.02-fusion-drive-loose...
have a ssd ie mounted in /tmp/movies
and create a script in .bin/ (or whatever)
#!/bin/sh
tmp_m="/tmp/movies/$(mktemp -d)"
cp "$@" $tmp_m
mpv $tmp_m
rm $tmp_m
please note i have not tried the script but it probably works
Edit: demuxer-max-bytes=2147483647
I'm unsure if they ship any macs with these anymore. I guess not since the Apple Sillicon iMacs don't have spinning hard drives?
You can do all sorts of really neat things. You can define pools of drives at different cache levels. You can have a bunch of mechanical drives for deep storage, some for hot storage, SSD to cache recently read files, then write-through from the SSD down to mechanical drives, either immediately or after a delay.
It's pretty much everything I could wish for from a filesystem, though I haven't actually taken the time to try it out yet. AFAIK it's still somewhat experimental, more or less in beta.
Edit: or maybe it was some drama over userspace tooling, I can't remember tbh.
https://jonathancarter.org/2024/08/29/orphaning-bcachefs-too...
ZFS has caching for writes (SLOG)[0][1] and reads (L2ARC),[2][3] which was introduced many years ago when HDDs were cheap and flash was still very, very expensive:
* https://www.brendangregg.com/blog/2009-10-08/hybrid-storage-...
[0] https://openzfs.github.io/openzfs-docs/man/master/7/zpoolcon...
[1] https://openzfs.github.io/openzfs-docs/man/master/8/zpool-cr...
[2] https://openzfs.github.io/openzfs-docs/man/master/7/zpoolcon...
[3] https://openzfs.github.io/openzfs-docs/man/master/8/zpool-ad...
Also, the L2ARC is great, but does still have RAM overhead. There are also useful tunables. I had a workload on a RAM limited machine where directory walking was common, but data reads were fairly random and a L2ARC configured for metadata only speed it up by a large amount.
Not really.
It will accumulate synchronous writes into the ZIL, and you put the ZIL on a fast SLOG vdev. But it will only do so for a limited amount of time/space, and is not meant as a proper write-back cache but rather as a means to quickly service synchronous writes.
By default asynchronous writes do not use the ZIL, and hence SLOG vdev at all. You can force it to, but that can also be a bad idea unless you have Optane drives as you're then bottlenecked by the ZIL/SLOG.
A SLOG needs to have: good throughput and low latency at a queue depth of 1.
cat filename > /dev/null
Reads the entire file into the OS buffer. cache=yes
demuxer-max-bytes=5G
demuxer-max-back-bytes=5Ga LOT.
I dug into it and even without ANY vms or containers runnning, it writes a bunch of stuff out every second.
I turned off a bunch of stuff, I think:
systemctl disable pve-ha-crm
systemctl disable pve-ha-lrm
But stuff like /var/lib/pve-firewall and /var/lib/rrdcached was still written to every second.I think I played around with commit=n mount and also
The point of this is - I tried running proxmox with zfs, and it wrote to the disk even more often.
maybe ok for physical hard disks, but I didn't want to burn out my ssd immediately.
for physical disks it could be noisy
For example, I'm interested in setting up a new RAID-Z2 pool of disks and would like to minimize noise and number of writes. Should I use 4 drives or 6? Also, what would be the optimal block size(es) in this scenario?
45 helium HDDs themselves are relatively quiet.
PS: I ditched non-Solaris ZFS several years ago after ZoL destroyed itself unable to mount RW and the community shrugged at glaring fragility. XFS + mdadm (raid10) are solid and work. Boring and reliable get less press, but I like working over not working. Maybe folks here run Sun Thumpers at home which would be a form of ZFS that works.
Yeah, server vendors are a bit crazy with small jet engine fans. A 4U chassis could easily house 80, 92 or even 120 mm fans which could spin much slower with a much higher air flow. That would of course also be much more efficient.