1

I'm thinking of getting the raspberry pi 3. I'd like to use it as a media center and in the future possibly set it up as a server to host my own website. Can the raspberry pi do it all at the same time? Can that be done with the same operating system?Will I need a cluster?

2

Maybe.

A media centre and web server will operate fine together on any system, and this will be true for most combinations you can imagine. I'll run through my considerations when asking myself the same question...

Conflicts

Some media centres offer an HTTP-based remote control service which, when enabled, might try to use port 80 (which the web server will already be using) but this should be simple enough to change. Ports 81 or 8080 are common alternatives - the latter because it doesn't require root permission to acquire.

Load / performance

This depends how complex a website and how much traffic it will be expected to handle.

A simple web server serving flat HTML files and assets uses hardly any processing power. Small websites can be cached in RAM reducing disk access. A Wordpress or Drupal site will require dependencies such as a database server, PHP server, caching layers and so on which need a lot of disk access, CPU time and potentially memory too.

The media centre will also be heavy on disk access, and memory/CPU while you browse the UI, but most of the work will be done by the video decoder.

Chances are the media centre is using an SQLite or similar database which you could share. Using a front-end cache or Cloudflare will reduce load also.

Security

Last but foremost in my mind. Is it acceptable to have your video and music collections on a server accessable from the Internet? Yes probably. In fact your media centre software will perform much better when connected. Be aware your Pi will receive undesirable attention, especially with a domain name pointing at it. Forward only the ports you require through your router, run a firewall, secure your SSH server, use only private/public keys for authentication and look up port knocking :)

0

Will I need a cluster?

Please see

Also: if you have two different purposes in mind and more than one computer, why would you bother "clustering" them to perform two those different purposes in a distributed manner? Not to say it is never done, but this it would be a tad absurd in this context unless the primary goal is to learn about clustering, load balancing, etc.

set it up as a server to host my own website...Can the raspberry pi do it all at the same time?

The major question there would be the scale of the web site and the software you choose to implement it. All pi's are limited in terms of their network speed due to a shared ethernet/USB bus, and a max 100 Mbps ethernet (but I believe the Pi 3's wifi is, in theory, 150 Mbps, and separate from this).

So if you want to stream and watch media while serving a few hundred simultaneous clients online, it is probably not a good choice. In that sense, no Pi is a good choice as a enterprise scale web server, period.

However, if your needs are more modest then there is no problem. Most web servers have a low memory footprint and do not consume processor time except when being accessed, and even then, since the bottleneck is I/O, not necessarily that much -- but this depends on the nature of the content.

Can that be done with the same operating system?

Yes; the media center commonly used on the pi is Kodi and it is a single application available on most of the commonly used OS's, as are most portable (i.e., not platform specific) web servers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.