tiny cheap server [Raspberry Pi]

Questions on how we spend our money and our time - consumer goods and services, home and vehicle, leisure and recreational activities
Post Reply
User avatar
legion
Posts: 79
Joined: Sun Nov 27, 2011 1:55 pm

tiny cheap server [Raspberry Pi]

Post by legion » Sat Mar 09, 2013 11:10 am

I got a tiny server called a raspberry pi 2 months ago it costs 35 dollars are runs a version of linux for armv6l procs it also uses camera flash memory as disk. Was so impressed with it I ported my 2 websites over to it I get about 50k unique visitors a month and run a board exactly like this one with a mysql backend and it is able to keep up just fine i have had 99.9% uptime. the really cool thing though is that it only costs $35 and since it is powered of a 5v phone charger my cost to run it 24/7 is next to nothing compared to the beige tower it was running on before. I wrote a little software to compress and encrypt the DB, webroot, and all critical files and email them to my gmail account for "offsite storage".

Anyway if you run a tiny little site this is a very fun solution

here is a pic of what the server looks like hosted on the server itself
http://www.simplefit.org/raspi.jpg

I am a Linux engineer for my day job and chose Linux because of its reliability. We host the largest cancer care EMR on the planet and have some Linux systems that have not been rebooted in 7 years!

Cheers

User avatar
LazyNihilist
Posts: 874
Joined: Sat Feb 19, 2011 9:56 pm
Location: 6.66% (xirr)
Contact:

Re: tiny cheap server

Post by LazyNihilist » Sat Mar 09, 2013 11:13 am

Legion,

I've been thinking of purchasing one of these myself. I have a few questions.
What distro of Linux does it use? I am comfortable with using Debian, so I hope Debian can be installed.
Looking at the website, this comes only with the board. Did you need to purchase a power cable? Any other accessories that you got with it?
The strong do what they can and the weak suffer what they must -Thucydides

dsanders79
Posts: 52
Joined: Thu Dec 20, 2012 10:01 pm

Re: tiny cheap server

Post by dsanders79 » Sat Mar 09, 2013 11:31 am

They just come with the board. You are responsible for everything else power supply, SD card, etc. It seems a bunch of issues are related to the power supply so make sure you get a good one of those. There are several distributions available including some that are debian based. If my memory serves me correctly the distro available directly from Raspberry Pi is debian based. In my limited testing I found the different classes of SD cards to make a big difference. I was trying to run RaspBMC (XBMC distribution for RPi) and it was unusable with a class 4 card. I tried a class 10 card and it made a night and day difference.

I think these are a couple pretty cool projects:
http://pi.qcontinuum.com/project.html
http://www.zdnet.com/raspberry-pi-meets ... 000004209/

User avatar
legion
Posts: 79
Joined: Sun Nov 27, 2011 1:55 pm

Re: tiny cheap server

Post by legion » Sat Mar 09, 2013 11:43 am

LazyNihilist wrote:Legion,

I've been thinking of purchasing one of these myself. I have a few questions.
What distro of Linux does it use? I am comfortable with using Debian, so I hope Debian can be installed.
Looking at the website, this comes only with the board. Did you need to purchase a power cable? Any other accessories that you got with it?
You can compile any Linux distro to run on the hardware but there are pre built Debian images available for simplicity. For power I use an old android phone charger and pulled a 4g sdhc card out of a camera. the default debian image is about 1.8g but if you do a min headless install of debian its like 300mb so plenty of space. I think the system can accept cards up too 32g. I also got a little usb flash drive to user as seconday storage that I have mounted under /usb.


Here are the disk speeds I get not very fast but fast enough for what I am hosting: apache, mysql, PHPBB3, DNS, SMTP, SSH

camera mem:

# hdparm -t /dev/mmcblk0

/dev/mmcblk0:
Timing buffered disk reads: 62 MB in 3.08 seconds = 20.12 MB/sec

USB drive:

# hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads: 58 MB in 3.03 seconds = 19.16 MB/sec

mud
Posts: 65
Joined: Mon Feb 21, 2011 9:20 pm

Re: tiny cheap server

Post by mud » Sat Mar 09, 2013 1:13 pm

very cool. these are cool machines, and I'd love to get one sometime.

Sounds like it would be perfect for a webserver...the only thing I'd worry about is running a critical website from a SD card. For the most part they're reliable, but I would take care to keep a current backup (as it sounds like you're already doing) for the event that it fails. Could you use a 2.5" external USB drive as the drive instead if needed (I forget if the Pi has a USB port)? Seems as though you'd get better speed and reliability. Shoot, grab a small/cheap-ish SSD and performance would blow the SD card out of the water, and likely give your website visitors faster load times, especially in times of heavy server load.

You know what would be really cool? Get two of these units, set them up identically and give your server a "hot spare" in case something happens with the first one. Setup some sort of data sync between the two to keep the database and files synchronized, and maybe add some sort of device out on the network that allows you to point to one device or the other for all www requests. Or have some device that can do that automatically...that would be sweet! Maybe there's a market for this type of 'micro server' with built in redundancy and failover? I'm sure there would be folks out there that would pay for it. I don't have enough Linux knowledge to put something like this together, but I could certainly market such a device. PM me if interested :)

thanks for posting!

User avatar
Epsilon Delta
Posts: 7433
Joined: Thu Apr 28, 2011 7:00 pm

Re: tiny cheap server

Post by Epsilon Delta » Sat Mar 09, 2013 1:19 pm

mud wrote:Sounds like it would be perfect for a webserver...the only thing I'd worry about is running a critical website from a SD card.
For a critical website I'd also worry about the power supply, case, connectors etc.
Unless you package it correctly this will be pretty vulnerable to the household pet.

User avatar
LadyGeek
Site Admin
Posts: 49228
Joined: Sat Dec 20, 2008 5:34 pm
Location: Philadelphia
Contact:

Re: tiny cheap server [Raspberry Pi]

Post by LadyGeek » Sat Mar 09, 2013 1:29 pm

Add me to the list of "I want one." I'm in the Red Hat camp now, but am no stranger to debian distros.

BTW - I retitled your thread. I couldn't pass that one up. :)
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.

mud
Posts: 65
Joined: Mon Feb 21, 2011 9:20 pm

Re: tiny cheap server

Post by mud » Sat Mar 09, 2013 1:49 pm

Epsilon Delta wrote:
mud wrote:Sounds like it would be perfect for a webserver...the only thing I'd worry about is running a critical website from a SD card.
For a critical website I'd also worry about the power supply, case, connectors etc.
Unless you package it correctly this will be pretty vulnerable to the household pet.
agreed, which is why 2 of them running side by side would be great for reliability....redundant everything. But, something like this would likely never host a website with 1 million visitors a month or a site with critical e-commerce functionality, etc. For hobby websites, something like this is perfect and can save a bunch on hosting costs on something that may not be bringing in much/any $$. Of course, you likely need access to a business-level ISP connection to serve everything (unless your residential-level ISP leaves port 80 open and allows using the connection of hosting).

There are of course better ways to host websites that take into account redundancy along every step of the way (server, power, internet connection, etc), but for non-critical sites, this sort of thing will always be a great solution.

User avatar
legion
Posts: 79
Joined: Sun Nov 27, 2011 1:55 pm

Re: tiny cheap server [Raspberry Pi]

Post by legion » Sat Mar 09, 2013 1:58 pm

Epsilon Delta wrote:
mud wrote:Sounds like it would be perfect for a webserver...the only thing I'd worry about is running a critical website from a SD card.
For a critical website I'd also worry about the power supply, case, connectors etc.
Unless you package it correctly this will be pretty vulnerable to the household pet.
well that's the same for a beige tower and google bot has me for 99.9% uptime since 2006 when I started the site. I submit a sitemap via cron every night to googlee with usually 5k+ pages from my forum so I have google spidering my site 24/7. the SDHC cards since no moving parts/friction/heat are statistical way more reliable than most consumer "mechanical spinning platter" hard drives. I have a duel atom/ssd server with tiny power consumption but when with the pi because its more fun and even more energy efficient.

Here is a neat way to do a disk dump on the pi from the sdhc to a usb stick "nohup dd if=/dev/mmcblk0 of=/usb/simple-pi.img" [this basically does a block level snapshot to restore you just revers the command] I do this once a month and have daily webroot and DB changes emailed to my gmail via cron as well. Really my largest source of downtime is my ISP/DSL. In the future since I host my own DNS I plan to have a static site in amazons cloud which is free for my use case.

If I really wanted to be bullet proof I would host in amazons cloud and It would still probably be free since my pages/data use are so light but I like to have a small physical box to tinker with.

Here is amazons free cloud where you can carve out a small linux instance for free very fun as well I use this for several sites.
http://aws.amazon.com/free/

User avatar
legion
Posts: 79
Joined: Sun Nov 27, 2011 1:55 pm

Re: tiny cheap server

Post by legion » Sat Mar 09, 2013 2:05 pm

mud wrote:
Epsilon Delta wrote:
mud wrote:Sounds like it would be perfect for a webserver...the only thing I'd worry about is running a critical website from a SD card.
For a critical website I'd also worry about the power supply, case, connectors etc.
Unless you package it correctly this will be pretty vulnerable to the household pet.
agreed, which is why 2 of them running side by side would be great for reliability....redundant everything. But, something like this would likely never host a website with 1 million visitors a month or a site with critical e-commerce functionality, etc. For hobby websites, something like this is perfect and can save a bunch on hosting costs on something that may not be bringing in much/any $$. Of course, you likely need access to a business-level ISP connection to serve everything (unless your residential-level ISP leaves port 80 open and allows using the connection of hosting).

There are of course better ways to host websites that take into account redundancy along every step of the way (server, power, internet connection, etc), but for non-critical sites, this sort of thing will always be a great solution.

I got a second for redundancy and have thought about clustering mysql for fun.

If you have a site with say 1g static content you could use a service like akamai to serve terabytes to billions a day all from a pi :)

obviously this is just for fun home sites but if you are hosting from home and your internet link is < 20mb up that's what will be saturated first not the PI getting i/o bound then is down to CPU and memory which are less likely bottlenecks in this type of web server scenario.

z0r
Posts: 69
Joined: Sat Nov 10, 2012 1:50 am

Re: tiny cheap server [Raspberry Pi]

Post by z0r » Sat Mar 09, 2013 2:18 pm

mine is a torrent downloader (transmission-daemon) and nas (samba). Most consumer grade nas products are garbage so being able to make one for $35 plus an external USB drive is pretty fantastic. And it only takes 2 watts and doesn't boot from a spinning disk, so it's way better than an old PC sitting in a corner turned into a server.

User avatar
legion
Posts: 79
Joined: Sun Nov 27, 2011 1:55 pm

Re: tiny cheap server [Raspberry Pi]

Post by legion » Sat Mar 09, 2013 2:39 pm

z0r wrote:mine is a torrent downloader (transmission-daemon) and nas (samba). Most consumer grade nas products are garbage so being able to make one for $35 plus an external USB drive is pretty fantastic. And it only takes 2 watts and doesn't boot from a spinning disk, so it's way better than an old PC sitting in a corner turned into a server.
Do you use encryption to get torrents?

z0r
Posts: 69
Joined: Sat Nov 10, 2012 1:50 am

Re: tiny cheap server [Raspberry Pi]

Post by z0r » Sat Mar 09, 2013 3:32 pm

some with and some without, it has no trouble with the CPU load

SimonJester
Posts: 1680
Joined: Tue Aug 16, 2011 12:39 pm

Re: tiny cheap server [Raspberry Pi]

Post by SimonJester » Sat Mar 09, 2013 3:39 pm

I'd love to see them come out with a higher memory model say 2 gig or 4 gig.
"They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety." - Benjamin Franklin

User avatar
Epsilon Delta
Posts: 7433
Joined: Thu Apr 28, 2011 7:00 pm

Re: tiny cheap server [Raspberry Pi]

Post by Epsilon Delta » Sat Mar 09, 2013 3:54 pm

legion wrote:
Epsilon Delta wrote: For a critical website I'd also worry about the power supply, case, connectors etc.
Unless you package it correctly this will be pretty vulnerable to the household pet.
well that's the same for a beige tower and google bot has me for 99.9% uptime since 2006 when I started the site.
It's probably a bit worse for the Pi, since the power supply is probably an old cell phone charger and there is no case so it's susceptible to mechanical insults from dropped coins etc. It's not insurmountable, but for three nines reliability you'll want to do more that throw it all in a shoe box. As you say the SD card is probably the least of your worries.

Alex Frakt
Founder
Posts: 10853
Joined: Fri Feb 23, 2007 1:06 pm
Location: Chicago
Contact:

Re: tiny cheap server [Raspberry Pi]

Post by Alex Frakt » Sat Mar 09, 2013 4:31 pm

Epsilon Delta wrote:It's not insurmountable, but for three nines reliability you'll want to do more that throw it all in a shoe box.
That looks like at least half the fun :-)

https://www.google.com/search?q=raspber ... f&tbm=isch

Image
http://www.adafruit.com/blog/2012/08/24 ... pberry_pi/


Image
http://www.instructables.com/id/How-to- ... ltoids-Ti/

Valuethinker
Posts: 36691
Joined: Fri May 11, 2007 11:07 am

Re: tiny cheap server [Raspberry Pi]

Post by Valuethinker » Sun Mar 10, 2013 1:49 am

http://www.zdnet.com/we-thought-wed-sel ... 000009718/
The Raspberry Pi Foundation was established with the goal of inspiring the next generation of programmers: it just turned out they felt the best way of doing that was to provide a computer cheap enough for kids and easy enough for them to hack.
The reasoning behind the Raspberry Pi wasn't to head off some future IT skills crisis — Upton says the crisis is already here.


In his day job Upton is a system-on-a-chip architect at chip designer Broadcom and says he sees firsthand the evidence of the lack of new computer scientists, software engineers and programmers coming out of UK universities.
Sales of the Raspberry Pi board are split about one third in the UK, one third in North America and one third in the rest of the world. Outside the UK and US most sales are in Europe. They remain relatively weak in China, India and South America.

"I think that Britain had the strongest 1980s indigenous computer culture and that a lot of the early Pi adopters are people like me who had a BBC Micro" — Eben Upton

"We're strongest in the UK, I think for two reasons," Upton explained. "One, we've had an enormous amount of support from the press and people in general. I also think that Britain had the strongest 1980s indigenous computer culture and that a lot of the early adopters are people like me who had a BBC Micro."

Early adopters of the Pi were in general not children with an interest in programming, but men with passion for computing who saw a cool new toy for them to hack. Grown-up tech enthusiasts accounted for about four-fifths of sales at launch according to Upton but the pendulum is now swinging back towards kids, as both parents, teachers and children buy the boards. He estimates that hundreds of UK schools have also picked up the device for use in lessons.

User avatar
cjackson0
Posts: 641
Joined: Thu Aug 21, 2008 2:57 pm
Location: St. Louis, MO

Re: tiny cheap server [Raspberry Pi]

Post by cjackson0 » Sun Mar 10, 2013 4:46 pm

z0r wrote:mine is a torrent downloader (transmission-daemon) and nas (samba). Most consumer grade nas products are garbage so being able to make one for $35 plus an external USB drive is pretty fantastic. And it only takes 2 watts and doesn't boot from a spinning disk, so it's way better than an old PC sitting in a corner turned into a server.
Mine too.

I have also setup a blocklist from iblocklist.com to reduce the likelihood of connecting to "unwanted" IPs in the swarm :wink:
Sent from my iphone

Mudpuppy
Posts: 5889
Joined: Sat Aug 27, 2011 2:26 am
Location: Sunny California

Re: tiny cheap server [Raspberry Pi]

Post by Mudpuppy » Sun Mar 10, 2013 5:14 pm

Has anyone tried using a Raspberry Pi as a streaming video server? It has HDMI out and supposedly can handle 1080p. I'm thinking how you can't use free Hulu on a Roku or other set-top devices, but you can use it on Linux. So if the Raspberry Pi can handle the video stream, it might make a more versatile alternative to the low-end Roku box.

Default User BR
Posts: 7501
Joined: Mon Dec 17, 2007 7:32 pm

Re: tiny cheap server [Raspberry Pi]

Post by Default User BR » Sun Mar 10, 2013 6:35 pm

Mudpuppy wrote:Has anyone tried using a Raspberry Pi as a streaming video server?
Mentioned in this thread: http://www.bogleheads.org/forum/viewtop ... 1&t=110322


Brian

z0r
Posts: 69
Joined: Sat Nov 10, 2012 1:50 am

Re: tiny cheap server [Raspberry Pi]

Post by z0r » Mon Mar 11, 2013 4:15 pm

new use for mine: ebay bid sniper. With openjdk-7-jre installed (in package manager) it can run jbidwatcher acceptably. I sit it on a desktop and set it through VNC (there's no way to get it to run as a daemon anyway). The raspberry pi is a bit stressed doing this- it takes about 20% cpu at idle - but it processes snipes just fine. Ebay sniping is a "frugal thing I do" and it sidesteps a lot of irrationality I see in competing bidders. I recommend it to anyone using ebay.

Protip: I have to use openjdk because the oracle java build only runs on wheezy soft float and I have hard float and don't want to reinstall the os. Oracle's java is a lot faster, so if you're making a pi from scratch for ebay sniping, use wheezy soft float.

User avatar
Meta4
Posts: 15
Joined: Thu Dec 27, 2012 6:03 pm
Location: Portland, OR

Re: tiny cheap server [Raspberry Pi]

Post by Meta4 » Mon Mar 11, 2013 11:46 pm

Pic of my RPi case - repurposed covered butter dish and some other stuff from the dollar store:

Image

Too bad it died shortly after :(

Not sure I'll get another; there's several other similar devices like the Beagle Board which are more flexible in some ways.

pheleven
Posts: 49
Joined: Wed Feb 20, 2013 1:56 pm

Re: tiny cheap server [Raspberry Pi]

Post by pheleven » Tue Mar 12, 2013 3:03 am

First off, this is an awesome project. Do note though that the CF cards are not especially known for longevity and certainly are not more reliable than a disk. Doing something like writing a database will wear them out fairly quickly if it has high volume - they have limited write life like an SSD but most don't have as good of wear leveling. As others mentioned, with static/fairly static content these are perfect for low volume web hosting and are also great for complex sensors and in some cases media centers, if you're into DIY.

smalldata
Posts: 19
Joined: Mon Mar 26, 2012 9:09 am

Re: tiny cheap server [Raspberry Pi]

Post by smalldata » Tue Mar 12, 2013 1:29 pm

Default User BR wrote:
Mudpuppy wrote:Has anyone tried using a Raspberry Pi as a streaming video server?
Mentioned in this thread: http://www.bogleheads.org/forum/viewtop ... 1&t=110322
Brian
I use this to play videos stored on my windows computer (using samba). It has good hardware support for videos, so it has no problem with 1080p video in H.264 and will handle MPEG-2 videos just fine if you pay a few bucks for the hardware support (see http://www.raspberrypi.org/archives/1839).

I also stream TV shows from online using the "free cable" plugin for raspbmc.

sleepyz
Posts: 12
Joined: Tue Sep 01, 2009 11:41 pm

Re: tiny cheap server [Raspberry Pi]

Post by sleepyz » Tue Mar 12, 2013 2:24 pm

RPi's are great. I have been playing around with XBMC on mine and using it as a low power server for www/transmission/ssh/etc.

One other option some of you might be interested in, is getting a PogoPlug and running Arch Linux on it. adoramacamera on ebay is selling new PogoPlugs for $15 shipped. Load Arch Linux on it, and you have a headless low power server for $15. I have been running a website/transmission server on one for over a year without problems.

Post Reply