Raspberry As A Dedicated Server?


Raspberry is one of the most revolutionary innovations in modern computing. It sold over 5 million units since 2015. Most of the people use it as a media centre, video games emulator console, music player, advertising outdoors... And now Copahost thought: why not using it as a cheap dedicated server?



First, the set-up



We used a stock Raspberry Pi 3B (49EUR), with 1GB RAM, 1.2GHz 64-bit quad core ARM CortexA53 CPU, and one Raspberry Pi 3 B (49EUR). The storage is a 32GB Adata Class 10 microSD card (9EUR).



This Cortex-A53 is 10 times faster than the original Raspberry 1 CPU. This is a huge improvement.



We installed Raspbian Jessie on it.



Let's bring the Raspberry "junior" dedicated server into the data center and power it on



Raspberry-config allows you to expand the filesystem



By default, Raspbian will partition the SD card only using a small partition. We must enter raspi-config, in order to expand the filesystem to use all the available space in the SD card.



# raspi-config



Then, select "Expand Filesystem" then hit enter.



It is important to reboot the device in order for changes to take place.



After the reboot, we can now see the whole space mounted in /



Installing LAMP - Apache MySQL and PHP



We prepared a standard and popular environment, similar to a dedicated server. Installed and configured Apache 2, PHP 5, 5.6. Raspberry was used to test a WordPress website.



Let's start by installing Apache web server



# sudo apache2 install apache2



Let's now install PHP5 using Libapache



# sudo apt-get install php5 libapache2-mod-php5 -y



Now we will install MySQL



# sudo apat-get install mysql server php5mysql y



Let's see it running



Benchmark - Dedicated server vs Raspberry Pi 3 B



To check the limit of the web server's stress, we ran a stress test. It was possible to make 50 concurrent and consecutive connections to it using curl. The results were amazing. It was quite stable with up 35 connections, but still worked perfectly with 50 simultaneous connections.



We created a script called stress.sh, with this content:



Of course we know Raspberry have a simple CPU, compatible with its price. So we put an old dedicated server together and tested both of them with sysbench for linux.



Sysbench got a score 40.23s E2180 to 954.90s Raspberry Pi 3. The lower the score is, the better. The performance of the Raspberry Pi 3 may be a bit disappointing if compared with a standard dedicated server.



This means that this CPU is 23x slower than a Pentium Dual core standard Pentium.



Conclusion: is it possible to run Raspberry Pi as a dedicated server in production?



The Cortex-A5 CPU, present in Raspberry 3, is 10 times faster than Raspberry Pi 2 CPU. Using it to host a simple site with a simple MySQL database works perfectly. Minecraft You can consider using a Raspberry dedicated server for simple operations. Performance can be affected when you load many WordPress plugins into a MySQL database.



The pros: Very low power consumption Can be used as a small and simple web and database server External USB Hard disks can be connected to it Very low price Nice style



The cons: Poor CPU performance. Poor IO performance. This is because it depends on an SD Card. There is no reboot button (there are mods for it).



A VPS Server is the best choice for those who require a powerful but affordable server.



Raspberry will be more competitive in the future and should be able to handle larger websites. Copahost hopes that the "Junior Server" will become a more competitive piece of hardware in a few years.