lazloman
Posts: 48
Joined: Sat Jan 07, 2017 12:40 am

Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 1:22 am

I've been running various flavors of of Linux for about 15 years now and after having played around a bit with my first Pi, I've begun wondering whether I could use it to replace my linux box. The Linux box's primary uses are these:
Web Sever
DNS
Mail Server (postfix) + Courier + spam filter (spam assassin)
VCS Server (git)
Jira
Stash
postgresql

Secondary services are:
ntp
file server
SMB

Although I haven't confirmed it yet, I suspect most of this is available as Raspbian packages.

The advantages I see are:
Less space
Easier backups (Just the SD card)
Lower cost

I can't really come up with any disadvantages. Anyone have any thoughts?
Thanks

wildfire
Posts: 605
Joined: Sat Sep 03, 2016 10:39 am
Location: Dundee, Scotland

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 3:29 am

The only disadvantage I can see is the SD card, their lifespan can be shorter than other storage media.

I will stand corrected when other more experienced Pi users express their views.
E8 85 A2 64 C9 64 81 94 64 81 95 64 89 84 89 96 A3
Still NF Shirls

lazloman
Posts: 48
Joined: Sat Jan 07, 2017 12:40 am

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 3:49 am

I was unaware of that. Given their nature, I would have expected them have a longer life than, at least mechanical drives. They are still much cheaper than anything else and i don't have large storage requirements, so making regular backups and keeping a ready image would allow me to get up and running again quite easy. None the less, I see this as a con.
Thanks for the reply.

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 4:30 am

I'm sure it's possible to run all the software you listed on the Pi. Raspbian is basically Debian after all.

Things to consider:

1) The aforementioned SD card reliability.

This was a big problem for me in the early Pi days. Since the Pi 3 not a problem. Even if I regularly yank the power without shutting down properly. Others however still come here with reports of SD corruption.

Personally if I wanted reliability I would make sure the SD card is mounted read-only and keep my data on an attached SSD.

2) Memory size.

The Pi only has one gig of RAM. Is that enough to run all those services listed at the loads you normally have?

3) Performance

Is the Pi CPU speed and network throughput enough for your work load?

How about just migrating some of those services from the old Linux box to the Pi, one at a time and seeing how it goes?
Memory in C++ is a leaky abstraction .

lazloman
Posts: 48
Joined: Sat Jan 07, 2017 12:40 am

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 4:40 am

Reliability is certainly an issue. This sounds like one more dagger in this idea. The server simply has to be running at all times. Performance is not a major issue. This is a personal system with only 3 users (and one is away at college), so I'm not concerned about that. I'll have to look at memory, but I think these services could be run in 1GB.
Thanks

User avatar
Gavinmc42
Posts: 4505
Joined: Wed Aug 28, 2013 3:31 am

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 6:26 am

Latest 4.9 next build kernel has USB boot option on Pi 3's.
I have no SD card and boot from a tiny Lexar 32GB USB stick.
Still has a few bugs, mostly to do with Chromium I think.

Pi 3 reliability is ok if you use a heat sink.
If you don't need wifi/bt then the newer rev 1.2 Pi 2 would boot from USB too.
It does take a bit longer to boot.
On the older Pi's there is a special version bootloader.bin that boots from SDcard then gets the rest from USB.

I have an old Pi 2 with external USB caddy with purple WD running security camera stuff.
Very reliable, don't think it has crashed as It still works fine after 6 months 24/7.
It is running Jessie Lite from SDcard too.

For development PC, ie coding I am investigating 64bit OS's because I want to do Aarch64 coding.
For your net stuff 32bit should be fine, but this is changing as Suse and others are starting to support Aarch64 Pi.
Expect even better network servers, capable of using the 4 cores, but don't expect too much, still only USB 2.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

lazloman
Posts: 48
Joined: Sat Jan 07, 2017 12:40 am

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 6:46 am

Thank you. I appreciate the thoughts.

User avatar
rpdom
Posts: 16998
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 8:25 am

I have a Pi2 with 2TB USB disk that has been running as a server since I got it (which was when the Pi 2 came out).

It runs webserver, NTP, DNS, SMB, NFS, CUPS, MySQL, VPN and Postfix and a few custom apps I created. It has been very reliable. The only problems I've had have been one power cut and a failing power supply[1]. The Pi and disk itself recovered from both of those with no problems.

It's not super fast, but adequate for my uses. Much better than the 400MHz Intel Celeron system that it replaced ;-)

A Pi3 might be better. I'll upgrade one day. I've got a spare Pi3B or two here.

[1] I was a bit disappointed with the power supply. It is an Anker 40W one and was happily powering a Pi2 and Pi3 as well as the USB disk until recently. Then the disk started going offline because the voltage had dropped. I'm now powering the Pi2 and disk from an official Pi3 PSU and the Pi3 is running from the Anker supply on its own.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 9:11 am

Heater wrote: 3) Performance

Is the Pi CPU speed and network throughput enough for your work load?
To expand on part of the performance aspect, the network interface and all four USB ports are connected via a hub chip to the single usb port on the SoC, these means that there's a limit on IO performance.

For the likes of dns, dhcp, ntp, basic webserver with small db, mail server the pi will do well, for anything using a larger db you might start to see it struggle.
wildfire wrote:The only disadvantage I can see is the SD card, their lifespan can be shorter than other storage media.
lazloman wrote:I was unaware of that. Given their nature, I would have expected them have a longer life than, at least mechanical drives.
All flash drives (SD, USB, SSDs) have a limited number of write cycles. The more expensive options will have plenty of spare cells to write to and will do a better job of using all cells evenly. With limited use flash storage might outlast a spinning drive, for a constant workload the spinning drive may well do better.

User avatar
PeterO
Posts: 5827
Joined: Sun Jul 22, 2012 4:14 pm

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 9:28 am

Gavinmc42 wrote:Latest 4.9 next build kernel has USB boot option on Pi 3's.
I have no SD card and boot from a tiny Lexar 32GB USB stick.
USB booting has nothing to do with the kernel version, and everything to do with the firmware version. Currently (7/1/2017) you need the "next" branch of the firmware installed to use USB boot (several threads about this already). I'm running kernel 4.4.32 on a PI3 and booting from a USB HDD.
Pi 3 reliability is ok if you use a heat sink.
To clarify, It only needs a heatsink if it is heavily loaded (e.g. running all four cores continuously) otherwise it is fine without, but the cost of a heat sink is so small you might as well add one :-)

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
karrika
Posts: 1122
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 10:18 am

I am currently experimenting with a Pi server idea. Cloud computing using multiple Pi's.

If a Pi gets compromized you delete the disk and create a new instance. The nice thing is that the services are separated from each other. Every Pi has only the minimum required port open for running its service.

With enough Pi's a broken SD card would just mark one node bad and you could start the service on an idle Pi.

Docker may be a good tool for this.

User avatar
bensimmo
Posts: 4567
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 10:38 am

There is only one way to find out.

You have a Pi and SD card ...

Have fun :-)

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 11:05 am

I like the multiple Pi idea.

Even if it were only one Pi per service, no fail over redundancy per service. At least it isolates all the services from each other which is good from a security perspective. If one Pi goes down you only lose one service for a while. It makes more memory available for each service.

Docker containers world make it easy to quickly spin up a service, full configured and ready to go. On a new Pi install when replacing a failure or perhaps migrating a service to a non-failed Pi.
Memory in C++ is a leaky abstraction .

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26431
Joined: Sat Jul 30, 2011 7:41 pm

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 11:30 am

Heater wrote:I like the multiple Pi idea.

Even if it were only one Pi per service, no fail over redundancy per service. At least it isolates all the services from each other which is good from a security perspective. If one Pi goes down you only lose one service for a while. It makes more memory available for each service.

Docker containers world make it easy to quickly spin up a service, full configured and ready to go. On a new Pi install when replacing a failure or perhaps migrating a service to a non-failed Pi.
I was going to suggest, if IO performance is an issue, to have multiple PI's. Only issue would be data spread over multiple drives unless you have a NAS for storage, and use individual Pi's for various services. However, I doubt CPU will be the bottleneck, so that's probably not a sensible option.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

wildfire
Posts: 605
Joined: Sat Sep 03, 2016 10:39 am
Location: Dundee, Scotland

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 2:41 pm

lazloman wrote:I was unaware of that. Given their nature, I would have expected them have a longer life than, at least mechanical drives.... None the less, I see this as a con.
Don't see it as a con, others have posted why they fail (user error) and why they may not last as long as mechanical drives but as you yourself posted, they're cheap and easy to back up.

My experience with a Pi B a Zero and a 3B over the last 2 years or so I've never encountered a SD card failure, though I do understand why they can happen.
E8 85 A2 64 C9 64 81 94 64 81 95 64 89 84 89 96 A3
Still NF Shirls

ejolson
Posts: 5154
Joined: Tue Mar 18, 2014 11:47 am

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 7:36 pm

wildfire wrote:My experience with a Pi B a Zero and a 3B over the last 2 years or so I've never encountered a SD card failure, though I do understand why they can happen.
A couple years ago I had an sdcard suddenly become unbootable. Surprisingly it happened during a planned shutdown and reboot. It was possible to rescue the card using the backup superblock, but that was far from automatic.

While the Pi B+ and 2B appear quite reliable, my impression of the 3B is that even with a heatsink it does not perform reliably at stock voltage and clock rates. While a few errors here and an unexpected crash there are not great for a toy computer, such things are worse for a server. Fortunately, my Pi 3B became reasonably reliable with either an underclock to 900Mhz or an overvolt of +2. Even though much of the code in Raspbian is ARMv6 compatible and therefore less likely to cause hardware faults than optimized software, for a server designed to run 24/7 with no down time, I would suggest thorough testing before putting a particular Pi 3B in production.

As more and more system software is optimized for the Pi 3B, intermittent hardware errors may become more noticeable. This could happen, for example, with encryption routines in a VPN and scrub operations for a BTRFS formatted disk. Although speed of USB disk I/O will be slow, I would expect that a properly configured Pi 3B could perform all the tasks mentioned in the original post.

User avatar
bensimmo
Posts: 4567
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 9:46 pm

Oddly we've never had corrupt cards on Pi B+/A+/2 or 3.
And they always get yanked out. Or power runs out or hammered from a hight as they hit the ground hard in a rocket.
All while taking picture every half or so seconds, logging form SenseHat as fast as possible and GPS co-ordinates.
Only twice all 3 happening at one though.
Still we loose the last 4 or 5 pictures to jpg corruption unreadabke (I assume not fully written), datalogs are always readable though.
Not sure how I could handle the cards any more.

The only card that died had a crack in it, burnt up and burnt my finger from the SD casing. Pi3 still worked though.

Heater
Posts: 15818
Joined: Tue Jul 17, 2012 3:02 pm

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 9:55 pm

Never mind SD card data corruption. One of my early Pi ran for months snapping pictures. Then it stopped. When I took it down for investigation and powered it up again the SD card went on fire. No really, very hot, smoke coming out. Seriously a fire hazard.

Seems I'm the only one out of 11 million with that issue though.
Memory in C++ is a leaky abstraction .

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26431
Joined: Sat Jul 30, 2011 7:41 pm

Re: Thinking about replacing linux box with Rpi

Sat Jan 07, 2017 10:22 pm

ejolson wrote:
wildfire wrote:My experience with a Pi B a Zero and a 3B over the last 2 years or so I've never encountered a SD card failure, though I do understand why they can happen.
A couple years ago I had an sdcard suddenly become unbootable. Surprisingly it happened during a planned shutdown and reboot. It was possible to rescue the card using the backup superblock, but that was far from automatic.

While the Pi B+ and 2B appear quite reliable, my impression of the 3B is that even with a heatsink it does not perform reliably at stock voltage and clock rates. While a few errors here and an unexpected crash there are not great for a toy computer, such things are worse for a server. Fortunately, my Pi 3B became reasonably reliable with either an underclock to 900Mhz or an overvolt of +2. Even though much of the code in Raspbian is ARMv6 compatible and therefore less likely to cause hardware faults than optimized software, for a server designed to run 24/7 with no down time, I would suggest thorough testing before putting a particular Pi 3B in production.

As more and more system software is optimized for the Pi 3B, intermittent hardware errors may become more noticeable. This could happen, for example, with encryption routines in a VPN and scrub operations for a BTRFS formatted disk. Although speed of USB disk I/O will be slow, I would expect that a properly configured Pi 3B could perform all the tasks mentioned in the original post.
Please stop referring to the P as a toy computer, it's not a valid statement. I'll delete any post that do so in the future. Also, your impression of Pi3 seems to be at odds with the majority - sound like you might have an edge case SoC. Unless you have this on multiple Pi's which would be odd as its not a common complaint.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Thinking about replacing linux box with Rpi

Sun Jan 08, 2017 12:10 am

bensimmo wrote:All while taking picture every half or so seconds, logging form SenseHat as fast as possible and GPS co-ordinates.
Only twice all 3 happening at one though.
Still we loose the last 4 or 5 pictures to jpg corruption unreadabke (I assume not fully written), datalogs are always readable though.
There was (possibly still is) an obscure bug with using the camera and other gpio at the same time due to some race condition. A bit more detail should be accessible at https://groups.google.com/forum/#!topic ... _0l7I5mbuE

linux_author
Posts: 248
Joined: Sat Apr 02, 2016 7:04 pm
Location: Gulf of Mexico
Contact: Website

Re: Thinking about replacing linux box with Rpi

Sun Jan 08, 2017 12:14 am

wildfire wrote:The only disadvantage I can see is the SD card, their lifespan can be shorter than other storage media.

I will stand corrected when other more experienced Pi users express their views.
Samsung EVO+

willie
on the Raspberry Pi 365/24/7 Gulf of Mexico

levelcrow
Posts: 47
Joined: Tue Aug 12, 2014 5:04 pm

Re: Thinking about replacing linux box with Rpi

Sun Jan 08, 2017 12:26 am

wildfire wrote:The only disadvantage I can see is the SD card, their lifespan can be shorter than other storage media.

I will stand corrected when other more experienced Pi users express their views.
I moved my files over to a $4 USB 2.0 8GB PNY Attache USB drive. About a year ago I got really into the idea that my flash memory would wear out eventually, kind of like a finite resource. I bought a bunch of USB drives in anticipation, it would be fun like using up a ballpoint pen.

However since then I've looked into it more, took apart some USB drives, looked at their controllers, took a lot of time looking for their spec sheets or at least their distributor advertisements...

It seems like nowadays, even the cheaper USB drives have controllers capable of static wear leveling. As a review, dynamic wear leveling spreads writes across free blocks and a pool of blocks dedicated for replacing blocks that go bad. Static wear leveling spreads writes not only across free blocks but all blocks.

I've used this USB drive for over a year now, I've logged the write volume via a script and iostat - 210 gigabytes of writing so far. A couple months ago I did some quick calculations:
Assuming my USB drive has perfect static wear leveling and each of its blocks can handle 10,000 writes and there is no pool of empty blocks, that means that my 8GB drive should be able to handle 8GB * 10,000 = 80TB of writes before failing. I write about 1GB a day, meaning my USB drive would last 80,000 days or about 240 years with some generous rouding.

However, an academic paper looking at the endurance of flash suggests true endurance is likely around 100,000 writes per block. Who knows how much space is reserved as a replacement pool, and who knows what the controllers are really doing.

I'm not saying USB drives last forever; I've had a handful of USB drives fail on me. However the way they failed make me believe it was a controller failure rather than a flash failure. Curiously, two of these failures were with Sandisk USB drives - which have a pretty good reputation with an ultra-secret wear algorithm. I've read that a more common failure point for cheaper USB drives such as "swivel" USB drives are with the crystal used to create the USB timing signal.

I don't know how things translate over to SD cards, perhaps things might be different seeing as how the SD cards are so much smaller. But electronics are generally very tiny things with large packages, so I wouldn't be surprised if the technology in SD cards is the same or nearly the same as USB drives.

As for the best USB drive to use, all of my internet reading on USB drives suggests that would be the Sandisk Extreme USB 3.0. It seems this USB drive actually has an SSD controller, the assumption being that this means very efficient static wear leveling. It also easily saturates the USB 2.0 ports of any Raspberry Pi.

However, like I said - I've never had a USB drive die on me in a way suggesting flash failure, where the data ends up being readable but writing isn't possible. That doesn't mean flash doesn't die - maybe my flash drives died because of flash failure but the end presentation was different. I've also certainly heard of flash dying as expected, it's not unheard of. My point is that a USB drive or SD card isn't necessarily limited by flash lifespan, but can also end up breaking from other things like the non-flash hardware or controller software corruption.

broe23
Posts: 903
Joined: Thu Jan 28, 2016 9:35 pm
Location: Central IL
Contact: Website

Re: Thinking about replacing linux box with Rpi

Sun Jan 08, 2017 1:36 am

I personally would split the servers between separate PI's and use at least a 64GB SSD minimum, along with a RTC card on each server. Running off of just the SD card will wear it out in no time if you are constantly writing stuff to it.
Ren: Now listen, Cadet. I've got a job for you. See this button? Ren: Don't touch it! It's the History Eraser button, you fool! Stimpy: So what'll happen? Ren: That's just it. We don't know. Maybe something bad, maybe something good.

User avatar
bensimmo
Posts: 4567
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Thinking about replacing linux box with Rpi

Sun Jan 08, 2017 7:50 am

mfa298 wrote:
bensimmo wrote:All while taking picture every half or so seconds, logging form SenseHat as fast as possible and GPS co-ordinates.
Only twice all 3 happening at one though.
Still we loose the last 4 or 5 pictures to jpg corruption unreadabke (I assume not fully written), datalogs are always readable though.
There was (possibly still is) an obscure bug with using the camera and other gpio at the same time due to some race condition. A bit more detail should be accessible at https://groups.google.com/forum/#!topic ... _0l7I5mbuE
Interesting, but it's not that.
It is as far as I can be bothered to think, a shelf written jpg (picture and green patches) for one and then pretty much placeholders for the rest.
Just a power yank/fail/ran out and so it couldn't fully write all the cache at that point.
I'm happy with that simple explanation (more importantly, so are the kids) ;-)

Not least as our ublox uses UART, so it would be the SenseHat causing the problems with the camera.
I don't think I've seen that style picture during our use.


As for SD card reliability, I've had good old Hard drives fail from a few month to many many years. So it not limited to SD cards ;-)

ejolson
Posts: 5154
Joined: Tue Mar 18, 2014 11:47 am

Re: Thinking about replacing linux box with Rpi

Sun Jan 08, 2017 9:42 am

jamesh wrote:Please stop referring to the P as a toy computer, it's not a valid statement. I'll delete any post that do so in the future. Also, your impression of Pi3 seems to be at odds with the majority - sound like you might have an edge case SoC. Unless you have this on multiple Pi's which would be odd as its not a common complaint.
You may be right. It seems the exact words I used might be misunderstood by some as implying the Pi is not a real computer. That is not what I meant. When I was growing up my toy camera took real pictures, toy fishing pole caught real fish, toy record player played real records and strangely enough the toy gun shot pellets with enough force to kill a chipmunk. My dad thought the best kind of toys are those which actually work and I've grown up with similar expectations. My understanding is that the Pi was not designed as a router or file server but as a real computer children can own, play with and learn from without fear of the financial consequences when something stops working.

I am happy that my impression of the reliability of the Pi 3B is at odds with the majority. As it is important for the Pi computers to work well, I would suggest testing new designs using linpack-hpl before putting them into production. I sincerely hope physical computing and affordable ownership of working computers proves to be a good strategy for teaching young people to read and write computer programs. It could change the world.

Returning to the original topic, I'll try to clarify what I meant to say before: Although not designed as a server, with proper configuration I think a single Pi 3B would be able to simultaneously function as a web, DNS, mail, Git, NTP and file server for two or three people in a slow but reasonably reliable way.

Return to “General discussion”