Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Stupid question: why don't all computers (irrespective of the OS) have a built in power loss mechanism? It seems to be such a common and obvious problem.

1. The PSU would have a big enough capacitor to keep the computer running for a few seconds at its stated output power

2. The PSU would notify the OS of a power loss

3. The OS would immediately flush all caches and adopt a "brace position".

4. Events are spread system wide so that apps can also flush and brace.

It should work even if it is the PSU that fails (as long as the capacitor is there).

Surely the problem cannot be the cost. Why don't modern desktops have that feature?



You'll find this old mailing list post a good answer to your question: http://zork.net/~nick/mail/why-reiserfs-is-teh-sukc

The answer is cost. We used to have the computers you're describing. They were made by SGI and the hardware & OS made all sorts of guarantees like the ones you're describing, to the point where XFS was ported to Linux x86 initially it had all sorts of bugs that simply couldn't happen on SGI machines.

The x86 boxes were cheaper, nobody really cared enough about hardware reliability enough to pay the price for the likes of SGI, and the rest is history. Today we have a "worse is better" hardware architecture and software has to be able to handle it.


Very interesting link. Thanks


You have just described a UPS. Or a laptop. A battery just makes more sense than a capacitor in this application.


Why? Wouldn't a large enough capacitor last longer than batteries? UPS batteries I've seen are only rated for 3 years, and half of my recent laptop batteries have physically swelled after 3 years of use.


It would, but the size would be impractical and it's too costly. Quick estimate, let's assume we need 10W for 10 seconds, that's 100 Joule of energy. The energy stored in a capacitor is 0.5CV^2. Say we use a 10V capacitor then C = 2 Farad. They exist, but they are very large (look them up on amazon for instance). You'll probably need more like twice the capacity though because it's impossible to extract all energy from the capacitor, and it's lossy to convert it to a constant +5V / +12V.


Instead of 10 V and 2 F, how about going for 2.5 V and 50 F? A capacitor with those specs is only 40 mm long and 18 mm diameter [1]. That shouldn't be too hard to fit in a typical server or desktop. That's under $4 in quantity.

[1] http://www.mouser.com/ds/2/257/Maxwell_HCSeries_DS_1013793-9...


Theoretically it's possible, but in practice the lower input voltage makes it harder to convert it to +5/+12V. It becomes increasingly lossy and expensive - to convert 0.5V to 12V at 10W is not trivial to begin with. Voltage across a capacitor drops continuously while discharging (unlike a battery). So with a 2.5V capacitor, being able to use it between 1.25V and 2.5V is already pushing it. On average, discharge current at 10W is around 8A. The internal resistance of the capacitor (ESR) better be very low (it probably isn't) at this low voltage - even if it's 0.1 Ohm, at 8A we already lost 0.8V from out meager 2.5V, and now the useful energy is just 1.7-1.25 = 0.5C0.45V^2 = 5J, just enough for 500ms at 10W.


Interesting. 500 ms would would probably not be enough time to save everything (although maybe on an SSD based system it would be...), but it would probably be enough time to save select information that would allow ensuring that the disk is in a consistent state.

The 10 F capacitor has an ESR of 0.075 ohm, but that's at 1 A. They have a 100 F model that is 0.015 ohm at 10 A, and a 150 F that is 0.015 at 15 A. Based on your calculations, these look like they would have a good chance of giving enough time to save everything (especially on an SSD system).

Those are physically bigger but should still fit in a normal desktop or server.

(There is another manufacturer that has up to 630 F!)


The idea is rather to have it built in. A retail consumer shouldn't have to worry about these things. And the idea would not be to sustain a long power interruption like a UPS, just to give time to flush caches and avoid corruption. Which should be much cheaper than a UPS.


I would guess because no promise is much better than a broken promise. No one wants to take blame.


We have to accept that it wouldn't save the day in all scenarios. If there is a 60MB excel file to save on a slow network drive, the file will be lost. But this mechanism would still reduce file/disk/database corruptions by an order of magnitude.


1 is not possible on anything with more than one >100MHz chip


You mean there is no capacitor powerful enough?


Its one thing to add $0.5 supercap and a diode to SSD (and still the likes of OCZ didnt bother for cost reasons). Its entirely another to slap bank of boost/buck converters, 100F cap and spider web of control circuity all over the place.

Adding $20-50 in bom the size of two D batteries just in case something _very rare_ happens is not economically viable. There are better alternatives, like banks of batteries ala google boxes. Turning server into oversized laptop gives you more than couple of seconds buffer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: