Power consumption of DIY NAS (network attached storage)
I've been working to set up some network accessible storage (NAS) for remote backups. Cloud storage seems to run about $10 a month for a reasonable (200gb) amount of storage. Can we do better running the server ourselves? Very likely, though it depends on how much you pay for the hardware and electricity (and your time!).
These days we pay about $0.23/kwh in So.Cal. Very high relative to the rest of the country. So that's going to make this tricky since the server will be running 24x365 = 8760 hours a year. That means that each watt will cost us about $2 a year (eg a 5 watt LED bulb will cost $10 a year to run).
First up is an old 1.6ghz Atom netbook (Lenovo S10-3). I installed Linux on a SD card, and left the 250GB mechanical HD for the storage partition. The idea is that the hard drive can be physically put to sleep most of the time and only spun up when data is being stored or retrieved from the NAS.
I chose lubuntu because it's small and aimed at modest hardware AND as a member of the ubuntu family there's tons of stackexchange posts and such relating to configuring it.
Plugged in, booted up and using the X desktop the power draw of the netbook was about 12-14W. That would be about $26 a year, which is much less than paying for 200gb of storage on the cloud. But we should be able to do much better with the screen off and power saving features maximized. Since this is Linux there's an infinite number of tweaks, an unknown number of which are supported by the particular distribution in use. What worked for me was the following:
powertop --auto-tune
An interactive tool which, among many things, enables power management features for most parts of the hardware. The invocation above skips all the interactivity and just enables all power saving features.
xset -display :0.0 dpms force off
This turns off the display hardware to a deeper extent than just shutting the lid. Worth an extra watt, maybe even 1.5. The downside is there's no way to turn it back on without shell access (xset -display :0.0 dpms force on) . So hopefully your box is good and stable before you do this!
hdparm -B1 /dev/sda1 -S100
These days we pay about $0.23/kwh in So.Cal. Very high relative to the rest of the country. So that's going to make this tricky since the server will be running 24x365 = 8760 hours a year. That means that each watt will cost us about $2 a year (eg a 5 watt LED bulb will cost $10 a year to run).
Lenovo S10-3 Atom N455 netbook (pinetrail)
First up is an old 1.6ghz Atom netbook (Lenovo S10-3). I installed Linux on a SD card, and left the 250GB mechanical HD for the storage partition. The idea is that the hard drive can be physically put to sleep most of the time and only spun up when data is being stored or retrieved from the NAS.
I chose lubuntu because it's small and aimed at modest hardware AND as a member of the ubuntu family there's tons of stackexchange posts and such relating to configuring it.
Plugged in, booted up and using the X desktop the power draw of the netbook was about 12-14W. That would be about $26 a year, which is much less than paying for 200gb of storage on the cloud. But we should be able to do much better with the screen off and power saving features maximized. Since this is Linux there's an infinite number of tweaks, an unknown number of which are supported by the particular distribution in use. What worked for me was the following:
powertop --auto-tune
xset -display :0.0 dpms force off
This turns off the display hardware to a deeper extent than just shutting the lid. Worth an extra watt, maybe even 1.5. The downside is there's no way to turn it back on without shell access (xset -display :0.0 dpms force on) . So hopefully your box is good and stable before you do this!
hdparm -B1 /dev/sda1 -S100
This set the HD for maximum power saving (which means that it spins down quickly). It might be overly extreme, but in my use case the hard drive will either be working hard or off for a couple days, so it seems reasonable. I tuned it to wait 8 minutes before spinning down -S100 /dev/sda1
With those 3 settings I get 6.6W power usage at idle. Rounding up just to be realistic that's $14 a year, or not that different from the monthly cost for cloud storage. Of course my system has no redundancy, tech support, etc.
According to this forum post, that number is reasonably representative of another netbook of that era, the Dell mini 9, which drew 7W at idle. Which goes to support my theory that all Atom netbooks are pretty much the same.
One annoyance is that lubuntu insists on suspending the machine if the lid is shut, despite any settings in the gui, but the link describes how to fix it. Shesh, linux is not for the faint of heart.
Raspberry Pi (Zero w?)
The choice not taken, perhaps to my detriment was to buy a cheap linux computer (more like chip, or SOC) like one of the Raspberry Pi models. I would expect that it could do much better in terms of power consumption. The hardware's not free but it is cheap. How much lower would the power draw be, though?
This fellow measured power consumption for a bunch of Raspberry Pi models. None exactly matching what I need but at idle all used between 0.5W and 1.5W, with WiFi powered on (but presumably not transferring anything). That sound fantastic, but you'll need storage to go with that. The same fellow measured idle consumption at 5W with a 64GB SSD drive connected. I don't know if that's as idle as my mechanical HD spun down, but it makes the Pi series much less appealing if that's what it draws with some attached storage. I'm not sure if I trust those numbers because another source tested SSDs in a desktop and found closer to half a Watt at idle.
The remaining issue is hardware costs. The Zero W costs about $15 delivered. 256GB of storage in MicroSD costs ~120. The same size in USB flash is $50, so I'd go with that. Total then, depends on some more factors: Case? Power supply? USB-OTG to plug in that USB drive? Let's guess 20 for those misc. items, bringing the total to $85. If it magically used 0W then the breakeven would take 6 years, but assuming a more realistic 2W breakeven takes 9(!) years.
Not done yet
Other than getting linux installed I haven't set up the actual NAS yet. I'll need some kind of dynamic DNS so it's reachable from anywhere, and if I'm using it for backup, some decent backup software (cross-platform, hopefully). I've used Unison in the past as a poor-man's (or geek's) alternative to dropbox and I expect I'll do that here as well.