我又一次在设计评审中遇到了这样的说法,即某个特定场景的概率“小于宇宙射线影响程序的风险”,我突然意识到我根本不知道这个概率是多少。
“既然2-128是340282366920938463463374607431768211456中的1,我认为我们有理由在这里冒险,即使这些计算有几十亿倍的偏差……我相信,宇宙射线把我们搞砸的风险更大。”
这个程序员正确吗? 宇宙射线击中计算机并影响程序执行的概率是多少?
我又一次在设计评审中遇到了这样的说法,即某个特定场景的概率“小于宇宙射线影响程序的风险”,我突然意识到我根本不知道这个概率是多少。
“既然2-128是340282366920938463463374607431768211456中的1,我认为我们有理由在这里冒险,即使这些计算有几十亿倍的偏差……我相信,宇宙射线把我们搞砸的风险更大。”
这个程序员正确吗? 宇宙射线击中计算机并影响程序执行的概率是多少?
当前回答
“宇宙射线事件”在这里的许多答案中被认为是均匀分布的,这可能并不总是正确的(即超新星)。虽然“宇宙射线”的定义(至少根据维基百科)来自外太空,但我认为将局部太阳风暴(又名日冕物质抛射)也包括在同一保护伞下是公平的。我相信这可能会导致几个比特在短时间内翻转,可能足以破坏甚至启用ecc的内存。
众所周知,太阳风暴会对电力系统造成相当大的破坏(如1989年3月的魁北克停电)。计算机系统很可能也会受到影响。
Some 10 years ago I was sitting right next to another guy, we were sitting with each our laptops, it was in a period with quite "stormy" solar weather (sitting in the arctic, we could observe this indirectly - lots of aurora borealis to be seen). Suddenly - in the very same instant - both our laptops crashed. He was running OS X, and I was running Linux. Neither of us are used to the laptops crashing - it's a quite rare thing on Linux and OS X. Common software bugs can more or less be ruled out since we were running on different OS'es (and it didn't happen during a leap second). I've come to attribute that event to "cosmic radiation".
后来,“宇宙辐射”成了我工作场所的一个内部笑话。每当我们的服务器发生了什么事情,我们找不到任何解释,我们开玩笑地把错误归咎于“宇宙辐射”。: -)
其他回答
从维基百科:
IBM在20世纪90年代的研究表明,计算机通常每个月每256兆字节的RAM会经历一次宇宙射线引起的错误
这意味着每月每个字节的概率为3.7 × 10-9,或每秒每个字节的概率为1.4 × 10-15。如果您的程序运行1分钟并占用20 MB RAM,则失败概率为
60 × 20 × 1024²
1 - (1 - 1.4e-15) = 1.8e-6 a.k.a. "5 nines"
错误检查可以帮助减少失败的后果。此外,正如Joe所评论的那样,由于芯片尺寸更紧凑,故障率可能与20年前不同。
“宇宙射线事件”在这里的许多答案中被认为是均匀分布的,这可能并不总是正确的(即超新星)。虽然“宇宙射线”的定义(至少根据维基百科)来自外太空,但我认为将局部太阳风暴(又名日冕物质抛射)也包括在同一保护伞下是公平的。我相信这可能会导致几个比特在短时间内翻转,可能足以破坏甚至启用ecc的内存。
众所周知,太阳风暴会对电力系统造成相当大的破坏(如1989年3月的魁北克停电)。计算机系统很可能也会受到影响。
Some 10 years ago I was sitting right next to another guy, we were sitting with each our laptops, it was in a period with quite "stormy" solar weather (sitting in the arctic, we could observe this indirectly - lots of aurora borealis to be seen). Suddenly - in the very same instant - both our laptops crashed. He was running OS X, and I was running Linux. Neither of us are used to the laptops crashing - it's a quite rare thing on Linux and OS X. Common software bugs can more or less be ruled out since we were running on different OS'es (and it didn't happen during a leap second). I've come to attribute that event to "cosmic radiation".
后来,“宇宙辐射”成了我工作场所的一个内部笑话。每当我们的服务器发生了什么事情,我们找不到任何解释,我们开玩笑地把错误归咎于“宇宙辐射”。: -)
好吧,显然是宇宙射线导致丰田汽车的电子设备出现故障,所以我想说这种可能性非常高:)
宇宙射线真的导致了丰田的灾难吗?
注意:这个答案不是关于物理的,而是关于非ecc内存模块的无声内存错误。有些错误可能来自外部空间,有些则来自桌面内部空间。
在大型服务器场(如CERN集群和谷歌数据中心)上有几项关于ECC内存故障的研究。带有ECC的服务器级硬件可以检测和纠正所有的单比特错误,并检测许多多比特错误。
我们可以假设有很多非ecc台式机(以及非ecc移动智能手机)。如果我们检查论文的ecc可纠正错误率(单位翻转),我们可以知道非ecc内存上的静默内存损坏率。
Large scale CERN 2007 study "Data integrity": vendors declares "Bit Error Rate of 10-12 for their memory modules", "a observed error rate is 4 orders of magnitude lower than expected". For data-intensive tasks (8 GB/s of memory reading) this means that single bit flip may occur every minute (10-12 vendors BER) or once in two days (10-16 BER). 2009 Google's paper "DRAM Errors in the Wild: A Large-Scale Field Study" says that there can be up to 25000-75000 one-bit FIT per Mbit (failures in time per billion hours), which is equal to 1 - 5 bit errors per hour for 8GB of RAM after my calculations. Paper says the same: "mean correctable error rates of 2000–6000 per GB per year". 2012 Sandia report "Detection and Correction of Silent Data Corruptionfor Large-Scale High-Performance Computing": "double bit flips were deemed unlikely" but at ORNL's dense Cray XT5 they are "at a rate of one per day for 75,000+ DIMMs" even with ECC. And single-bit errors should be higher.
因此,如果程序有很大的数据集(几GB),或者有很高的内存读写速率(GB/s或更高),并且它运行了几个小时,那么我们可以期望在桌面硬件上进行几次静默位翻转。memtest检测不到这个速率,DRAM模块表现良好。
长集群在数千台非ecc pc上运行,比如BOINC,互联网范围的网格计算总是会有内存位翻转、磁盘和网络静默错误造成的错误。
And for bigger machines (10 thousands of servers) even with ECC protection from single-bit errors, as we see in Sandia's 2012 report, there can be double-bit flips every day, so you will have no chance to run full-size parallel program for several days (without regular checkpointing and restarting from last good checkpoint in case of double error). The huge machines will also get bit-flips in their caches and cpu registers (both architectural and internal chip's triggers e.g. in ALU datapath), because not all of them are protected by ECC.
PS:如果DRAM模块坏了,情况会更糟。例如,我在笔记本电脑上安装了新的DRAM,几周后它就死机了。它开始出现很多内存错误。我得到:笔记本电脑挂起,linux重启,运行fsck,在根文件系统上发现错误,并说它想在纠正错误后重新启动。但是在每次重新启动(我做了大约5-6次)时,仍然会在根文件系统上发现错误。
使用ECC,您可以纠正宇宙射线的1位错误。为了避免10%的宇宙射线导致2位错误的情况,ECC细胞通常交错在芯片上,因此没有两个细胞彼此相邻。因此,影响两个单元格的宇宙射线事件将导致两个可纠正的1bit误差。
孙声明:(2002年4月第816-5053-10部分)
一般来说,宇宙射线软误差发生在DRAM存储器中 速率~10到100 FIT/MB (1 FIT = 1个设备故障在10亿小时)。 因此,具有10gb内存的系统应该每1000次显示一次ECC事件 到10,000小时,100gb的系统将显示一个事件 100到1000小时。然而,这只是一个粗略的估计 变化是上述效应的函数。