Raspberry Pi是否適合連續24/7運行?


321

我想運行一台無頭機器來執行一些基本的自動化和統計生成(例如生成netstats,上傳到pvoutput.org),以及可能出現的任何其他瑣碎的批處理作業。

由於RaspPi主要是作為一種學習設備而設計的,它仍然是100%正常運行時間的理想選擇嗎?我不確定該單元的教室友好型設計是否適合此類操作參數(即"兒童保護"設計=更堅固;該設備是否適合在學校上課時間等)。

出於這個問題的目的,我假設RaspPi放在一個盒子裡,並位於"安全"的操作環境(即室內)中。

-

2012年10月21日:這裡有一個有用的相關主題,關於:SD卡壽命:How can I extend the life of my SD card?

25

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.


213

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.


78

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.


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


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.


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.


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.


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.


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


4

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


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!


11

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!


10

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


36

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.


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


18

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...


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.


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.


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.


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.


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.