News for hackers. Stuff that matters.
Re:Best CPUs for Workstations: 2017 by keldaris on Thursday October 05, 2017 @09:09AM (#15408817)
Just to offer a partial counterpoint to the popular "ECC is a must for real work" sentiment, I've ran many 60-day simulations where a few bit errors would be completely irrelevant. Many physics simulations include internal checks (that must be there regardless of ECC, for algorithmic reasons) that would catch virtually all such issues. While a bit error could certainly crash the simulation, long running simulations can be resumed from checkpoints with minimal loss of time and the probability of a crash is still very low for most real workloads.

In truth, there are plenty of good reasons, both for data integrity and security, to have ECC. However, there are real costs to ECC too - 10-30% immediate performance overhead (depending on your application) and much more than that for memory-bound workloads (due to lower frequencies and subtiming issues), not to mention hardware cost efficiency. Instead of oscillating between "ECC for everything" and "ECC is useless" people should rationally compare the costs and benefits for their specific workload and choose accordingly.

Re:Best CPUs for Workstations: 2017 by Retric on Thursday October 05, 2017 @10:00AM (#15409180)
ECC has no where near 30% performance overhead.

In terms of speed it's ~2–3 percent slower worst case, and memory is only one component of overall performance lowering the impact further.

More importantly, bit errors are not evenly distributed with some users seeing vastly more errors.

Re:Best CPUs for Workstations: 2017 by keldaris on Thursday October 05, 2017 @02:03PM (#15411180)
The performance penalties I'm referring to are memory performance penalties. If your workload isn't memory-bound (and most aren't), you'll measure a difference of 2% or less, sure, but that's not really relevant when talking about memory performance. In extreme cases (such as, for instance, lattice Boltzmann simulations, where the streaming step is completely memory bound) I've seen over 50% performance degradation, but much of it can be attributed to the notoriously loose timings on most ECC DRAM.
Re:Best CPUs for Workstations: 2017 by dijit on Thursday October 05, 2017 @07:24PM (#15413329)
I feel I have the relevant real world expertise to have a say about that.

I am one of the principle engineers working on a game that was able to support over 1.2 million players concurrently, so I feel that I have some merit behind what I'm about to say.

ECC Memory does not have such an extreme overhead. Our gameserver is memory bandwidth bound. To put that into perspective a change from DDR3 to DDR4 saw a jump in performance of 34%~. Using non-ecc memory (which is obviously very available to the development team) only gave a penalty of roughly 3% in the worst case. (both DDR4 systems).

Why are we memory bandwidth bound? because we allocate 250GB of "game world" and phases and make teeny tiny modifications to them when you run around or pick up loot and shit. It's as taxing as you can be on memory bandwidth since you can't batch set or load anything.

Re:Best CPUs for Workstations: 2017 by eightysixfour on Thursday October 05, 2017 @07:53PM (#15413475)
I think what he is trying to say is there isn’t a lot of DDR4 out there at 3200mhz with tight timings like there is with non-ECC memory, not just that ECC vs non-ECC at the same specs is 10-30% slower.
Re:Best CPUs for Workstations: 2017 by keldaris on Friday October 06, 2017 @03:21PM (#15419615)
That's right, I'm sorry if I worded it ambiguously in my previous posts. ECC RAM is considerably slower than non-ECC RAM, but nowadays it's mostly because of looser timings and lower frequencies. I'm well aware that there are people who claim that frequencies beyond the ECC standard are liable to cause data loss (for reasons usually left unspecified), but I've never seen any reliable data to support that claim, as long as the frequencies and timings tested by the manufacturer are maintained (not to be confused with people who overclock RAM way beyond its tested specification and experience instability).

On a further note, while the implementation of ECC itself is very fast for modern RAM, the same is not true of VRAM on GPUs. At least as implemented in NVidia Tesla GPUs, enabling ECC has a huge performance penalty by itself. [1]

[1] http://geoceano.fr/wp-content/uploads/2015/01/cpu-gpu-lbm-in...

Re:Best CPUs for Workstations: 2017 by Retric on Friday October 06, 2017 @07:02PM (#15421075)
I think some of this breakdown is from motherboard support. You can MB that supports a single CPU and 128GB for DDR4 4400 which is significantly higher than ECC.

When you start looking at multi CPU computers with 1+TB of ram the story changes.

PS: Some of this stuff is also really hard to test. Without ECC it's hard to data in terms of stability for petabytes of ram over years. And no extrapolations don't work very well.

Re:Best CPUs for Workstations: 2017 by Retric on Thursday October 05, 2017 @02:43PM (#15411558)
[Citation Needed] With identical memory ECC and non <2% is the actual memory overhead.

Now, non ECC memory might have better specs / a higher overclock rate etc, but doing either of those increases the rate of errors. And sure you might not notice the problem directly, but that does not mean things are ok.

Re:Best CPUs for Workstations: 2017 by TrainedMonkey on Thursday October 05, 2017 @12:26PM (#15410425)
Can you elaborate on that distribution?
Re:Best CPUs for Workstations: 2017 by Retric on Thursday October 05, 2017 @12:42PM (#15410573)
The main causes are altitude/background radiation, temperate, overclocking, faulty parts etc. But, memory can have 100+x the normal failure rates without being particularly noticeable in day to day operations.

The value of ECC is often more to detect errors than to correct them. Remember, if you have 10 errors an hour then you unlikely to see them in a 20 second memory test.

In practice out of 10,000 machines you might have 1/2 your errors on 10 of them. Critically, if you have ECC memory and you both detect and replace those 10 machines the apparent rate of failures then drops.

PS: This is a little dated (09) and only from a single set. But, still an interesting introduction: https://www.cs.toronto.edu/~bianca/papers/sigmetrics09.pdf "Around 20% of DIMMs in Platform A and B are affected by correctable errors per year, compared to less than 4% of DIMMs in Platform C and D. ... About a third of all machines in the fleet experience at least one memory error per year (see column CE Incid. %) and the average number of correctable errors per year is over 22,000. "

Re:Best CPUs for Workstations: 2017 by keldaris on Thursday October 05, 2017 @02:00PM (#15411155)
As I understand it, the situation is even better (as in, less errors) than that with DDR4. Unfortunately, all the published data I could find is woefully out of date. Still, even if you generously assume something on the order of one correctable memory error per machine year, how many of those errors do you actually care about? Unless you have 100% memory utilization for 24/7 critical tasks, most of those errors probably don't even matter.

EDIT: the least out of date reference I could find is a blog post by Jeff Atwood, where he concludes that based on the available literature ECC-correctable errors are quite rare. [1]

[1] https://blog.codinghorror.com/to-ecc-or-not-to-ecc/

Re:Best CPUs for Workstations: 2017 by Retric on Thursday October 05, 2017 @02:39PM (#15411524)
The median performance for non ECC memory is very good. The problem is worst case performance is hard to detect and much much worse than that.

"The median number of errors per year for those machines that experience at least one error ranges from 25 to 611." "We find that for all platforms, 20% of the machines with errors make up more than 90% of all observed errors for that platform."

A minority of that 20% again have even more issues.

The worse case is literally 10,000x more than 1 bit error per year on a single machine. Without using ECC you really can't tell other than some vague not sure what's wrong just replace it.

Re:Best CPUs for Workstations: 2017 by sillysaurus3 on Thursday October 05, 2017 @06:06PM (#15412926)
Many physics simulations include internal checks (that must be there regardless of ECC, for algorithmic reasons) that would catch virtually all such issues.

Hmm, like what? I've run many simulations too and had the opposite experience. It's hard to implement checks because your algorithm defines how the simulation should permute over time.

While a bit error could certainly crash the simulation, long running simulations can be resumed from checkpoints with minimal loss of time and the probability of a crash is still very low for most real workloads.

Not really. Your algorithm determines how the simulation plays out, so you can't really notice small errors until much later. By then it's hard to roll back to an earlier state unless you're saving 64GB snapshots.

Re:Best CPUs for Workstations: 2017 by twic on Friday October 06, 2017 @09:02AM (#15416437)
I don't know about checks, but any algorithm which works by iteratively converging on a solution, like Newton-Raphson and its bigger relatives, has quite a lot of bit-error tolerance built in.
Re:Best CPUs for Workstations: 2017 by keldaris on Friday October 06, 2017 @03:14PM (#15419561)
That's right, any iterative solver method (which already encompasses most of the low level numerical solvers used in physics today) or, more generally, any method that algorithmically guarantees satisfying a particular mathematical constraint after each timestep (say, if you're enforcing fluid incompressibility at each timestep, most* single bitflips will not cause errors that would accumulate over time), etc.

[*] There are exceptions in specific circumstances most of which would produce obviously wrong results or crash the simulation outright. However, I'm not claiming that single bitflips are never an issue for simulations, only that it happens much less often than people sometimes think.

Re:Best CPUs for Workstations: 2017 by sillysaurus3 on Friday October 06, 2017 @03:47PM (#15419819)
If a one-bit error causes the sign bit to flip, your position can go from 129,121.34 to -129,121.34. Obviously this is rare, but it seems mistaken to say that the simulation's parameters can prevent errors arising from this.

Also, it's not just physics simulations that are at risk. Voxel renderings are especially susceptible to one-bit errors.

Re:Best CPUs for Workstations: 2017 by keldaris on Friday October 06, 2017 @04:40PM (#15420290)
Not sure exactly what simulation you're referring to with the position example, in most of my code that would either be fixed in the next timestep or make the whole thing blow up immediately.

Anyway, I haven't argued against using ECC memory in any of these comments. I've argued that you should know your needs and choose accordingly, and that ECC memory isn't free and therefore cannot be a universally optimal default for everyone.

For much of my physics work I've found ECC memory not to be worth the cost at all. For other things, like most database servers (and perhaps voxel rendering, I don't have enough experience there to comment) ECC memory is clearly worth it. I just think people should invest some thought into the question before evangelizing for or against ECC in the general case.

Re:Best CPUs for Workstations: 2017 by dna_polymerase on Thursday October 05, 2017 @09:25AM (#15408931)
Thank you! That sentiment on HN about how "Everything should have ECC" really grinds my gears. There is no need for ECC in your iPhone or on your MacBook. Your average emoji-laden WhatsApp Conversation with your friends does not require Bit Error Correction. People who really need ECC do exactly what you just mentioned: Evaluate, and often enough they will find little to gain from ECC.
Re:Best CPUs for Workstations: 2017 by frou_dh on Thursday October 05, 2017 @10:10AM (#15409292)
It’s odd to talk about “needs” like this. iPhones don’t “need” the Secure Enclave either, but never the less it’s great that they have it.

It’s some kind of snobbery to advocate that good technology should be held back until non-enterprise plebs demonstrate that they are deserving of it.

Just give everyone the good technology as much as is possible. Who’s it hurting if some subjectively underutilise it?

Re:Best CPUs for Workstations: 2017 by tokenizerrr on Thursday October 05, 2017 @10:53AM (#15409623)
> Just give everyone the good technology as much as is possible. Who’s it hurting if some subjectively underutilise it?

Everyone who buys the product and doesn't require the technology, because they'll be spending more money on something they don't need or use.

Re:Best CPUs for Workstations: 2017 by LeifCarrotson on Thursday October 05, 2017 @12:08PM (#15410276)
If ECC was the normal product that went into everything, and someone invented "unverified" RAM to get a tiny speed boost and slightly decreased cost, how much do you think the actual price difference would be? I expect it would be tiny.

It's a political decision by Intel to make ECC an Xeon-only product which has resulted in the vast majority of the price difference. The silicon die area required for it really doesn't cost that much more - often, the area is present on the consumer dies but just disabled so they can charge a lot more to the enterprise customers who actually require it. And political decisions like that make a lot of HN users unhappy.

As Joel Spolsky said in https://www.joelonsoftware.com/2004/12/15/camels-and-rubber-...:

> Working my way backwards, this business about segmenting? It pisses the heck off of people. People want to feel they’re paying a fair price.... And God help you if an A-list blogger finds out that your premium printer is identical to the cheap printer, with the speed inhibitor turned off.

Everyone knows that ECC parts are nearly identical to the cheap parts, with the ECC module turned off. But there's no boycott, because there are (were?) no other options, like there might be for a printer company. ECC segmentation is just something everyone knows and resents.

Re:Best CPUs for Workstations: 2017 by tokenizerrr on Friday October 06, 2017 @08:00AM (#15416063)
I'm responding to the generalization in the previous comment, I don't specifically agree about ECC.
Re:Best CPUs for Workstations: 2017 by frou_dh on Thursday October 05, 2017 @11:08AM (#15409754)
How does someone “not use” ECC RAM when their computer contains it?

Computer reliability should be a rising tide. Up-and-to-the-right is the goal.

Re:Best CPUs for Workstations: 2017 by sitkack on Thursday October 05, 2017 @09:54AM (#15409123)
> There is no need for ECC in your iPhone or on your MacBook.

Scientists, Engineers and Economists shouldn't use a Phone or MacBook? Your handle is ironic.

The lack of ECC is a method to artificially segment markets and nothing more.

Not ECC, but "single bit errors" can be fatal in other domains [0]

[0] https://gizmodo.com/382026/a-cellphones-missing-dot-kills-tw...

Re:Best CPUs for Workstations: 2017 by sixbrx on Thursday October 05, 2017 @11:49AM (#15410121)
I imagine bit errors are highly unwanted on any domain when they occur in pointers, especially on those that are written through. Some languages make that more likely than others of course with heavy use of references.
Re:Best CPUs for Workstations: 2017 by Bromskloss on Thursday October 05, 2017 @12:01PM (#15410227)
Wow, that story is like Romeo and Juliet, or Pyramus and Thisbe.
Re:Best CPUs for Workstations: 2017 by muraiki on Thursday October 05, 2017 @12:32PM (#15410484)
Bitsquatting refers to registering a domain name one bit different from the target domain name. The intent is that a memory error will cause someone to get the bitsquatted site instead of the legitimate one.

"During the logging period there were a total of 52,317 bitsquat requests from 12,949 unique IP addresses. When not counting 3 events that caused extraordinary amounts of traffic, an average of 59 unique IPs per day made HTTP requests to my 32 bitsquat domains."

http://dinaburg.org/bitsquatting.html

Overheating can be a cause of bit errors, and heat is a concern in mobile devices and laptops.

Re:Best CPUs for Workstations: 2017 by haikuginger on Thursday October 05, 2017 @06:49PM (#15413156)
Now I'm curious to see how different user agents would handle SSL validation for bit errors at different points in the process.
Re:Best CPUs for Workstations: 2017 by mozumder on Thursday October 05, 2017 @11:20AM (#15409878)
ECC increases reliability on older systems as well, increasing lifespan of any product. Silicon degradation is a thing.
Re:Best CPUs for Workstations: 2017 by jmh530 on Thursday October 05, 2017 @10:05AM (#15409244)
But when you need ECC, you really need it. My FreeNAS server has like 32GB or ECC memory because it runs ZFS, which basically doesn't work unless you have ECC memory. However, my desktop computer or my laptop don't need it. When you need ECC, use it, but if you don't need it, then no biggie.
Re:Best CPUs for Workstations: 2017 by Tharre on Thursday October 05, 2017 @02:20PM (#15411359)
> [...] because it runs ZFS, which basically doesn't work unless you have ECC memory.

That's a misconception, to quote Matthew Ahrens, cofounder of ZFS: "There's nothing special about ZFS that requires/encourages the use of ECC RAM more so than any other filesystem."

See also [0].

[0] http://jrs-s.net/2015/02/03/will-zfs-and-non-ecc-ram-kill-yo...

Re:Best CPUs for Workstations: 2017 by jdcarter on Thursday October 05, 2017 @02:33PM (#15411469)
However, this study indicates that ZFS is excellent at detecting on-disk corruption but does little to protect against in-memory corruption:

https://research.cs.wisc.edu/wind/Publications/zfs-corruptio...

Re:Best CPUs for Workstations: 2017 by rhinoceraptor on Thursday October 05, 2017 @11:21AM (#15409892)
ZFS doesn’t need ECC. Obviously it’s better for data integrity to have ECC, but ZFS without ECC is still better than any other file system without ECC.
Re:Best CPUs for Workstations: 2017 by rightos on Thursday October 05, 2017 @10:52AM (#15409617)
Why does ZFS "really need" ECC? I have a few friends running freenas on just old machines without ECC, no issues so far a few years in.
Re:Best CPUs for Workstations: 2017 by milcron on Thursday October 05, 2017 @01:18PM (#15410809)
Traditional filesystems will let files just sit on the hard drive, untouched.

ZFS is a lot more active... checksumming and caching mean that important information is spending time in RAM. It's not good if that information gets corrupted.

Re:Best CPUs for Workstations: 2017 by Dylan16807 on Thursday October 05, 2017 @03:16PM (#15411822)
Checksumming doesn't make data loss worse.

ZFS doesn't cache in any special way, or more than your typical filesystem.

Lack of ECC just lessens the benefits of ZFS, it doesn't exacerbate any problems.

Re:Best CPUs for Workstations: 2017 by rightos on Thursday October 05, 2017 @02:04PM (#15411183)
Doesn't ZFS perform checksumming and error correction on that data to make sure that memory or disk issues don't get affected by corruption? I thought that was a main reason to use it.
Re:Best CPUs for Workstations: 2017 by milcron on Thursday October 05, 2017 @02:35PM (#15411489)
Well right. It protects against silent bitrot on the hard drives. But it does this by caching and checksumming in RAM, so now you need to defend against bitflips in RAM.

It's not that ZFS without ECC is completely unsafe... it's just not as safe as it could be. ECC RAM becomes the next biggest concern once you've addressed on-disk bitrot.

Re:Best CPUs for Workstations: 2017 by slobotron on Thursday October 05, 2017 @11:15AM (#15409834)
If anything, ZFS checksumming lets you get by without ECC and still be confident in your data...
Re:Best CPUs for Workstations: 2017 by kobeya on Thursday October 05, 2017 @05:19PM (#15412666)
No because the checksums are cached in ram and not verified against the disk when an error occurs.
Re:Best CPUs for Workstations: 2017 by slobotron on Thursday October 05, 2017 @10:37PM (#15414064)
Thanks for catching that - my statement was definitely too strong in implying data invulnerability.

I was hinting that you still get a bit of extra protection with ZFS over other filesystems, both on Non-ECC RAM. There is a chance with a stuck/corrupt bit that checksum will fail and you will get a read error. I interpreted OP as saying ECC is a must for ZFS, but I don't think you are more prone to corruption that any other FS?

I'm basing my understanding on this: http://jrs-s.net/2015/02/03/will-zfs-and-non-ecc-ram-kill-yo...

Re:Best CPUs for Workstations: 2017 by raattgift on Friday October 06, 2017 @12:43AM (#15414477)
Yes-and-no. In the most general case the checksum of data block A lives in the parent block B. B's checksum in turn lives in its parent block. And so forth all the way to the root of the Merkle tree.

These checksums are fixed exactly once, in the zio pipeline, as a dirtied buffer is being passed through it during a write operation. The checksum then stays on disk in that form in block B for as long as block A is reachable.

In the read case, checksum validation is done at the vdev_{raidz,mirror,...}.c level and repaired there if possible e.g. from another element of the mirror; recovery is also possible in the case of copies=N (N > 1). Generally, the checksums of read data and metadata are not used once a buffer is successfully in the ARC. (However, compare arc_buf_{freeze,thaw}(), which one can enable, and which will happily cause panics if ARC buffers are corrupted whether through physical problems (e.g. in memory, in a bus, in the CPU) or software error in the kernel.)

Block B may already be in cache for some other reason, in which case the in-memory checksum is used (this is the "yes" part of "yes-and-no"); otherwise, block B will have to be fetched before block A, because block B is where A's checksum lives. Block B may be evicted from ARC long before block A is evicted; any read() or similar call that needs data from A will not result in B being read back into memory.

A buffer kept in ARC and used as the source of subsequently-dirtied data will have its checksum generated anew, just like the fresh write above. Obviously if the data it is dirtied with is bad, it will go to disk and its parents will have a checksum reflecting the bad data. However, the source of the badness need not be within the transient dirtied buffer, nor in a long-resident ARC buffer; userland memory can be corrupted too.

If one has bad memory than bad data may end up on disk, checksummed in such a way that the badness will not be detected by the ZFS subsystem. But this is really no different from any other RAID-like data-validating system or a traditional one-disk filesystem which doesn't checksum. If bits are flipped in userland data that is ultimately subjected to a write(2) call (etc., think mmap()), no filesystem can reasonably expect to do anything other than write out the data handed to it via the system call.

Like any other filesystem, ZFS has its own metadata for tracking allocations, object metadata, and in generating the branch-to-root Merkle tree. The wrong memory corruption (and this has happened in software during ZFS development) can result in data loss or even a pool too damaged to be imported (go to backups). ZFS is not especially more exposed to that than any other filesystem.

Since the arrival of compressed ARC and crypto, only a small fraction of ARC buffers are kept uncompressed or unencrypted in memory at any time (this is controlled by the dbuf cache tunables). Bitflips in any encrypted-in-memory ARC buffer will be caught (noisily) if the buffer is subsequently read or modified, since a decryption will be done at that time and would fail under a single modified bit. Many possible corruptions in compressed-in-memory data will also be caught depending on the type of compression used when the buffer was first written out to disk. In neither case is the ZFS checksum involved in the catching of such corruptions.

Finally, this still won't protect against corruptions in userland, corruptions which hit the various data structure that point to buffers in ARC, or corruptions in the text segments in the zfs subsystem or elsewhere in the kernel. However, ZFS is not realisically more fragile to such corruptions than any other filesystem.

Re:Best CPUs for Workstations: 2017 by drudru11 on Thursday October 05, 2017 @07:17PM (#15413295)
I agree with ECC in general.

What ZFS really needs is native encryption to be generally available.