Coffee
Posts: 4
Joined: Wed Oct 31, 2012 10:39 pm

Multiple raspberry pi's as server?

Wed Oct 31, 2012 10:45 pm

Hi there,

Somewhere online i read the interesting article about someone who made a RasPi cluster with 64 RasPi's. He also published and entire tutorial on how to do this, and i'd like to do what they did on a smaller scale (using 2 or 4 raspi's). However i want to partially set it up as a home server. So will the cluster be able to run a apache webserver?

My first raspberry is coming next month, so maybe i'll be able to order more of them before the end of the batch.

Thank you!

P.s. Is this in the right forum category?

W. H. Heydt
Posts: 10772
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Multiple raspberry pi's as server?

Thu Nov 01, 2012 12:40 am

People have used single Pis as servers, including web servers running Apache.

The 64 Pi "bramble" was a "poor man's supercomputer". The idea was an exploration of a home-brew significantly--I refuse to call it "massively"--parallel processor.

The problem with the Pi for most types of server is that it has rather limited I/O capability. You're throttled down to one of three things...the SD card, a USB stck, or some form of disk drive attached through a USB port.

This is not to say that you *can't* make a server out of Pi, but you're not going to get exactly stellar performance by doing it.

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Multiple raspberry pi's as server?

Thu Nov 01, 2012 3:03 am

My RasPi Server has been up for 2 months with no problems. Well I have killed it twice trying to update it. But it was back up pretty quickly. It is only a web page but it has been running without stop. I am using a SD card.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

Wendo
Posts: 142
Joined: Sun Jun 10, 2012 8:27 pm

Re: Multiple raspberry pi's as server?

Thu Nov 01, 2012 6:29 am

A high performance cluster (which is what you're talking about) doesn't work to make a single program like apache run faster. It works by taking a single large job, with a large dataset, and splitting that job and dataset so each node can perform a small section of the total job and the results can come together at the end.

For example, rendering a movie on a cluster is done by giving each CPU core a single frame to render, once all the frames are done they are bought back together and tied together to make a movie.

There are other types of clusters that do work as you're thinking this may work, however they depend on _very_ fast connections between the nodes, that being 10s or hundreds of times faster than the ethernet port on the pi.

So in short, the answer is no, you can't make apache run faster by running it on a cluster, nor any other "standard" program

thradtke
Posts: 492
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: Multiple raspberry pi's as server?

Thu Nov 01, 2012 7:33 am

I could imagine running webservers concurrently, all accessing the same data source via NFS and/or SQL. One Pi would be the access point redirecting requests to different Pi's. This is especially interesting if you have e.g. php scripts doing some work (like CMS). Over here, I have something like that running XML-preprocessing and Apache FOP on the server. But that's a very special case where you could benefit. I wouldn't really use the RPi in such cases except for the fun of it.
Rocket Scientist.

Coffee
Posts: 4
Joined: Wed Oct 31, 2012 10:39 pm

Re: Multiple raspberry pi's as server?

Thu Nov 01, 2012 5:31 pm

Wow, this board is really alive.. Thanks for responding (or do i say reacting?) so quickly.

I am worried that the raspberry pi can't handle running owncloud, a mail server, ftp server And a dlna server at the same time. Do you think i can have the apache and ftp server running one one RasPi and the mail server on another (the mail server also has to run an apache instance for a webmail interface)? Ideally even acces the same storage medium...

Coffee
Last edited by Coffee on Thu Nov 01, 2012 5:32 pm, edited 1 time in total.

Coffee
Posts: 4
Joined: Wed Oct 31, 2012 10:39 pm

Re: Multiple raspberry pi's as server?

Thu Nov 01, 2012 5:32 pm

Oops, double post...
Coffee

ghans
Posts: 7871
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Multiple raspberry pi's as server?

Thu Nov 01, 2012 6:07 pm

I really see no problems with this. As long you do not expect regular
Linux packages to distribute their workload on their own.
AFAIK Apache has alredy some load-balncing settings inbuilt which you can
configure to create clusters.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Borner
Posts: 49
Joined: Tue Sep 25, 2012 2:53 pm
Location: .de

Re: Multiple raspberry pi's as server?

Fri Nov 02, 2012 9:07 am

I am worried that the raspberry pi can't handle running owncloud, a mail server, ftp server And a dlna server at the same time.
Why are you thinking this way?
That's not correct.

I have running owncloud, (s)ftp Server and dlna Server at an 256MB RAM RasPi. And it works fine. I'm sure, an additional mailserver will also work fine.
It depends on the number of clients using those services. Running as an home server is absolutely no problem.
Do you think i can have the apache and ftp server running one one RasPi and the mail server on another (the mail server also has to run an apache instance for a webmail interface)?
Sure. You can setup every service on an single RasPi.
I don't know, how good is your knowledge in server cluster is. The point is, that some peoples try (would like) to "patch" some machines together in order to get one big machine which has much more power.
Building a cluster depends (in most cases) on software which handles the services, sometimes hardware does it.
Easy construct: a 2 node webserver cluster and one NAS as central storage. For this you need "something" which redirects the users webserver request to node 1 or node 2 (which can be done by DNS Servers, Loadbalancers, switching IP, ...)
But the point is, on an 2 node cluster you will not have the performance of an Dual-CPU RasPi, because your request doesn't scale over nodes.

Or an other example as @Wendo wrote: video encoding in an cluster. Take one server as masters to start encoding and (mostly) this servers splits the video into small parts in order to transfer those parts to an other machine to start encoding of this part there. In this case: again an software cluster.

Btw: all of the real big clusters i know are working with software (...and maybe loadbalancers). So once again the question for you is: which services you like to provide and which cluster methods are the best one.

Borner

Return to “General discussion”