ECC RAM Still Needed? 80% usage limit?

NightNetworks

Explorer
Joined
Sep 6, 2015
Messages
61
When I built my FreeNAS Server about 4 years ago the general thinking was ECC RAM was needed and one should not exceed 80% usage, rules that I am still following to this day. I recently joined that FreeNAS Sub-Reddit and it appears that most people over there say that ECC RAM is no longer needed and that it was never really needed. As well as saying that there is no longer a 80% usage limit. Is this information true for new versions of FreeNAS? Or is this Sub-Reddit passing out a lot of bad information?

Thanks!
 

rvassar

Guru
Joined
May 2, 2018
Messages
972
When I built my FreeNAS Server about 4 years ago the general thinking was ECC RAM was needed and one should not exceed 80% usage, rules that I am still following to this day. I recently joined that FreeNAS Sub-Reddit and it appears that most people over there say that ECC RAM is no longer needed and that it was never really needed. As well as saying that there is no longer a 80% usage limit. Is this information true for new versions of FreeNAS? Or is this Sub-Reddit passing out a lot of bad information?

Thanks!

I would say the guidance here conflicts with both those positions. ECC memory is still recommended, as is keeping your pool utilization under 80%.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I recently joined that FreeNAS Sub-Reddit and it appears that most people over there say that ECC RAM is no longer needed and that it was never really needed.
ECC memory is not significantly more expensive than non-ECC memory and the reason for having it is reliability. Many people that don't understand servers and high reliability systems don't see the need for ECC. Their failure to understand does not make them correct.
As well as saying that there is no longer a 80% usage limit.
This limitation is about performance. When the pool is filled above 80%, performance begins to degrade and it really falls off a cliff when you go over 90%. This recommendation is (similar to the memory) about ensuring that you are having a good experience with your system.
Is this information true for new versions of FreeNAS?
These things are true of the ZFS file system (regarding the pool capacity) and true of all server systems with regard to ECC memory.
Or is this Sub-Reddit passing out a lot of bad information?
They are providing their opinion. I am providing mine. My sentiments are based on having worked as an Information Technology support provider (IT Professional) since 1997. I have been a manufacturer certified repair technician for IBM, HP, Compaq (when it was a separate company), NEC (when they still made computers) and others. There are good reasons for buying server grade hardware if you are building a server. Most people that want to use non-ECC memory do so because they want to buy cheaper components. You can look at the underlying reasons for suggestions and determine if the person is suggesting it because they want the best result or because they are trying to save money and see, then it is a choice, what matters most to you. I choose to build my system based around reliability because the data I store matters most to me. I could create a storage system for less money with cheap garbage parts, but I would not be comfortable with the security of my data. If you need to save money, there are ways to cut costs without risking your data.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Another point about ECC memory. Regardless of the possibility to inflict direct damage to any stored data, if you have a bad memory module in a system that does not support ECC, there is no way for the system to detect that there has been an error or that the memory module is bad. What you see as a symptom of a bad memory module is random crashes of the system. You won't have any indication of why, the system will just crash because the bad memory will affect something critical and down goes the system.
Systems with ECC can usually tell you not only that a module is bad, but which module it is that is bad. Depends on how good the BIOS / UEFI is.

I have also seen files be corrupted by bad data getting into information being recorded to disk. The easy way to see it is with JPG files. You save a file and when you go back to it later, it looks like this:

1558372944345.png

Text files will end up with garbage characters randomly injected in them and videos will become unplayable. I had a system, back in the day of windows 98 / 2000 that had a hardware RAID controller that ruined all the data on the array like this.
People need to decide what is more important and choose wisely.
 

John Doe

Guru
Joined
Aug 16, 2011
Messages
635
as per my understanding; It depends....

As far as I understood:
ECC RAM can minimize the risk of bit flips, due to e.g. cosmic radiation.

For instance, you copy a picture to your freenas, usually it will be buffered in the RAM and then be written to the disc.
Freenas or lets say ZFS will do check sums whenever possible, the network will do CRC checks to verify correct receipt. There will be another check if it is written correctly on the disc, etc.

but there is one problem, the memory, in case you do not use ECC, there is no possibility to correct or at least to verify integrity of the data.
so it might be the case, that during the copy of the picture to your NAS, cosmic radiation can flip bits within the RAM.
Since the system will not get notifications, it will just copy the corrupted picture to your NAS.

ECC ram is one part of the whole chain of the ZFS concept. without it you might weakened the integrity of your data.
In case your data is less "costly" than the price for ECC ram, go without.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
ECC has never been "required", but it has always been "recommended"--and this is the case for any kind of server, under any operating system, with any filesystem, if you care about your data. There's nothing about FreeNAS or ZFS which makes non-ECC memory any more risky than it is anywhere else (the "Scrub of Death" is pure FUD).
 

microserf

Dabbler
Joined
Dec 7, 2018
Messages
46

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
It's a performance threshold. A quick look found:
https://www.reddit.com/r/freenas/comments/bqw8qg/what_happens_when_you_exceed_the_80_space/
A metaslab is a piece of the slab, not a view of all free space in the pool. Care to provide a few more examples?
The person in the cited conversation is pointing to code from the opensolaris github.
I would like to see code from the FreeNAS or FreeBSD github before I was confident that their assertion is also correct for FreeNAS.
The 80% threshold has always (to my knowledge) been a warning to allow you an opportunity to do something about it.
The point where things changed was historically stated to be 90%.
What kind of example are you looking for?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
@dlavigne , could we get you to give us some insight on this question?
 

NightNetworks

Explorer
Joined
Sep 6, 2015
Messages
61
Wow! Thanks for all of the feedback this is great and exactly what I wanted. That Reddit post is the exact post that made me ask this question...
 

microserf

Dabbler
Joined
Dec 7, 2018
Messages
46
I would like to see code from the FreeNAS or FreeBSD github before I was confident that their assertion is also correct for FreeNAS.
Is this what you're looking for?
https://github.com/zfsonfreebsd/ZoF/blob/projects/zfsbsd/module/zfs/metaslab.c#L145

The redditor asserted two conflicting generalizations in response to the OP:
  1. "Nothing"
  2. "...write performance goes down."
My response to the explanation: A metaslab is a piece of the slab, not a view of all free space in the pool.

What kind of example are you looking for?
A few more examples from the sub-reddit about the 80% usage limit/threshold, though NightNetworks seems to have answered that:
That Reddit post is the exact post that made me ask this question...
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Is this what you're looking for?
That looks like it.

It doesn't surprise me that the actual number is different from the 90% number that has been repeated for years in the forum. I don't know if this represents a change or (if it is a change) when it may have changed. @jgreco might have some insight but I don't know if either he or @dlavigne will be able to take time to look at this.
Personally, I don't want to get my storage system that full because the disks also slow down, from a purely mechanical standpoint, as they get full, so it is not just a property of this ZFS algorithm.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
As well as saying that there is no longer a 80% usage limit.

It's Reddit. There's no usage limits and non-ECC works better than ECC and ZFS works better with less memory and all that crap. We lie like rugs over here at FreeNAS Forums and all that.

Most of the things we advise people are in pursuit of the safety of your data and pleasantness of the ZFS experience.

For example, while it is technically correct that there is no "80%" usage limit, and you really can get all the way up to about 98% before things start going really wonky, the problem is that over time, this can result in insane fragmentation, which will cause performance problems.

We've historically pegged a safe limit at around 80% for average uses, but this can be much lower (25-50%) for specific applications such as block storage or databases. The 80% originally came from Sun/Oracle, who have since upped that to 90% sometime after ZFS v5. The lower number is always going to be better.

https://www.ixsystems.com/community/threads/sizing-for-zvol-with-compression.61945/

One of the *many* places I discuss fragmentation and the 50% rule. Wait, what?! There's also a 50% rule?!

https://extranet.www.sol.net/files/freenas/fragmentation/delphix-steady-state.png

This graph shows a fascinating property of ZFS, which is what write speeds are like once a lot of write/free activity has gone on and pool performance has settled into a steady state. This is the thing most benchmarks fail to actually test, but it's the thing you may have to live with if you have a long life pool.

So the real problem here is that ZFS mitigates fragmentation two ways: for writes, it relies on large amounts of contiguous free space. For reads, it prays that sequential data was written contiguously and when that isn't the case it relies on ARC/L2ARC to mitigate. On a pool with plenty of free space, like 10%, you can get SSD-like write speeds for your writes. On a pool with very little free space, like 95% with fragmentation, write speed will be very bad because the system has to work hard and seek to find free disk space.

But if you look at the Delphix graph, something else becomes clear... you've lost most of your write performance by the time you are maintaining a busy pool that's 50% occupancy. It doesn't drop to that low performance level immediately. It does so over time, as more rewrites add to the fragmentation, until you finally plateau at that steady state number.

So the real question is if this matters. If you're storing VM block data or running SQL on it, it absolutely matters, and you want to run mirrors, and you want to seriously consider limiting pool occupancy to 25-50%.

If you're creating a file archive of write-once never-removed data, you can wind it all the way up to 98% with minimal impact, because fragmentation is created by the free/rewrite cycle, which won't happen (much) on such a pool.

On the average use case pool, if you don't need high performance, again, you can probably get out to 90% without much drama, 95% with some drama. But keeping it below 80% will be faster.

So it isn't a simple answer, and there's a variety of numbers that are relevant. It's a multivariable game of time, write frequency, and pool occupancy. Most people don't want to earn a degree in CS filesystem theory to understand their ZFS system, so, yes, we simplify this a bit and put out numbers that are likely to be reasonable. 80% for a normal pool is generally safe. 50% for a block storage pool is generally the point at which you should consider stopping. If you don't mind the performance hit you can go as far as you like, up to about 98%. After that point, ZFS is pretty much guaranteed to suck intensely no matter what you're doing.

I suppose Reddit didn't bother to fill in most of those details...?
 

microserf

Dabbler
Joined
Dec 7, 2018
Messages
46
https://extranet.www.sol.net/files/freenas/fragmentation/delphix-steady-state.png
...
But if you look at the Delphix graph, something else becomes clear... you've lost most of your write performance by the time you are maintaining a busy pool that's 50% occupancy.
Do you have a source for that graph? I've looked around a bit in the past without much success. Based on some bookmarks I found, this:

https://www.delphix.com/blog/delphix-engineering/zfs-write-performance-impact-fragmentation

was as close as I could get.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Do you have a source for that graph? I've looked around a bit in the past without much success. Based on some bookmarks I found, this:

https://www.delphix.com/blog/delphix-engineering/zfs-write-performance-impact-fragmentation

was as close as I could get.

It looks like they trashed the graphics in that article. That seems likely to have been it, although I seem to recall several articles from them around that era. I cache things like this myself since the web tends to be lossy.
 
Top