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

I run a Raspberry Pi 4b, recently upgraded from a 3b+, and I believe that a lot of personal computing could (and maybe should) be run on them. They're quiet, energy efficient, and you could probably run them on a battery if you needed it.

I wouldn't run VMs on it, but I do run docker on it, and that works just fine.



two things:

1) I think the pi is not particularly power efficient.

I got this impression from this (old) article:

https://www.bitwizard.nl/wiki/Reducing_power_consumption_of_...

2) I think the pi would benefit from a more robust filesytem layout such as an overlay filesystem to allow continuous writes to /var to go to ramdisk.

Openwrt has a layout like this and it prevents flash from being burned out and prevents most problems if power is abruptly lost.


> I think the pi is not particularly power efficient.

While there might be efficiency gains available, RPIs use a very small amount of power compared to a laptop. Idling a RPI4 uses 2.8 watts[0], which not only rates favorably compared to most laptops, but is far below what my charging cell phone uses. Maxed out my RPI can only hit 15W, since that's the maximum power that my official USB C adapter can output.

Now that being said, it does depend on what kind of load you're expecting to handle. If you're constantly maxing out a RPI, it is probably more energy efficient to purchase a larger server than to just keep adding RPIs. But if you're staying well below the theoretical max of a RPI, it'll consume far less than a used laptop.

> I think the pi would benefit from a more robust filesytem layout such as an overlay filesystem to allow continuous writes to /var to go to ramdisk.

This is one of the biggest drawbacks of the RPI; microSD cards cannot handle a ton of writes without frying. I've settled on using log2ram to ensure that logs are only periodically flushed from RAM to the SD card, to extend the lifespan of my cards.


Booting to USB is an option.


Depends what you mean by power efficient.

Watts per low traffic website it's very efficient. CPU is generally not pegged at 100%.

For watts per CPU cycle not as much, I agree. Say it takes 10W at full power (I've not measured). That makes it 1/10th of a normal CPU. But it's like 30-40 times slower.


what's uptime like on an Rpi? I want to start working on a home website and have an old rpi laying around. But I've read that their reliability isn't great since they use SD cards. Any advice?


What I've done with my RPi 4 is attach an external SSD to it and mount it to /home and /var. This reduces writes to the SD card dramatically. Lengthening the SD card's life. I have serious uptime on it, almost a year (since I got an RPi 4 basically). It only shutdown with power failures (only one, which was entirely my own fault) and system maintenance (OS upgrades and other tinkering).

I've also imaged a version of that SD card, so it would be easy to just swap out and probably get things running again without much hassle.

I'm sure there are more fancy solutions with overlayfs, making the SD card read-only except for upgrades. Though I couldn't find a nice resource on it at the time.


Interesting solution, I'll take note of this. Thanks!


My Home Assistant is running on a Raspberry Pi 3B+. It has been running on the same SD card for two years now, with a large sqlite database and with debug logging enabled for Z-Wave so a fair amount of writing to the card.

It has only been down when the power has been out, and so far no issues with the card. It is however an A1 or A2 class card (I forget which), so supposedly design with applications in mind.

It should also be noted that a lot of issues with the Pi is due to poor USB cables / power supplies. I had another Pi that kept crashing every few days, until I measured the USB "charger" cable I was using for it. Turns out it had a resistance of almost exactly 1 Ohm. So if the Pi drew say 1A, that would be 1V loss in the cable... After I swapped cables it has been rock solid. A key point here is that a lot of SD cards do not like losing power while being written to. Avoid that and a quality SD card should have a long life.


very helpful input, thanks a lot!


Very long if you're careful to not write to the SD card too much. Mine got turned off mostly when I accidentally unplugged it from my desk.


Just dont have heavy writes on sdcard. I use external hdd for it.

I have a running rpi for more than half a year. No issues whatsoever. But again - I have a very stable electricity and I dont remember last time it was cut not due to planned maintenance.


My rPi3, running Arch, has an up time of close to 3 years on the same SD card. It runs various Docker containers including 1 for MiniFlux. It's mostly idle but when I need it, it's been reliably there for me. Maybe, I've been lucky.


I don't have numbers, stats handy but in my couple of years experience with Rpis - both regulars and the smaller Ws - the SD cards fail well before the Rpis do.


If you are not using the camera, it can run for years.


Are there any particular reasons why you want to host your website on your home network on the Pi?


Just because I already have it and it's low-powered. I prefer starting projects out with 0-cost methods, and I already have an rpi laying around somewhere


My 2cents: Have a look at GitHub pages, you wouldn't even need to pay for electricity.


That is a good point. However one of my goals/constraints is that I want my home site to be able to connect to other personal devices, e.g. a NAS (another WIP project). My ideal vision is a simple site running on my network, backed up on some kind of cloud storage.

Any suggestions? Though I'm a software engineer, I've worked mostly in app dev rather than infrastructure setup. This project is a way for me to learn more about the latter. The rpi is the easiest and cheapest option, but I have wondered if it wouldn't make more sense to use AWS or something like that. I wouldn't mind paying a few bucks a month, but more than that and I'd rather wait until I've learned a bit and know what my specific needs are. I've also considered an actual computer, but figure it's a waste of power when my initial work will probably just be figuring out the server config, HTML pages, etc.


>That is a good point. However one of my goals/constraints is that I want my home site to be able to connect to other personal devices, e.g. a NAS (another WIP project). My ideal vision is a simple site running on my network, backed up on some kind of cloud storage.

You could host everything on your home network but there are a couple of things you should probably know before you start: 1) Some ISP do not give you static IP, meaning its extra work

2) Security - Ideally your home network has some kind of segregation, you keep your trusted devices on one, IoT or not patchable on another for example, with firewall blocking connections from dirty network to clean one. Having externally facing website potentially having direct access to personal devices and services might be an issue from security point of view.

You can sign up on AWS/Azure or any other cloud provider for free and get free credits, which might be enough for you to learn. Feel free to ask further questions if you need to


But it's ARM and that poses some problems. For example, you can't put windows into it, and some of my apps are Windows.

Also, RDP. I still hope for something so smooth in Linux, using console meanwhile.


In my experience XDMCP/X11 forwarding works reasonably well, as long as your network is fairly quick and reliable.


It's not officially supported, but you can get windows to run on a Pi 4.


If you're speaking about Windows IOT, it's clearly not production ready (and not compatible with the PI4 AFAIK).

I did some tests on a RPI3 a year or 2 ago and showing some scrolling test in a UWP app was making the whole machine lag and be unresponsive.




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

Search: