9
Small Data Center using Raspberry Pi 2 for Video Streaming P.J.E. Velthuis University of Twente P.O. Box 217, 7500 AE Enschede The Netherlands [email protected] ABSTRACT Network throughput in small data centers increases due to the increasing number of video steaming service con- sumers. Raspberry Pi 2’s (RPi2s) may make video stream- ing analysis more efficient, for reasons of costs and energy consumption. Video streaming is analyzed by building a cluster of RPi2s using the Design Science methodol- ogy and evaluated with several load balancing benchmarks targeting CPU processing, power, and network efficiency. Furthermore, temperature measurements are obtained and show that low heat is generated while operating, due to low power consumption. The power consumption of ex- isting streaming servers can be improved, since they have significant electricity needs while idling. When scaling the number of RPi2 microservers improvements can be made on network throughput and power consumption. By using RPi2s, performance analysis of video streaming in small data centers is cheaper and more power efficient. Keywords Cloud computing, Raspberry Pi 2, small data center, video streaming, load balancing, electricity consumption data center 1. INTRODUCTION Today, most people have data in the cloud. Despite com- munity attention, research and development of Cloud Com- puting services are still in its early days [37]. Cloud computing is a trend in IT that moves processing power and data away from personal computers into data centers [12]. In the future, most Internet users are ex- pected to access online services over lightweight portable devices requiring a lot of network bandwidth, which causes bottlenecks [12]. To prevent them, data centers are built around the globe. These data centers can be greatly im- proved [1, 5], for example by reducing space and electricity requirements. Nowadays, technologies such as the pow- erful ARM processor can be used. Companies want to explore the possibilities of the Raspberry Pi 2 model B (RPi2), because of its ARM processor and the low price [30]. The RPi2 is released in 2015 [14]. The price of a RPi2 is around 40 euro, which is cheaper than most steaming servers used in small data centers. Some data centers offer Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy oth- erwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. 23 th Twente Student Conference on IT June 22 st , 2015, Enschede, The Netherlands. Copyright 2015, University of Twente, Faculty of Electrical Engineer- ing, Mathematics and Computer Science. cloud computing using the RPi2 [30]. A RPi2 is a small computer with a power usage between two and four Watt [14]. In contrast, a normal server has a power usage between 75 and 250 Watt [30, 6]. The low power consumption of the RPi2 and its computing power could mean that it is better to use a RPi2 for specific small tasks that do not demand an entire server. For this rea- son, research is done on the performance of the RPi2 in a small data center. A Raspberry Pi cloud can be the small data center for the future [37]. The RPi2 can be an ideal testbed for testing distributed software. In The Netherlands, one million people use Netflix [11]. Netflix is a popular video streaming service that provides HD movies. To achieve this, Netflix makes use of a Con- tent Distribution Network (CDN) [27]. Netflix is responsi- ble for approximately 30 % of the peak downstream traffic in the US [2]. As a result, the two main providers Comcast and AT&T were limiting the downstream traffic of Netflix. This caused a lot of criticism. To solve this, a new law for net neutrality has been made. [23]. In the Netherlands, video streaming services such as Youtube and Netflix have an increasing number of users, which may introduce similar downstream traffic problems. Nowadays, the data streaming problems are already increasing, which makes it interesting to perform more research in data cen- ters with video streaming. Most of the existing research in Computer Science is performed on expensive large servers [37]. It can be very useful to explore the possibilities of performing research on small computers, like RPi2s. This paper investigates the usefulness of RPi2s in small data centers with video streaming by considering space requirements and benchmarking their power consumption, load balancing capabilities, temperature, and throughput. Our main research question is: How well does the RPi2 perform in small scale data centers with video streaming? To answer for the main question, several sub-questions are researched, which are: 1. What are small scale data centers with video stream- ing and why are they used? 2. Is the RPi2 usable for video streaming? 3. Are the RPi2s useful for a data center considering cooling, data bandwidth, space allocation and power? 4. What setup does a RPi2 cloud with video streaming require? 5. How is availability in a RPi2 cluster with video stream- ing affected by various load balancing techniques? 1

Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

Small Data Center using Raspberry Pi 2 for VideoStreaming

P.J.E. VelthuisUniversity of Twente

P.O. Box 217, 7500 AE EnschedeThe Netherlands

[email protected]

2nd Author2nd author’s affiliation

1st line of address2nd line of address

2nd author’s email address

3rd Author3rd author’s affiliation

1st line of address2nd line of address

3rd author’s email address

ABSTRACTNetwork throughput in small data centers increases dueto the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis more efficient, for reasons of costs and energyconsumption. Video streaming is analyzed by buildinga cluster of RPi2s using the Design Science methodol-ogy and evaluated with several load balancing benchmarkstargeting CPU processing, power, and network efficiency.Furthermore, temperature measurements are obtained andshow that low heat is generated while operating, due tolow power consumption. The power consumption of ex-isting streaming servers can be improved, since they havesignificant electricity needs while idling. When scaling thenumber of RPi2 microservers improvements can be madeon network throughput and power consumption. By usingRPi2s, performance analysis of video streaming in smalldata centers is cheaper and more power efficient.

KeywordsCloud computing, Raspberry Pi 2, small data center, videostreaming, load balancing, electricity consumption datacenter

1. INTRODUCTIONToday, most people have data in the cloud. Despite com-munity attention, research and development of Cloud Com-puting services are still in its early days [37].Cloud computing is a trend in IT that moves processingpower and data away from personal computers into datacenters [12]. In the future, most Internet users are ex-pected to access online services over lightweight portabledevices requiring a lot of network bandwidth, which causesbottlenecks [12]. To prevent them, data centers are builtaround the globe. These data centers can be greatly im-proved [1, 5], for example by reducing space and electricityrequirements. Nowadays, technologies such as the pow-erful ARM processor can be used. Companies want toexplore the possibilities of the Raspberry Pi 2 model B(RPi2), because of its ARM processor and the low price[30]. The RPi2 is released in 2015 [14]. The price of a RPi2is around 40 euro, which is cheaper than most steamingservers used in small data centers. Some data centers offer

Permission to make digital or hard copies of all or part of this work forpersonal or classroom use is granted without fee provided that copiesare not made or distributed for profit or commercial advantage and thatcopies bear this notice and the full citation on the first page. To copy oth-erwise, or republish, to post on servers or to redistribute to lists, requiresprior specific permission and/or a fee.23th Twente Student Conference on IT June 22st, 2015, Enschede, TheNetherlands.Copyright 2015, University of Twente, Faculty of Electrical Engineer-ing, Mathematics and Computer Science.

cloud computing using the RPi2 [30].A RPi2 is a small computer with a power usage betweentwo and four Watt [14]. In contrast, a normal server hasa power usage between 75 and 250 Watt [30, 6]. The lowpower consumption of the RPi2 and its computing powercould mean that it is better to use a RPi2 for specific smalltasks that do not demand an entire server. For this rea-son, research is done on the performance of the RPi2 in asmall data center.A Raspberry Pi cloud can be the small data center for thefuture [37]. The RPi2 can be an ideal testbed for testingdistributed software.

In The Netherlands, one million people use Netflix [11].Netflix is a popular video streaming service that providesHD movies. To achieve this, Netflix makes use of a Con-tent Distribution Network (CDN) [27]. Netflix is responsi-ble for approximately 30 % of the peak downstream trafficin the US [2]. As a result, the two main providers Comcastand AT&T were limiting the downstream traffic of Netflix.This caused a lot of criticism. To solve this, a new law fornet neutrality has been made. [23].In the Netherlands, video streaming services such as Youtubeand Netflix have an increasing number of users, which mayintroduce similar downstream traffic problems. Nowadays,the data streaming problems are already increasing, whichmakes it interesting to perform more research in data cen-ters with video streaming. Most of the existing research inComputer Science is performed on expensive large servers[37]. It can be very useful to explore the possibilities ofperforming research on small computers, like RPi2s.

This paper investigates the usefulness of RPi2s in smalldata centers with video streaming by considering spacerequirements and benchmarking their power consumption,load balancing capabilities, temperature, and throughput.Our main research question is:

How well does the RPi2 perform in small scale datacenters with video streaming?

To answer for the main question, several sub-questions areresearched, which are:

1. What are small scale data centers with video stream-ing and why are they used?

2. Is the RPi2 usable for video streaming?

3. Are the RPi2s useful for a data center consideringcooling, data bandwidth, space allocation and power?

4. What setup does a RPi2 cloud with video streamingrequire?

5. How is availability in a RPi2 cluster with video stream-ing affected by various load balancing techniques?

1

Page 2: Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

The five sub-questions are investigated in the next sec-tions. Followed by a final section for conclusions and asection for future work. The first two research question area literature study into video streaming and cloud comput-ing. The last three sub-questions are the technical researchthat investigates the performance and possibility of RPi2sfor cloud video streaming.

2. RESEARCH METHODSIn the research the aim is to build a RPi2 cloud to mea-sure the performance. This is achieved by building a RPi2cluster and preforming benchmark tests on the cluster.The benchmarks are targeting CPU processing, power-,and network efficiency. In the benchmark tests severalload balancing techniques are used to see how the perfor-mance is influenced. The research uses the Design Sciencemethod proposed by Hevner [16]. The method is used formaking an architecture for a Raspberry Pi cloud. Thisdesign science method consists of three cycles:

Figure 1: Design Science cycles [16]

relevance cycle Represents the interaction with the do-main. Here the problems and opportunities are identified.The identification of these problems is in the next section.design cycle The most important cycle where the designis built. This is highlighted in section 6.rigor cycle Represents the interaction with the scientificcommunity. This information can be found in section 3and 6.

3. BACKGROUND3.1 Small scale computingSmall scale cloud computing is cloud computing with smallercomputation amounts than normal [9].The elasticity of computing resources is important to pro-vide cloud services [26]. Companies have their softwarerunning on virtual machines in data centers, these virtualmachines are scaled dynamically to the customers need [5].Using the cloud makes management easier.

Several cloud services have a huge network demand, thismay cause data centers to be unreachable [2]. Some com-panies have their own servers, because of the privacy andreachability of a data center, these servers are not energyefficient. By using more scalable microservers improve-ments can be made on energy efficiency.Netflix, a cloud service, is responsible for approximately30% of the peak downstream traffic in the US [2, 18]. Thedata flowing through the network has different patterns.To improve this there are several data patterns possible,it can for example make a huge different in sending datain small bursts or in one large burst [18].

Power Usage Efficiency (PUE) is an important aspect incloud computing [6]. In the future, there are more lightweightportable energy efficient devices coming, but they will de-mand more processes being performed by data centers

[26]. Nowadays, the data centers operate 12 to 20% ofthe time, the other 80 % of the time the servers insideare still using energy [6, 25]. Therefore there is a need forGreen Cloud Computing solutions that reduce the electri-cal power consumption and the environmental impact ofdata centers [6]. Microservers can be used to reduce theelectricity consumption.

3.2 MicroserverMicroservers are used in data centers [36]. Microserversconsume less electricity and have enough computer powerfor small tasks, therefore they can be used for high trafficusage tasks. Besides this they are small and are easier re-placed compared to a normal server, by using them datacenters can be more dynamic [36]. The ability to add andremove microservers more easily can save a lot of energy.A microserver often has a different processor compared toa normal server. The processors are often microprocessorslike ARM processors [36]. There are three big processorcompanies in the world: ARM, Intel and AMD. The Inteland AMD processors are better at complex tasks, whilethe ARM processor is better at small tasks [36]. In thedata center of the future more optimized microservers willbe used, they are better at specialized tasks and are moreenergy efficient [36]. One specialized task is video stream-ing.

3.3 Video streamingHTTP is used for video streaming, HTTP sends data framesto the client [18]. In the frames is the video stored [18]. Ifthe video frames are send fast enough the video will playwithout any delays, but if the send rate is too low thenthe video playback will alternate between periods of con-tinuous playback and periods of freezing [18].To make video streaming possible the client will connectwith video streaming service by its load balancer. Theload balancer will then locate the videos. To show howthe processes and operators operate with each other, theUML sequence diagram in figure 2 is used [7].

Figure 2: Video stream

In the diagram there is a loop for the video streaming, herethe client will keep requesting more parts of the videos. Ifthe client receives too much data its buffer gets full. Toprevent throwing data away the server then stops sending.Depending on the algorithm being executed the amount ofdata requested by the client can fluctuate.

A important streaming technique is adaptive streaming,its used for video on demand (VOD) [18]. VOD improves

2

Page 3: Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

the experience for the end-user by adapting the videoquality dynamically to the viewers network condition [13].This techniques uses the clients CPU and network pos-sibilities [13]. It delivers small sized chunks at multiplebitrates. The possibility to switch between versions of dif-ferent bitrates is in video streaming important for user ex-perience. This techniques is used for HTTP Live Stream-ing (HLS) [31]. HLS makes use of RTMP streaming andHTTP. HLS codifies video in the H.264 format.Another special kind of HTTP streaming is DASH (Dy-namic Adaptive Streaming over HTTP) [18]. In DASHthe video is encoded into several different quality videoversions. If the amount network bandwidth available ishigh, then the client selects chunks from a high-rate ver-sion and the other way around [18]. To make a smoothtransition between these versions possible there are inter-mediate versions, so the client sees the change in videoquality less suddenly.

3.4 Video streaming and load balancingVideo streaming uses load balancing techniques. Choos-ing a technique takes several aspects into account: perfor-mance, reliability and features [2, 3, 38]. There is a non-uniform demand for different movies, this causes problems.To overcome these problems the most popular movies canbe replicated, but this is expensive in terms of storagespace required. Using dynamic replication the load de-mand is solved [10]. Moving parts of a movie to less usedstorage devices, so that these can stream the movie. Theallocation of these movies only happens when there is atoo high increase of data demand on one specific storagedevice, so load imbalances can be prevented [10].Load balancers are generally grouped in two layers. Layer4, the transport layer and layer 7 the application layer [18].Layer 7 load balancers distribute requests based upon datain the application layer. Here below are two protocols anda language that is used:

1. HTTP, is the hypertext transfer protocol. In sec-tion 3.3 usages of this protocol are mentioned. Manyvideo streaming services use HTTP streaming [2].

2. RTMP is a real time messaging protocol , devel-oped for streaming data between a video player anda server [3]. RTMP is encapsulated in HTTP totraverse firewalls. RTMP has more video player op-tions compared to normal HTTP, thus giving theuser a better experience. A disadvantage comparedto normal HTTP is that it is sensitive for data spikes.These data spikes can result in a overload of thebuffer which results in an empty buffer, this can leadto a stop in the video playing.

3. Synchronized Multimedia Integration Language (SMIL)describes multimedia presentations [38]. The lan-guage allows media objects to be shared betweenpresentations and stored on different servers for loadbalancing. SMIL refers to media objects by URLs,

3.5 Video streaming in a data centerUsers want on demand video streaming, because they donot want to store the data themselves, and want a widechoice of different videos on demand. Netflix, an on de-mand video streaming service that makes watching HDmovies possible. Netflix uses a content distribution net-work (CDN) to distribute the movies. Netflix uses ama-zon its AWS, simpleDB and S3, Cassandra is used for filestorage [2]. Netflix makes use of MPEG-DASH, a protocolthat makes streaming over HTTP possible. To make VODpossible Netflix does things in the cloud [2]:

1. Content ingestion, this means that Netflix receivesthe studio master version of the movies and uploadsthese to the cloud.

2. Content processing, this is when in the cloud manydifferent formats are created for each movie.

3. Uploading different versions to the CDN. All thevideo versions that have been made are distributedover the CDN.

3.5.1 Video stream CDNA CDN uses small data centers, because users want theirdata as nearby as possible In this way the latency is de-creased and there is a shorter connection distance, thisgives the user faster load times. Netflix has its own CDNcreated called Open Connect [28, 27]. Reasons for havingan own CDN is that the load balancing can be improved.Netflix uses high performance HTTP delivery to get thecontent to the users. Data going over the network can bedecreased and videos can get faster to users with an ownCDN, because video stream algorithms are better analyzed[28].

4. RELATED WORKFor Video streaming there are several projects. Theseprojects are often done by service providers.Netflix works together with NGINX on Netflix his projectOpen Connect [28]. With this cooperation they want togive users the best video watching experience [28]. Thisproject wants to improve the load balancing for videostreaming over the whole network [28].Another service is WOWZA [24]. WOWZA provides videostreaming for companies and universities. WOWZA doesseveral projects for video streaming and they have builtwith the University of Maine a content management sys-tem for their online videos [24].One mayor video stream service is Youtube [39]. Youtubeis started as a project with the aim to remove the techni-cal barriers to share videos online [39]. Nowadays Youtubeis still working hard on optimizing their video streamingservice [39]. Youtube has an online API, so developers canjoin in and start their own projects. Youtube has its ownprojects, for example helping mobile gamers stream theirvideo and helping with live streaming.

There have been several cloud projects with the RaspberryPi.One was the supercomputer built by Southampton [9].Here a cluster was built with 64 raspberry Pi’s. A Mes-sage Passing interface was used to communicate betweenthe Raspberry Pi’s. The research was done in order to seewhat the performance of a low-power high performancecluster was.The project of the university of Glasgow [37]. This clouddata center has 56 Raspberry Pi’s, built for research andeducation purposes. Hadoop was tested on their servers.Another project called the Beowulf cluster built for col-laboratively processing sensor data [19]. This project wascreated for a PhD assignment. A Beowulf cluster is sim-ply a collection of identical, commodity computer hard-ware based systems [19]. The big advantage of the Rasp-berry Pi in this project was that it was cheap and doesnot need a cluster administrator to check everything thatwas changed on the cluster.

3

Page 4: Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

5. SYSTEM DESCRIPTION

Figure 3: Raspberry Pi 2 model B [14]

Table 1: Specifications [14]

Ethernet 100 MbpsUSB 4 x USB 2.0

Video out HDMI 1.4Audio 2 x analogCPU 900MHz quad-core ARM Cortex-A7

card slot Micro SD

The RPi2 only consumes 3 Watt, therefore it does notneed active cooling. The RPi2 has a limited ethernetinterface of 100 Mbps. The network cable offers room foranalyzing the video stream. The USB 2.0 is used to sharedata from a external harddisk to a user at a maximumspeed of 480 Mbit/Sec [33]. A external Seagate harddiskdemands 10 Watt when actively streaming videos, whenit is standby it has a consumption of 0.1 Watt.This research uses three RPi2s one router and a switch.All these Pi’s need power, therefore there is a powersupply and three micro USB cables. There are three sdcards needed for the Operating System, and othersoftware, to preform the tests. A cost structure for thiscan be found in the appendix section Cost structure.For some benchmark tests a laptop is plugged in, so thatseveral tests can be done from the laptop.

6. SETUP & EXPERIMENT6.1 Experiment approachThis setup is built by following the information in theGitHub link in appendix section B. More details aboutthe setup can be found in section 6.3.RPi2s are used for video streaming with load balancing.For the experiment we need a RPi 2 that can make use ofthe Internet, because a RPi2 is used as a webserver tomake video streaming possible. A cluster with one RPi2as a load balancer and the other two as a video stream Piis built. Tests on the cluster are performed andimprovements can be made. The test are found insection 6.4. Below the setup design and legend for theRPi2 are given:

1. The client who wants the video.2. The router, redirecting the client to the load

balancer. The router will also connect videostreamers to the network. A switch is placedbetween the router en the streamer to make moreconnections possible.

3. The load balancer, that redirects the client to theright video streamer.

4. The video streamer, for streaming the video to theclient.

5. The video streamer, that streams the video to theclient.

For the research number three to five are RPi2s.

Figure 4: Raspberry Setup

6.2 RPi2 inside a data centerIn this section the possibilities of the RPi2 in a datacenter are investigated.PCextreme has placed 500 Raspberry Pi’s inside a singledata rack [30]. For this special designed boards areneeded, so Raspberry Pi’s can be rebooted and turned offfrom a distance [30]. In this research the 3 RPi2s easilyfit inside a server rack. The cooling of the data rack issufficient for all these RPi2s. By having a microserverlike a RPi2 in a data center the hardware can be ownedby only the customer, because its better payable than anormal server. Data centers have the advantage of highspeed Internet. By owning the hardware the customerhas more control over the data in aspects of privacy andreliability.The power consumption of the RPi2 is low as seen intable 2. The RPi2 is easy to replace and it can easily beturned on and off, this makes it suitable inside a serverrack. A problem that will exist with the RPi2 inside thedata center is that every time a RPi2 has troubles a helpteam has to fix this for the customer.

In this project a cluster of RPi2s is built to test itspossibilities. The setup for this project is displayedbelow:

Figure 5: Project Setup

The numbers in front in figure 5 point to the RPi2s,these numbers correspond with the numbers in figure 4.Number two in the back shows the router that is behindthe power supply. In this picture there is an extra switchto connect all the RPi2s.

4

Page 5: Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

This setup can be placed inside of a data center. Theswitch and the router will then be removed and the restis placed in the server rack.

To verify that a RPi2 can operate inside a data centersome tests are done. The Elro M990 multimeter is usedfor performing these tests. The program sysbench runsseveral CPU tests for the RPi2 its four cores [21]. This isa benchmark test to get a quick impression about theperformance of the system [21]. The ampere and volt ismeasured with the multimeter during the test. Givingthe following results:

Table 2: CPU test

Test Ampere (A) Volt (V) Watt (W)CPU 1 core 0.340 4.84 1.65CPU 2 cores 0.365 4.79 1.75CPU 3 cores 0.392 4.77 1.87CPU 4 cores 0.415 4.78 1.99Memory test 0.440 4.79 2.11Storage read 0.442 4.77 2.11Storage write 0.395 4.77 1.89

Idle 0.315 4.78 1.51

A normal server needs about 500 W [25]. The RPi2 has aconsumption in this test of about 2.1 W as shown intable 2. This test shows with a calculation that500/2.1=238 Pi’s are possible instead of a single server.The idle temperature is only 1.5 W, while normal seversstill need 60 % of the power [25]. By using these smallmodular systems the power consumption inside a datacenter can be improved. The space usage is not optimal,because the RPi2 has a micro USB cable in one cornerand an ethernet cable in the other as seen in figure 3.Improvements can be made by letting the power go overthe Internet cable by using a Power over Ethernetequipment. Another solution can be by making amotherboard on which Raspberry Pi modules can beplugged instead of a whole device, this is future work.The temperature test is performed on the CPU byrunning the same CPU tests and measuring thetemperature by using a self written script. The roomtemperature during this test was around 23 degreesCelsius.

Figure 6: Temperature test

When running a four thread CPU test the maximumtemperature is around 60 degrees Celsius, at idle thetemperature is 42 degrees Celsius, this is displayed infigure 6. Data centers require a temperature of around 26degree Celsius, so if a lot of RPi2s are together somecooling is needed [15]. A server is still consuming 60 % ofits power if idle, thereby producing a lot of heat, while

RPi2s are more scalable and producing less heat.

6.3 RPi2 setupIn this setup we are going a kind of video stream serviceis built.Dietpi is the operating system, this is a diet version ofRaspbian, the normal Raspberry Pi operating service[20]. Raspbian is a diet version of Linux [14]. This meansthat Dietpi only has the most necessary software tooperate. By using Dietpi the memory usage for theoperating system stays low. This low memory usage isimportant, because the creation of different videoformats requires a lot of process and memory power.NGINX [29]: For the load balancing and streaming overHTTP NGINX is used. NGINX has an efficientalgorithm for HTTP load balancing. A RTMP modulefrom Arut for NGINX is used to create a mediastreaming server over HTTP [4]. This is an efficientalgorithm to transfer the HTTP with RTMPencapsulated data to the users. NGINX is optimized forARM, the processor the RPi2 is using [29]. Anotherreason to choose for NGINX and not for the Apachewebserver is that it uses less memory [32]. NGINX has amore efficient model than Apache, therefore it can handlemore HTTP requests [32]. Besides, for NGINX andApache the most documentation available on how to dovideo streaming [32].FFmpeg is a cross-platform solution to record, convertand stream audio and video files [13]. Using this softwaremakes adaptive streaming and streaming in differentformats possible [13].JW Player [31]: JW Player is a HTML5/flashembedded media player. It is an open source mediaplayer. JW player makes it possible to stream the videoinside the web page [31]. It supports dynamic streaming,that consists of multiple single streams with the samecontent, all in a different quality from different streams[31]. The Player uses server modules to stream the videoto the client using the formats HTTP FLV or H264 [31].Cassandra is a database that helps replicating dataacross multiple data centers [8]. In the case of thisproject there are videos stored by using Cassandra. Thedata can automatically be replicated across the nodes forfault-tolerance [8]. Therefore, the data is still availablewhen a node crashes.

6.4 Raspberry Pi 2 testingIn this testing section several test are done. In appendixB are the results and software configuration. Thefollowing test were executed:

1. CPU test2. Iperf test3. RTMP stream test4. Video on demand test5. SMIL test6. File location test

6.4.1 CPU testThe RPi2s are stress tested to make sure that they areoperating correctly. For this the program stress for Linuxis used to monitor its health [34]. Stress is a workloadgenerator to test if the CPU, memory and I/O areworking correctly [34]. All three RPi2s are tested usingthis program and are working correctly.Another test is done with FFmpeg, this software needs alot of CPU power to create new videos in differentformats. To measure the CPU usage the top command ofLinux is used, this measures the processor activity in real

5

Page 6: Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

time [22]. In this test a 230 MB 720p MPEG-4 (MP4 )video has been converted into three different lowerquality videos, this required two cores of the CPU power.The output is a 120p, 240p and 480p video file. Two outof four cores are used to produce the video, this results inthe fact that the RPi2 can only process two videos intodifferent formats at the same time. The RPi2 has limitedstorage available, so they cannot store all the differentvideo formats. This results in that the RPi2 needs toproduce these videos quickly to different formats, whatcan lead to difficulties.If the videos are streamed by using NGINX not muchprocessor power is used. The CPU power that is neededfor a single stream is about 2 % and this barely increaseswhen more clients are listening to it. To test the streamit is watched in a web browser and the CPU is measuredusing the Linux top command [22].

6.4.2 Iperf testThe Internet speed is an important aspect in videostreaming. According to Netflix there is 5.0 Megabits persecond needed to stream one HD movie [27]. During theiperf test the RPi2 has with a maximum connection of94.2 Mbps [17]. This would result in the possibility for aRPi2 to stream about 18 HD videos at the same time. Asimultaneous request of data by multiple streams reducesthe bandwidth. So if many people do at the same time avideo request this can influence the connection of theRPi2.

6.4.3 RTMP stream testIn this test a RTMP steam is tested. The test is donewith Apache JMeter to see how many streams a RPi2can handle [35]. First a test is created in Apache JMeteron the laptop, then a RTMP video stream is started anda stream is checked in a web page in a web browser. Thereason to check it inside a web browser is becauseApache JMeter can only measure HTTP captures. Theresult of this test is that it can handle 25 users forstreaming MPEG-4 (MP4 ) files over HTTP. If there aremore users the video might freeze, because there is toomuch latency. This becomes worse the more users thereare, this is a linear decrease. The RTMP stream used inthis test streams the video only in 720p format.Another test is by opening a media player like VLC werethe RTMP stream address from the RPi2 is opened. Ifthe RTMP stream with the 230 MB video of 49 minutesis opened the video freezes, this is due to bufferingproblems. The cause of this is that the buffer length istoo long.The RTMP stream is streaming about 800 kbit/s for asmall 230 MB movie. Theoretically this would mean thatby using the formula max users=bandwidth/bit ratestream 118 users can watch videos on one RPI2. Asshown in the test before it might already freeze at 25users. This latency is introduced by the client which hasnot enough buffer time. Another problem is a converterthat is used to convert a video to the RTMP stream, theuse of a converter causes latency. If a different stream iscreated with for example an audio file of 9 minutes thereis no freezing with the VLC player.To test it in the browser a JW player is embedded insidethe web page. This browser stream can be maxed withthe 118 users that are theoretically possible with the 800kbit/s stream of the small movie. This is because thelatency is not that high duo to the smaller screen usedand the lower buffer length.

6.4.4 Video on demand testFor the video on demand (VOD) test a RTMP streamwith FFmpeg is created and NGINX is started to sharethe video. VLC is opened on the laptop to investigatedifferences between VOD and a normal RTMP stream.The difference between VOD and RTMP is huge. Withthe use of video on demand the freezing was not visible.VOD is better equipped to load the stream then onlyRTMP. With only RTMP it is only possible to watchwhat is at that moment being played like normaltelevision. RTMP does not adjust the bit streamdepending on the quality needed, which is somethingVOD does.

6.4.5 SMIL testBy using the SMIL protocol different video qualities canbe selected for the same video, for example 120p or 480pversion of a movie. Youtube for example let here userscan select their own quality. With SMIL there is thepossibility to switch the quality depending on theamount of data that can get over the network. Duringthe test with Apache JMeter 100 connections weresimulated watching the video. There are two scenariosone were the user can choose the quality by himself andone were it is done automatically. For the first scenariothe user could choose between the 120p, 240p or 480pversion of the 230 MB movie earlier used. The test isdone by simulating only 120p, 240p, 480p or 720p versionof the movie. When the 480p version is simulated thereis freezing, with the other 120p or 240p version this wasa lot less visible. This results in the fact that when usersselect their own quality it is possible that some freezingcan occur. When the quality was selected automaticallydepending on the amount of data that an user canreceive then there occurred no freezing. In apacheJMeter it was also possible to see some latency whentesting the streams. To make this test possible videos ofdifferent qualities were created. These video versionswere created by FFmpeg and were the 720p, 480p, 240pand 120p version of the 230 MB video.

6.4.6 File location testFor file location and video database a Cassandradatabase is made. This database is also used by Netflixto locate the movies. Cassandra could be started after alot of configuration for the Raspberry Pi was done. Tosee if Cassandra is running the Cassandra querylanguage shell is opened on each RPi2, by using the cqlshcommand, which is the command to start the cluster andits terminal [8]. The output of the cqlsh commandshowed that it is connected to the cluster and it gives theIP address of the RPi2.NGINX has a load balancing algorithm over HTTP. Inthis test it was possible to redirect the user to the rightvideo by using this algorithm.

7. DISCUSSIONA small data center is built by using RPi2s. Small datacenters are used to avoid bottlenecks. Using microserversin data centers improves the scalability. Microserverssuch as the RPi2 can be used in these data centers.Small data centers with video streaming are used to getan elastic network, that can scale data bandwidth neededfor video streaming. It is used to make faster adaptationof the video quality possible. By using it the user getsthe best video quality without freezing.

We made a video streaming cluster with RPi2s. TheRPi2 cloud has a low power consumption, but is not

6

Page 7: Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

good for video streaming due to its limited bandwidthand CPU performance. In the research it was possible toanalyze what happens with the video streams in thecluster and to test it with a computer. This makes itpossible to see what happens at the begin part of thenetwork, so video stream algorithms can be improved.

The RPi2 is placed inside a data center. The RPi2 is asmaller compared to an existing streaming server,therefore can be placed several of them inside a datacenter instead of a server. The RPi2 can save energy,because they can be turned on and off more scalable andthey do not consume so much energy as a normal server.We found that the RPi2 does not consume a lot ofpower, while using its four CPU cores it only used 2Watt. In temperature tests the Raspberry Pi had amaximum temperature of around 60 degrees Celsius. Theservers currently consume more power and are thereforecreating more heat. In the future the Raspberry Piwould be a candidate inside a data center, because itsbetter scalable and uses less power then a server.

The setup of the RPi2 cloud consists of an operatingsystem, a fault-tolerant database, a webserver, a videoconverter and a video player. The RPi2 can use loadbalancing with a webserver and media player. To streama video to the user a RTMP message is encapsulated inHTTP for the web browser. The RPi2 makes videos ofdifferent qualities with a video converter. In tests thevideo converter could only convert two videos at thesame time. A stream is made by using a video converterand webserver. For the file location it is possible to setup a scalable fault tolerant database, so it is possible tolocate the files even if one node fails. The videostreaming with Video on Demand or adaptive streaminghas a good performance using this setup.

Video streaming affected by various load balancingtechniques. In the research several load balancingtechniques are used. The webserver offers load balancingover adaptive streaming used for VOD. To redirect theuser to the video HTTP load balancing is performedwith a webserver. In this research RTMP streaming andVOD have differences in the availability. By using VODthe streaming is better and the user experiences lessfreezing. SMIL can cause freezing when the user choosesthe quality by himself, because its bitrate might not besufficient for the quality demanded, causing freezing.When the computer does the change in quality there isless freezing. By using these different load balancingtechniques the performance and the user experiencechanges. Improvements on those load balancingtechniques were not possible due to time constraints, butthese improvements can be possible in future research.

8. CONCLUSIONVideo streaming services have an increasing number ofusers, which causes an increase in the amount of networktraffic and thus also in the amount of streamingproblems. Small data centers decrease streamingproblems, because of their elastic nature, which allowsthem to handle fluctuating video steaming bandwidth.We used RPi2s in small data centers to efficiently analyzevideo steaming. RPi2s are smaller and therefore morescalable compared to current steaming servers. RPi2salso have a lower temperature, because their electricityconsumption is significantly lower. Nevertheless, RPi2shave a limited data bandwidth, which influences thecapability of steaming and therefore affects userexperiences. Streaming servers operate only up to 20 %

of their total uptime, while still using 60 % of theirelectricity needs. The limited data bandwidth makes theRPi2 not useful inside a data center. The setup that wasrequired for video streaming in a small data center is anoperating system, a fault-tolerant database, a webserver,a video converter and a video player. The analysisshowed that availability and user experience is effectedby different load balancing techniques. By using VOD,the user experiences less freezing compared to RTMPand SMIL, because VOD can better adjust the bitrateneeded for video streaming. To conclude, RPi2s in smalldata centers have limited data bandwidth, howeverRPi2s are better scalable and more cost and powerefficient for performing analysis on video streaming.

9. FUTURE WORKThere are future possibilities for the RPI 2. A gigabitconnection over USB 2.0 can be made, this doubles theconnection speed, so twice the amount of videos can bestreamed. This will make better video streaming possibleand more users can be reached over HTTP. Workingtogether with streaming services such as NGINX help tofurther develop video streaming services hosted by ARMprocessors. The more scalable microserves will be used ifthey are more optimized for video streaming, because oftheir power efficiency and cheap prize. Netflix iscurrently looking for a specialist in Peer-to-Peerdistribution for their videos [27]. Peer-to-Peerdistribution can be interesting with Raspberry Pi.Besides this it might be interesting to investigatePeer-to-Peer distribution in general and for videostreaming in specific, there can be done research into thetechnology and legal aspect of Peer-to-Peer distribution.Apache JMeter is the tool to test HTTP streaming, butit would be more ideal to test only the RTMP stream forthe RTMP test, this was impossible with this testingtool. It is useful to test only the RTMP stream nexttime. It might be that a Raspberry Pi 2 can fit moreeasily inside a data center by using Power over Ethernetor by making a special motherboard and Raspberry Pi 2modules instead of a whole RPi2.

10. ACKNOWLEDGMENTSThis paper would not have been possible without thehelp of Nick Shot and MSc Bjorn Postema. A specialthanks to Bjorn Postema from the Design and Analysisof Communication Systems group of the University ofTwente, for his insight, good ideas and providing thenecessary materials for doing this research.

References[1] P. Abrahamsson, S. Helmer, N. Phaphoom,

L. Nicolodi, N. Preda, L. Miori, M. Angriman,J. Rikkila, X. Wang, K. Hamily, et al. Affordableand energy-efficient cloud computing clusters: Thebolzano raspberry pi cloud cluster experiment. InCloud Computing Technology and Science(CloudCom), 2013 IEEE 5th InternationalConference on, volume 2, pages 170–175. IEEE,2013. doi: 10.1109/CloudCom.2013.121. URL10.1109/CloudCom.2013.121.

[2] V. Adhikari, Y. Guo, F. Hao, M. Varvello, V. Hilt,M. Steiner, and Z.-L. Zhang. Unreeling netflix:Understanding and improving multi-cdn moviedelivery. In INFOCOM, 2012 Proceedings IEEE,pages 1620–1628, March 2012. doi:10.1109/INFCOM.2012.6195531.

7

Page 8: Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

[3] Adobe. Real-time messaging protocol (rtmp)specification.http://www.adobe.com/devnet/rtmp.html, 2015.Last accessed May 9, 2015.

[4] R. Arutyunyan. Nginx-based media streamingserver.https://github.com/arut/nginx-rtmp-module,2015. Last accessed May 29, 2015.

[5] A. Beloglazov and R. Buyya. Energy efficientallocation of virtual machines in cloud data centers.In Cluster, Cloud and Grid Computing (CCGrid),2010 10th IEEE/ACM International Conference on,pages 577–578. IEEE, 2010. doi:10.1109/CCGRID.2010.45.

[6] A. Beloglazov, J. Abawajy, and R. Buyya.Energy-aware resource allocation heuristics forefficient management of data centers for cloudcomputing. Future generation computer systems, 28(5):755–768, 2012. doi:doi:10.1016/j.future.2011.04.017.

[7] S. Bernardi, S. Donatelli, and J. Merseguer. Fromuml sequence diagrams and statecharts toanalysable petri net models. In Proceedings of the3rd International Workshop on Software andPerformance, WOSP ’02, pages 35–45. ACM, 2002.ISBN 1-58113-563-7. doi: 10.1145/584369.584376.URLhttp://doi.acm.org/10.1145/584369.584376.

[8] Cassandra. Welcome to apache cassandra.http://cassandra.apache.org/, 2015. Lastaccessed May 25, 2015.

[9] S. J. Cox, J. T. Cox, R. P. Boardman, S. J.Johnston, M. Scott, and N. S. Obrien. Iridis-pi: alow-cost, compact demonstration cluster. ClusterComputing, 17(2):349–358, 2014. doi:10.1007/s10586-013-0282-7.

[10] A. Dan and D. Sitaram. Load balancing invideo-on-demand servers by allocating buffer tostreams with successively larger buffer requirementsuntil the buffer requirements of a stream can not besatisfied, Aug. 6 1996. US Patent 5,544,327.

[11] de Volkskrant. Nederland op vijfde plek met bijnamiljoen netflix-abonnees.http://www.volkskrant.nl/media/nederland-op-vijfde-plek-met-bijna-miljoen-netflix-abonnees a3851031/, 2015. Last accessed May 29,2015.

[12] M. D. Dikaiakos, D. Katsaros, P. Mehra, G. Pallis,and A. Vakali. Cloud computing: Distributedinternet computing for it and scientific research.Internet Computing, IEEE, 13(5):10–13, 2009. doi:10.1109/MIC.2009.103.

[13] FFmpeg. Ffmpeg. https://www.ffmpeg.org/, 2015.Last accessed May 9, 2015.

[14] R. P. FOUNDATION. Raspberry pi 2 model b.https://www.raspberrypi.org/products/

raspberry-pi-2-model-b/, 2015. Last accessedMay 29, 2015.

[15] Google. Google datacenters.http://www.google.com/about/datacenters/

efficiency/internal/#temperature, 2015. Lastaccessed June 5, 2015.

[16] A. R. Hevner. A three cycle view of design scienceresearch. Scandinavian journal of informationsystems, 19(2):4, 2007. doi: 10.1.1.218.5386.

[17] Iperf. Iperf. https://iperf.fr/, 2015. Lastaccessed May 29, 2015.

[18] K. W. R. James F. Kurose. Computer Networking A

Top-Down Approach. Pearson, sixth edition edition,2012. ISBN 978-0-13-285620-1.

[19] J. Kiepert. Creating a raspberry pi-based beowulfcluster. http://coen.boisestate.edu/ece/files/2013/05/Creating.a.Raspberry.Pi-Based.

Beowulf.Cluster_v2.pdf, May 2013. Last accessedMay 29, 2015.

[20] D. Knight. Dietpi for raspberry pi’s. http://fuzon.co.uk/phpbb/viewtopic.php?f=8&t=6,2014. Last accessed May 29, 2015.

[21] A. Kopytov. sysbench. http://manpages.ubuntu.com/manpages/utopic/man1/sysbench.1.html,2015. Last accessed June 9, 2015.

[22] W. LeFebvre. Unix top.http://www.unixtop.org/about.shtml, 2015. Lastaccessed May 29, 2015.

[23] K. McCarthy. This isn’t net neutrality. this is netgoogle. this is net netflix the fcc’s new masters.http://www.theregister.co.uk/2015/03/13/net_

neutrality_rules/, 2012. Last accessed March 16,2015.

[24] W. media systems. The world’s leading streamingtechnology. http://www.wowza.com/, 2015. Lastaccessed May 29, 2015.

[25] D. Meisner, B. T. Gold, and T. F. Wenisch.Powernap: eliminating server idle power. ACMSIGARCH Computer Architecture News, 37(1):205–216, 2009. doi: 10.1145/1508244.1508269.

[26] A. P. Miettinen and J. K. Nurminen. Energyefficiency of mobile clients in cloud computing. InProceedings of the 2Nd USENIX Conference on HotTopics in Cloud Computing, HotCloud’10, pages4–4, Berkeley, CA, USA, 2010. USENIXAssociation. URL http:

//dl.acm.org/citation.cfm?id=1863103.1863107.[27] Netflix. Netflix. https://www.netflix.com/, 2015.

Last accessed May 29, 2015.[28] Netflix. Netflix open connect.

https://openconnect.netflix.com/, 2015. Lastaccessed June 9, 2015.

[29] Nginx. Nginx. http://nginx.com/, 2015. Lastaccessed May 29, 2015.

[30] PCextreme. Raspberry pi colocatie.http://raspberrycolocatie.nl/, October 2013.Last accessed May 29, 2015.

[31] J. Player. Jw player. http://www.jwplayer.com/,2015. Last accessed May 29, 2015.

[32] R. W. Server. Comparing the performance of nginxand apache web servers.http://raspberrywebserver.com/raspberrypicluster/comparing-the-performance-of-nginx-and-apache-web-servers.html, 2014. Last accessed June 5,2015.

[33] R.-Y. Shieh, G. Tsai, Y.-A. Chen, and C.-L. Chang.Externally connection type usb2. 0 interface flashcard reader.https://www.google.com/patents/US20020185533,2001. US Patent App. 09/874,303.

[34] E. Software. Stresslinux.http://www.stresslinux.org/sl/, 2015. Lastaccessed May 29, 2015.

[35] A. software foundation. Apache jmeter.http://jmeter.apache.org/, 2053. Last accessedMay 29, 2015.

[36] techrepublic. 10 things you should know aboutmicroservers.http://www.techrepublic.com/blog/10-things/

10-things-you-should-know-about-microservers/,

8

Page 9: Small Data Center using Raspberry Pi 2 for Video Streaming · to the increasing number of video steaming service con-sumers. Raspberry Pi 2’s (RPi2s) may make video stream-ing analysis

2013. Last accessed May 9, 2015.[37] F. P. Tso, D. R. White, S. Jouet, J. Singer, and

D. P. Pezaros. The glasgow raspberry pi cloud: Ascale model for cloud computing infrastructures. InDistributed Computing Systems Workshops(ICDCSW), 2013 IEEE 33rd InternationalConference on, pages 108–112. IEEE, 2013. doi:10.1109/ICDCSW.2013.25. URL10.1109/ICDCSW.2013.25.

[38] W3C. Synchronized multimedia integrationlanguage. http://www.w3.org/TR/SMIL/, 2015. Lastaccessed May 15, 2015.

[39] Youtube. Youtube. https://www.youtube.com/,2015. Last accessed May 29, 2015.

APPENDIXA. COST STRUCTURE

Figure 7: Cost structure

B. SOFTWARE CONFIGURATION ANDTESTING

B.1 Raspberry Pi 2B.1.1 GitHubMore information is found in the GitHub repository.Comments or questions about the code can be asked inthe repository.The link for the GitHub repository is:https:

//github.com/PaulVelthuis93/bachelorreferaat

9