News for hackers. Stuff that matters.
Re:In OpenZFS and Btrfs, everyone was just guessing by donmcronald on Thursday November 30, 2023 @08:26AM (#38473197)
I don't know about BTRFS, but with ZFS there's a lot of bad information and assumptions floating around. It's one of my favorite topics to ask AI about because it shows the obvious deficiencies in AI as it regurgitates all the bad info. So when you go to the issue tracker, it seems plausible to me that you're going to find issues where the devs can't explain what's happening because the user(s) might be doing something crazy.

With the exception of a couple people like Jim Salters, I don't take any advice I see about ZFS unless I know the person is a dev or has commits on the project. And most of the time I take the advice I've seen 'ryao' post which is, paraphrased, "use the defaults unless you know what you're tuning". That should go without saying, but there are a lot of armchair "geniuses" posting online about ZFS and they are just guessing.

And, how to you get any new developers if the expectation is an immediate, complete understanding of the system? That just isn't realistic and, in most cases, the dev that knows a little bit probably knows exponentially more than an average user. Interacting on the bug tracker and debugging things they don't completely understand is going to improve their understanding. There's value there.

Things have gotten more complicated too. We aren't using spinning disks without caches any more, right? I can understand a disk from 20 years ago. They're relatively simple. I couldn't tell you the first thing about SSDs or NVMe stuff.

There are going to be bugs. Just be glad the devs acknowledge them and fix them. Personally I still rank ZFS as the least likely to lose my data and I'll keep using it. I put roughly zero value in a forum full of people complaining.

Re:In OpenZFS and Btrfs, everyone was just guessing by solarkraft on Thursday November 30, 2023 @11:21AM (#38475352)
A lot of end users run ZFS through TrueNAS/FreeNAS and I indeed found that community to spread a lot of misinfo and un-actionable advice. I liken them to gamers lapping up any snake oil solution to get 0.1 fps more. I would suggest anyone trying to learn about ZFS to avoid it, it definitely was counter-productive to me.

Reddit, random blogs and official documentation (often that by Oracle) turned out to be much better resources.

Re:In OpenZFS and Btrfs, everyone was just guessing by favorited on Thursday November 30, 2023 @04:18PM (#38479269)
I think it comes down to the fact that the TrueNAS developers treat it as an appliance (which is a good thing, IMO). However, because so many people's only experience with ZFS is TrueNAS, when iXsystems says "Doing X on TrueNAS is a bad idea, that's not a configuration we support," it gets cargo culted as "doing X on ZFS is bad."
Re:In OpenZFS and Btrfs, everyone was just guessing by bpbp-mango on Thursday November 30, 2023 @08:59PM (#38482051)
Using it through something like TrueNAS with sensible defaults is probably a better idea for the average person than trying to roll their own deployment, no?
Re:In OpenZFS and Btrfs, everyone was just guessing by angus-prune on Thursday November 30, 2023 @09:41PM (#38482365)
Im not sure running TrueNAS counts as learning ZFS, which I think is GP's point.

If you want to use ZFS, then TrueNAS with sensible defaults is a great way to go. If you want to learn ZFS enough to roll your own deployment, change the configuration correctly and understand the changes you make then don't start with TrueNAS, and definitely don't listen to the TrueNAS community.

Or at least, that's how I read the GP comment.

Re:In OpenZFS and Btrfs, everyone was just guessing by donmcronald on Friday December 01, 2023 @10:00AM (#38487457)
> If you want to use ZFS, then TrueNAS with sensible defaults is a great way to go.

I evaluated TrueNAS Scale about 6 months ago and bailed on it very quickly. My install with their "sensible defaults" ended up having swap partitions on all my spinning disks. That alone was enough for me to decide against using it. One bad choice likely means other bad choices in my experience. They also trampled / reset my 'zfs_zrc_max' tunable every time a VM got started (I think) and it wasn't obvious what was doing it.

I didn't think there was any value in learning the quirks of TrueNAS over doing a setup from scratch, so I ended up going with Ubuntu LTS and doing all my own config / testing.

Re:In OpenZFS and Btrfs, everyone was just guessing by pixl97 on Friday December 01, 2023 @10:16AM (#38487674)
I mean, pretty much if you want to learn anything you're going to have to put a lot of time into it. With ZFS it will be building different servers with different disk layouts and figuring out how to test and benchmark those options. Which just takes an absolutely massive amount of time.

I know, I was doing just that 5+ years ago.

Commercial storage vendors aren't really any different. Mostly the biggest difference here is they offer a very limited subset of hardware and disk configurations and tend to iterate over that very small configuration space. Step outside of that config space and they won't have much insight.

This remind me of the earlier days of Mac vs PC. Mac tended to have a very small hardware set of supported devices, and in many ways helped stability. PC supported pretty much anything you threw at it, which commonly had issues with crappy drivers and untested interactions.

Re:In OpenZFS and Btrfs, everyone was just guessing by withinboredom on Friday December 01, 2023 @09:52AM (#38487334)
Reminds me of a game (MMO) I play on the weekends. Any time someone new joins, they always ask how come frame rates are so low. Then we begin the ”set your graphic settings to high” conversation. They immediately say we are full of shit. It’s already set to low and getting 10 fps.

Eventually, someone explains: “just try it, or stop complaining.”

30s later, they exclaim: “holy ** I’m getting 60 fps now!”

Sometimes, what looks like misinformation isn’t misinformation.

TL;DR: this game switches to a software rendering pipeline on “medium” or lower. You have to set it on “high” to switch to the hardware rendering pipeline.

Re:In OpenZFS and Btrfs, everyone was just guessing by jeegsy on Friday December 01, 2023 @04:29PM (#38492705)
Wow! Thats a great story
Re:In OpenZFS and Btrfs, everyone was just guessing by Am4TIfIsER0ppos on Saturday December 02, 2023 @11:06AM (#38499548)
Is that a visible option somewhere or do you only have one setting, the preset?
Re:In OpenZFS and Btrfs, everyone was just guessing by withinboredom on Saturday December 02, 2023 @01:06PM (#38500512)
The preset is the only way to influence it.
Re:In OpenZFS and Btrfs, everyone was just guessing by hotpotamus on Thursday November 30, 2023 @11:43AM (#38475650)
One of my favorite comments chains here was was something to the affect of:

Commenter posts a nice summary of how ZFS will try a quick compression algorithm to see if a block is even compressible and then try other more expensive ones to achieve better compression.

Another commenter asks how they know that.

First commenter replies that they wrote the code for it.

Nothing more than a ZFS user (to some extent my company relies on it even) here, so I just try and color inside the lines, but I'm ever impressed by it.

Re:In OpenZFS and Btrfs, everyone was just guessing by rincebrain on Thursday November 30, 2023 @08:33PM (#38481850)
Re:In OpenZFS and Btrfs, everyone was just guessing by hotpotamus on Friday December 01, 2023 @09:08AM (#38486810)
That is it, thank you.
Re:In OpenZFS and Btrfs, everyone was just guessing by RantyDave on Thursday November 30, 2023 @03:23PM (#38478565)
On the other hand there are a couple of things in ZFS that can make a big difference. For instance: changing the page size to be the same size as Postgresql uses (8kb); disabling the writing of 'last accessed' timestamps; or whether or not the filesystem attempts deduplication. From what I remember (it's been a while) these can be configured on a per-dataset basis, where a dataset is a lightweight filesystem more akin to a directory, and many of them can be changed on a live filesystem.

Here, have at it: https://openzfs.github.io/openzfs-docs/man/master/7/zfsprops...

So personally I'd encourage messing around (on something non-prod, of course). Measure measure measure! Does it actually make any difference.

It's a shame a bug crept in to an otherwise pretty much faultless filesystem. I'm sure there are some truths in there about commercial support or not running the bleeding edge or whatever. And making backups, even for ZFS backed filesystems. Sacrilege, I know.

Re:In OpenZFS and Btrfs, everyone was just guessing by 3np on Thursday November 30, 2023 @08:39PM (#38481897)
> whether or not the filesystem attempts deduplication

Unless I'm just parroting truisms here, dedupe is almost never a good idea and compression is a much more common case-by-case.

> So personally I'd encourage messing around (on something non-prod, of course). Measure measure measure! Does it actually make any difference.

100%. So much depends on the particular workload and resources.

> And making backups, even for ZFS backed filesystems. Sacrilege, I know.

Logical backups, specifically. We have seen more than once corruption and data-loss in replicated encrypted snapshots due to bugs in ZFS.

Re:In OpenZFS and Btrfs, everyone was just guessing by colechristensen on Thursday November 30, 2023 @10:51PM (#38482914)
Deduplication requires an absolutely enormous amount of memory, unless you have a dataset that has a huge amount of duplication for some reason (maybe a company or school where a lot of people have their own network storage and put the same large files in?) it is usually never the right choice to enable dedup.

It is cheaper to buy more disk than the memory to enable dedup (somebody could run the numbers). ZFS ARC also likes lots of memory and you get good performance gains with more memory allocated to it.

In other words, turn on LZ4 compression everywhere and don’t think about it otherwise.

Re:In OpenZFS and Btrfs, everyone was just guessing by 3np on Friday December 01, 2023 @12:09AM (#38483381)
This is my understanding as well. These days we default to zstd, though.
Re:In OpenZFS and Btrfs, everyone was just guessing by erhaetherth on Friday December 01, 2023 @01:13AM (#38483730)
Oh good, I have it off. I was pondering that feature years ago when I set it up. Couldn't remember where I landed.
Re:In OpenZFS and Btrfs, everyone was just guessing by keep_reading on Friday December 01, 2023 @09:19AM (#38486938)
Deduplication in ZFS can be pushed onto dedicated flash storage now instead of requiring gobs of RAM.
Re:In OpenZFS and Btrfs, everyone was just guessing by ungamedplayer on Friday December 01, 2023 @09:46AM (#38487244)
Great channel for side attacks btw.
Re:In OpenZFS and Btrfs, everyone was just guessing by nolist_policy on Friday December 01, 2023 @09:56AM (#38487404)
Doesn't even need SSD's to open a side-channel: https://lore.kernel.org/linux-btrfs/CAKDzk=-HZardsLFH5c9HYre...
Re:In OpenZFS and Btrfs, everyone was just guessing by keep_reading on Friday December 01, 2023 @03:54PM (#38492233)
Without having physical access to my hardware, where every disk is FDE anyway?
Re:In OpenZFS and Btrfs, everyone was just guessing by ungamedplayer on Tuesday December 05, 2023 @01:55AM (#38527851)
Physical access not required. Dedupe side attack required timing measurement.
Re:In OpenZFS and Btrfs, everyone was just guessing by ungamedplayer on Sunday December 03, 2023 @07:27AM (#38506579)
Oh got some hate there.. pissed off the zfs kids with a dose of reality.

Dedupe can be used to infer secret data. .. more news at 11

Re:In OpenZFS and Btrfs, everyone was just guessing by CMCDragonkai on Friday December 01, 2023 @07:21PM (#38494458)
How to do this?
Re:In OpenZFS and Btrfs, everyone was just guessing by eternityforest on Saturday December 02, 2023 @06:10AM (#38497750)
Data loss bugs in ZFS?? Wow.

My personal approach to filesystem evaluation is pretty much "How long has it been since I've seen someone talk about a data loss bug". This is my first time hearing one for ZFS. BTRFS seems to have at least one post a year. Ext4 has almost none, but maybe that's because people trust it and blame hardware when unsure what the issue is.

Re:In OpenZFS and Btrfs, everyone was just guessing by 3np on Saturday December 02, 2023 @08:34AM (#38498511)
Comparing zfs/btrfs with ext4 is not entirely fair. They're in different domains when it comes to scope and features. To some extent, silent corruption in ext4 is expected but in zfs it's a bug.
Re:In OpenZFS and Btrfs, everyone was just guessing by chungy on Thursday November 30, 2023 @10:55PM (#38482948)
> changing the page size to be the same size as Postgresql uses (8kb)

Mind, you shouldn't really change the record size without knowing your use-case. Make a PostgreSQL file system, set it's recordsize to 8k. That's a good idea.

Not so much a good idea doing that to all your filesystems. Stick to the defaults without a good justification to deviate.

Re:In OpenZFS and Btrfs, everyone was just guessing by BSDobelix on Friday December 01, 2023 @04:02AM (#38484708)
For Postgres just follow the original doc:

https://openzfs.github.io/openzfs-docs/Performance%20and%20T...

compression=lz4 recordsize=32K

In postgres -> full_page_writes=off

Re:In OpenZFS and Btrfs, everyone was just guessing by auspiv on Friday December 01, 2023 @10:06AM (#38487534)
But also experiment with recordsizes of 8k and 16k. The larger the recordsize, the more potential compression you get, which may be offset by additional delay caused by read/modify/write of the larger record (i.e. reading/writing 32k instead of 8k or 16k).
Re:In OpenZFS and Btrfs, everyone was just guessing by BSDobelix on Friday December 01, 2023 @11:05AM (#38488275)
True, with platter storage i tend more to 32k with nvme more toward 16k. But yes testing is a good thing, but some settings should be just untouched if one is not absolutely sure it's a good thing, aka logbias=throughput.
Re:In OpenZFS and Btrfs, everyone was just guessing by sgarland on Friday December 01, 2023 @08:25AM (#38486383)
Also, compression. CPUs are more than capable of handling it on the fly, and the reduced dataset size helps IO.

This [0] is a brief post on MySQL, but most of it applies equally to Postgres.

[0]: https://www.percona.com/blog/mysql-zfs-performance-update/

Re:In OpenZFS and Btrfs, everyone was just guessing by doublepg23 on Friday December 01, 2023 @07:25PM (#38494483)
I'd be curious if the addition of zstd compression has any effect on the results. Could be a fun follow-up follow-up :-)
Re:In OpenZFS and Btrfs, everyone was just guessing by yakubin on Friday December 01, 2023 @05:44PM (#38493590)
> disabling the writing of 'last accessed' timestamps

atime is the most useless filesystem feature I’ve heard of. But on most Unix-like systems it’s enabled by default and the main thing it does is turn reads into writes, degrading performance. All the while ctime isn’t a standard Unix filesystem feature. And ctime to me always seemed infinitely more useful (and cheaper!) than atime.

</rant>

Re:In OpenZFS and Btrfs, everyone was just guessing by mischief6 on Saturday December 02, 2023 @01:22AM (#38496423)
while it is unfortunate it requires a write, it is useful in some cases. for example, finding old objects in a cache, or today i used it to find out what firmware my kernel is loading by checking atime of /lib/firmware.
Re:In OpenZFS and Btrfs, everyone was just guessing by mike_hock on Saturday December 02, 2023 @05:42AM (#38497625)
So it's useful as a debugging feature that you might want to briefly turn on once every decade.

Finding old objects in a cache is an issue specific to caches and should be implemented there.

Re:In OpenZFS and Btrfs, everyone was just guessing by cromka on Saturday December 02, 2023 @06:32AM (#38497860)
For the latter you could enable it, reboot and get the same information right away, then disable it?
Re:In OpenZFS and Btrfs, everyone was just guessing by mischief6 on Saturday December 02, 2023 @12:30PM (#38500181)
i did not see a clear list of all firmware files read by the kernel in dmesg, so the find/atime trick worked well.
Re:In OpenZFS and Btrfs, everyone was just guessing by yencabulator on Wednesday December 06, 2023 @11:50AM (#38546338)
relatime has been the Linux default since 2009. It makes that be one write per 24 hours.
Re:In OpenZFS and Btrfs, everyone was just guessing by nailer on Friday December 01, 2023 @12:18PM (#38489304)
> So when you go to the issue tracker, it seems plausible to me that you're going to find issues where the devs can't explain what's happening because the user(s) might be doing something crazy.

No, that is not plausible. It's a filesystem. Behaviour in all cases for a filesystem should be predictable. There are zero things a user should be able to do that would make a filesystem non deterministic.

Re:In OpenZFS and Btrfs, everyone was just guessing by hdjdkdbdbe on Friday December 01, 2023 @05:22PM (#38493342)
Tbh guessing is part of the way to solve a bug. You need to make a hypothesis and the test if it is true. If not try another.

Saying the zfs/btrfs teams have no idea means the person has no idea about software development process ... It is a system none fully knows a system that complex.

If they did, the bug wouldn't have happened.