340

I would like to run a headless machine to perform some basic automation and statistical generation (e.g. generating netstats, uploading to pvoutput.org), as well as any other trivial batch jobs that may spring up.

As the RaspPi has been designed primarily as a learning device, is it still a good candidate for 100% up-time? I'm not sure if the unit's classroom-friendly design lends itself to such operational parameters (i.e. 'childproof' design = more robust; is the device built to run for the length of a school lesson etc).

For the purposes of this question, I am assuming the RaspPi is housed in a case and located in a 'safe' operating environment (i.e. indoors).

-

21 Oct 2012: There is a useful related thread here re: SD card life: How can I extend the life of my SD card?

Beeblebrox
  • 4,013
  • 3
  • 21
  • 21

23 Answers23

222

Yes, absolutely.

  • Draws very little power
  • Can be used for a number of server tasks that imply continuous uptime, eg. DHCP server
  • Few people seem to have had issues through running them this way (and the passage of time is now definitely at a point where this is worth noting)

Historically, there were a few negatives I could think of, I'll leave them here for reference:

  • SD card has limited lifespan
  • You could potentially find stability issues with some drivers
  • Limited resources mean if there is a memory leak somewhere, or a process that suddenly eats lots of RAM, it won't be long before performance drops and / or a reboot is required.

All of these points are now (June 2018) somewhat moot, though. A decent SD card in practice these days won't have a problem unless it's under very heavy use, almost all the early stability issues with drivers have been ironed out, and 1GB of RAM is heaps more than the original (original boards had 256MB, and up to half of that was eaten by the GPU.)

I still wouldn't use it as a device that needed to be up 24/7 for some form of critical operation, but then again that's the same with any consumer grade PC.

berry120
  • 10,984
  • 11
  • 53
  • 63
83

I'm finding that the Pi makes a very good microserver, as long as you understand its limitations. While flash memory in theory has a limited life, in practice you'll get several years out of it. I've been running a similar ARM-based board as a home server for over three years with / and /home on an SD card, and it hasn't complained.

The biggest issue I have with the Pi is the power supply. Running off a phone charger, it doesn't have the capacity to ride through minor power glitches. I've found it reboots at the slightest flicker. Sure, it comes back up quickly, but you'll either have to address this with a better regulated power supply, or design your tasks that they can restart from where they were interrupted on reboot.

Update, 2013-12-23: The card on the the ARM-based board home server may have finally crapped out after the 24+ hour blackout we had here due to an ice storm. This is a single anecdotal report, and should be taken as-is.

scruss
  • 9,117
  • 1
  • 25
  • 36
37

I have been running mine for about 3 months non-stop as a web server for www.sm0vpo.com where there are about 10,000 electronic PDF files and about 250 electronic projects that i have fully documented with PCB poil patters in ZIP and GIF form.

I have about 3,000,000 hits per year so my little RPi will have seen about 700,000 hits as well as experiencig both heavy and light traffic.

I have the RPi running "barefoot" (no keyboard, monitor or mouse) with no external USB connections. The only connections are SD-card (SanDisk EXTREME 8GB @33Mb/s). I reasoned that the keyboard, mouse and memory stick could burn as much as the RPi itself.

The RPi has never once crashed, is slightly warm and I consider it to be 100% reliable. An MS Windoze-XP machine running the same traffic had to be restarted about every second month on average, with a lower traffic density. The RPI is also faster than the 2.66GHz HP computer but I believe this to be a function of the different operating system (my RPi is running LINUX - debian).

If you want more information I can send you pictures, but at the moment and as a newbie, I cannot access net logs in the lighthttpd server. If you have any command sequences I can enter into my SSH terminal then you are more than welcome to share all information (and softare) I have.

FYI - My RPi is hidden behind an IP-Cop (LINUX) hardware-dedicated firewall, but I hope one day to change that ATX card for a dedicated RPi server/firewall. I am only missing one component - time.

sebastian-c
  • 115
  • 1
  • 8
Harry
  • 541
  • 5
  • 2
26

For my own experience, I have had my RaspPi running since June 24/7 logging data from my solar system and haven't had any problems. Im using a DC-DC converter for power via the 12V solar system and fitted a cooling fan on the box but it hasn't got hot enough to turn on yet.

I am not writing to the SD card so that will hopefully not be a point of failure, it is only uploading to a remote server every 60 seconds.

The board seems to run very cool and uses very little power.

Brian Dorey
  • 261
  • 3
  • 2
26

Since most computers are not suited for 24/7 operations due to their moving parts the RPi shouldn't have any problems.

If a machine fails it's most of the time due to a hard drive failing or some fans failing as those are prone to wear.

The only thing that can experience wear like that on a RPi is the SD Card so you might want your setup to get as much of the write operations into RAM or onto another device that can handle writes a little bit longer. Something like an usb attached server grade hard drive that's designed to operate 24/7.

berry120
  • 10,984
  • 11
  • 53
  • 63
bardiir
  • 832
  • 1
  • 9
  • 12
22

I was also eager to know more about the 24/7 capabilities of the Raspberry Pi. Therefore, I installed the app "stress" (sudo apt-get install stress), which is capable of loading the CPU for the full 100% all the time.
The best thing about "stress" is that it gives priority to other running processes, it only "fills" the gap till the CPU is loaded for the full 100%.

I ran the test a while ago for 275 (!!!) days, without any issues. No reboots, no crashes, no overheating, no... nothing (I didn't tweak the Raspberry Pi, I used it as-is, so no overclocking and so on...).

Based upon what I've experienced, I'm quite sure the Raspberry Pi is more than robust enough to survive 24/7 situations for a very, very long time. I'm even considering to use it for my home automation system...

GeertVc
  • 996
  • 8
  • 9
14

If you want your SD card to last for longer I have got two pieces of advice for you:

  • Make sure you don't have too many write cycles, ie. turn off logging, don't run a Bitcoin node, etc.
  • Buy a good brand (ocz/kingston/a-data and other popular ones are fine, just not chinese no-names)

When I did not follow those two mentioned above my memory cards on headless Debian machines died within weeks

Qba-th'Intrepid
  • 149
  • 1
  • 4
12

I can only offer a view based on my experience. I use 2 raspberry pi's as mini servers and never turn them off. My first Pi is now well over 4 months old and has probably been 'off' for less than a few hours during all that time. I use it pretty heavily as an iPlayer download and podcast host, which does a reasonable amount of reads and writes of the SD card.

It sits behind my tv in the cardboard box it came in (with a couple of holes cut for the cables), never gets warm and seems to work continuously.

I have had to rebuild it twice, once because I wanted to move from Squeeze to Raspbian and once because I buggered up the OS messing about.

Martin O'Hanlon
  • 614
  • 5
  • 11
12

Just to chime in with a datapoint:

I've used my raspberry as a datalogger for my solarpanels. It was writing to a logfile on the SDcard every minute. I've now had a hard failure of the SD card for the second time. Each time the card lasted about a month. The cards were both Kingston SDC4/4GB cards. So SDcard wear is real!

Bert Haverkamp
  • 129
  • 1
  • 2
11

A few things to consider when designing your project:

  • Depending on your usage of the RaspberryPi spiking it's SoC to near 100% usage can make it quite hot, and I recommend adding a heatsink, as I have done, with perhaps a little 5volt fan to keep things a little cool (I've gotten my heatsink from a old Security DVR)
  • SD Card performance and wear, I know this has been touched on already but I would highly recommend not cheaping out on this part of the setup. E.g. going with a high class card for fast read & write speeds and longer period of time before it will become necessary to replace the card; this of course also increases your RaspberryPi's speed and could be useful if you plan to do a lot with data. More details Here ;D
  • Another point to note would be power consumption and supply. As you probably know quite well the RaspberryPi should be operated at 5v and at least 700mAs, and you this another area where cheaping out can lead to some unpleasant results... So perhaps going with a rather strictly regulated 5v power supply (to prevent brownouts which could cause your Pi to restart) delivering about 1 amp.
  • My fourth point is that you should also make sure you have a sturdy place to secure the Pi away from anything that might cause damage ;) (they are quite hard to get a hold of haha)

Hope that helps mate!

Clement
  • 384
  • 2
  • 8
11

I've found that with my headless unit, the ethernet tends to drop out after a few weeks and needs a reboot. I've found it useful to either

  • Schedule a cron job to soft-reboot every night when nothing important is happening, or
  • Use an outlet timer to do a hard reboot (pull power for 1 minute, then re-power)

Hokey but it works, and probably covers a lot of unanticipated problems

Carl
  • 219
  • 2
  • 2
10

Yes, I would say it is very suitable. Just be aware of any flash memory wear issues (much over-hyped in my experience) and power from a simple DC UPS something like this http://www.ebay.co.uk/itm/PicoUPS-120-DC-micro-UPS-Car-PC-battery-backup-system-/400207898153

Guy
  • 1,667
  • 1
  • 16
  • 18
10

My RaspberryPi Model-B uptime on Raspbian with Samba (external powered usb drive attached, configuration howto details here), some basics perl scripts running on apache, rtorrent and sometimes omxplayer is:

11:19:49 up 10 days,  2:30,  2 users,  load average: 0,21, 0,21, 0,12

It's only ten days because there was a blackout in my neighborhood. I don't start the Raspian desktop (startx) because tty is fine for my purposes. I really stress it one time, when I try to run php on apache as a test (avoid php here). I use a Samsung Galaxy power adapter and everything is fine, I bought it this summer and it barely heat the plastic transparent case I use to protect it from dust.

chirale
  • 226
  • 2
  • 5
9

I have had a RaspberryPi running continuously for just over 2 weeks. It runs very cool. By way of a contrast I have a Dreamplug sitting next to it. The heat sink was a times too hot to touch. It was running the same programs but has over heated and died this weekend.

Eric Hewett
  • 201
  • 1
  • 3
7

... and on a totally different note, my RPi will shortly be running from a 6v (plus 5v regulator) motorcycle battery charged by a solar panel and wind turbine.

The reliability of other machines is limited by the higher powers they eat. 3W (24/7) for the RPi is easy to generate. Yet another reason for choosing the RPi for a reliable solution.

A 40-Watt solar panel in 10% use (typical European climate) and a 50-Watt turbine will deliver 200% of the RPi's requirenents. 50A/H of storage will keep the RPi going for about 4 days (rain and no wind :-).

/Harry

Harry
  • 541
  • 5
  • 2
5

I have a SD card based Beagle board that has been running for over a year. It does require an occasional restart and have copies of the SD card in case of failure (Not needed as yet) The application is read only which may have aided its longevity

peterretief
  • 285
  • 1
  • 4
  • 11
5

As concern over long-term SD card reliability is frequently mentioned (and is a valid concern, especially for low-quality SD cards), there is another approach: initramfs (or initrd).

This requires a little more dirty work, but essentially you need to rebuild a kernel with your own initramfs (or separately build an initrd). The initramfs would include everything you need to run your application. As the Raspberry Pi 2 has 1GB RAM, there is ample space for most applications that do some "basic automation and statistical generation". Of course, if you need some larger application, like X or Mathematica, all bets are off (but 1GB can still handle a lot of stuff).

Of course, the SD card is still used - but it would only be used at boot time. In fact, Linux would never need to use it at all, only the bootloader.

If you want to keep the initramfs very small, a common approach is to use a GNU replacement, like busybox.

There is lots of info on both initramfs/busybox out there, and it is not Raspberry Pi specific.

Brian
  • 577
  • 3
  • 9
2

I have 5 pi's that have been running 24/7 for controlling and monitoring my hardwired smart home (i.e. no WiFi or Bluetooth) for a very long time. They only boot from the SD card and don't write to it. Everything is in memory. Power is supplied by a separate "critical" power feed supply which has a set of 2 295 AMP 12v Telco quality batteries connected in series to provide 24v and then another set in parallel to the first set to provide 590 AMPS @ 24v. That feeds into a online UPS that filter the power, does the battery management and feeds 120v out to the "critical" components of the home. Critical being 60+ led lights, the 5 pi's and my influx / Grafana server (old laptop).

Calculation wise at the current typical AMP draw, if the house looses power my PI's and lights and monitoring will keep running for 3 weeks. Some day I'll add solar panels and more batteries to the house as well.

So what has been my uptime so far (April 30/2022):

14:21:15 up 970 days, 21:07, 1 user, load average: 0.02, 0.03, 0.00

Yes the Pi Model 3 has been solid!

Rick
  • 133
  • 4
1

I have been using a Pi as a radius server for years. There is nothing special about this one. It is out of the box, in a good case with a usb power supply on a ups.

root@raspberrypi:~# uptime

20:02:41 up 800 days, 6:22, 1 user, load average: 0.06, 0.04, 0.05

I keep a mirror in case of failure. It processes hundreds of transactions daily.

George F
  • 21
  • 3
1

Redundancy is cheap

I didn't find this mentioned elsewhere, but as with anything you're expecting to run 24/7, critical or not, you should have backups. The affordability of the Pi would allow you have a spare standing by, or a networked slave receiving regular backups.

raphael
  • 298
  • 2
  • 8
1

How you all are running Raspberry Pi continously for 24x7?. When i did , i faced multiple issues such as when running python application script, it gets hanged and needs to be restarted. Application details-A python script running to collect the energy meter via Modbus and sent to AWS cloud.

0

Not exactly headless but a number of us run Raspberry Pi's as media servers for months on end without powering down. Any issues I experienced were due to power outages and most it recovers from just fine.

linhartr22
  • 161
  • 7
0

I have a pi recording ignition sounds of industrial equipment that we can't monitor otherwise.

It has been running for 4 months non stop and I have had no problems with it.

If your concern is a reboot for power outage or anything else, write a script in the bootloader to automatically start playing the video. That way if there is a break in the power, the pi will automatically start playing the video as soon as it boots.

User98764431
  • 569
  • 1
  • 19
  • 33