On the Impact and Applicability of Network Edge Computing to Reduce Network Latencies of Worldwide Client Applications
Total Page:16
File Type:pdf, Size:1020Kb
DEGREE PROJECT IN TECHNOLOGY, SECOND CYCLE, 30 CREDITS STOCKHOLM, SWEDEN 2020 On the impact and applicability of network edge computing to reduce network latencies of worldwide client applications Stephan Horsthemke KTH ROYAL INSTITUTE OF TECHNOLOGY ELECTRICAL ENGINEERING AND COMPUTER SCIENCE Authors Stephan Horsthemke <[email protected]> Information and Communication Technology KTH Royal Institute of Technology Host Company Spotify AB Regeringsgatan 19 111 53 Stockholm, Sweden Examiner Vladimir Vlassov Kistagången 16 KTH Royal Institute of Technology Supervisors Axel Liljencrantz Spotify AB Sina Sheikholeslami KTH Royal Institute of Technology ii Abstract This project evaluates the applicability of network edge computing to reduce global latencies of client applications. It determines the dimension of latency reduction network edge computing can provide compared to common cloud computing architectures. Furthermore, this project examines whether Compute@Edge, an exemplary and modern edge computing service, enables the replacement of many latency-sensitive cloud systems by an adequate versatility and a reasonable cost- benefit ratio. Compute@Edge is a new, serverless edge computing platform by Fastly built on WebAssembly. A prototype that replicates a globally utilized server of Spotify was implemented on Compute@Edge. To compare the latencies of cloud and edge computing, an experiment captured the latencies of the prototype and the original system using a Spotify client that generated almost 26 million data points from all over the world. Next to the experiment, the implementation of the prototype allows accurate insights into the possibilities of Compute@Edge and whether WebAssembly is a promising approach for edge computing. Successes of this work include data showing that network edge computing can reduce latencies significantly. It offers arguments to ramp up the usage of edge computing, WebAssembly and Compute@Edge for applications that require low latencies. The results of the experiment show that network edge computing is capable of reducing network latency compared to cloud computing by at least 38%. The lower latencies combined with the versatility and feasibility of Compute@Edge show that modern edge platforms enable a much higher utilization for applications like Spotify. Keywords Edge Computing, WebAssembly, WebAssembly System Interface, Latency, Response Time iii Sammanfattning Projektet utvärderar hur applicerbart nätverks edge computing är för att minska global latens av kundapplikationer. Den avgör att dimensionen av fördröjnings minskningen i nätverks edge computing kan ge i jämförelse till vanliga cloud computing arkitekturer. Projektet undersöker också om Compute@Edge, en exemplarisk och modernt edge computing service, möjliggör ett byte av många latens-känsliga cloud system och då med en lämplig användbarhet och ett rimlig kostnads-nyttoförhållande. Compute@Edge är en ny serverlös edge computing platform av Fastly, byggt på WebAssembly. En prototype som replikerar en globalt använd server av Spotify var implementerad på Compute@Edge. För att jämföra latenserna av cloud och edge computing, genomfördes ett experiment som fångade upp latenserna av prototypen och det ursprungliga systemet med hjälp från en Spotify kund som genererade runt 26 millioner globala datapunkter. Med experimentet, ger prototypimplementeringen exakta insikter till möjligheterna med Compute@Edge och om WebAssembly är en lovande lösning till edge computing. Arbetes framgång inkluderar data som visar att nätverks edge computing kan minska latensen betydligt. Det visar också argument för att öka på användingen av edge computing, WebAssembly och Compute@Edge till applikationer som behöver låga latens. Experimentets resultat visar att nätverks edge computing kan minska nätverkslatens i jämförelse till cloud computing med åtminstone 38%. De lägre latenserna kombinerade med användbarheten och möjligheten av Compute@Edge visar att moderna edge plattformar ger möjligheter till mycket mer bättre översättning för applikationer som Spotify. iv Acknowledgements I want to thank the numerous people who helped me along the sometimes very challenging months of writing this thesis! Thanks to Sina Sheikholeslami and Axel Liljencrantz for their patience and for sometimes rather asking “how are you” ahead of “what did you achieve”! A big thanks goes to quite some Spotify Squads who helped with parts of the project and the Fastly team! Finally, I would like to extend my gratitude to friends and family who helped me dealing with tough phases throughout these months. v Acronyms CDN Content Delivery Network IoT Internet of Things ISP Internet Service Provider VCL Varnish Configuration Language WASI WebAssembly System Interface API Application programming Interface PoP Point of Presence IaaS Infrastructure as a Service CLI Command Line Interface HTTP Hypertext Transfer Protocol NIST National Institute of Standards and Technology UX User Experience vi Glossary Apache Cassandra Apache Cassandra is an eventual consistent Database [3]. 47 ByteCodeAlliance The ByteCodeAlliance is a group of organizations(RedHat, Mozilla, Intel and Fastly among others) and projects which are dedicated to use WebAssembly and WASI for a more secure and efficient web [6]. 16, 17, 48, 50 CDN Content Delivery Networks (CDNs) strive to have their Points of Presence (PoPs) as close to users as possible to ensure low latencies [1]. Technically CDNs serve replicated content at well-connected network edges [28]. Companies offering CDNs, like Akamai and Fastly, are often also called CDNs. Technically, many provide much more services than just a CDN. Therefore, Fastly strives to be called an edge cloud platform . 15 Cloud BigTable Cloud BigTable is an eventual consistent Database offered by Google Cloud [27]. 47 cloud data center A cloud data center is a centralized data center deep in the cloud and the location is optimized for cost efficiency. 1, 4, 7, 29, 51 sandbox A safety mechanism to separate multiple applications from each other and their hosting environment. For WebAssembly specifically it means that it can only communicate out of their context by going through appropriate Application programming Interfaces (APIs) [33]. 9 vii Contents 1 Introduction 1 1.1 Research Questions ............................. 3 1.2 Thesis Contributions ............................. 4 1.3 Goals ..................................... 4 1.4 Benefits, Ethics and Sustainability ..................... 4 1.5 Outline .................................... 5 2 Theoretical Background 6 2.1 Edge Computing ............................... 6 2.1.1 Definition ............................... 7 2.1.2 Comparison to Cloud computing .................. 7 2.2 WebAssembly ................................ 8 2.2.1 Speed ................................. 9 2.2.2 Safety ................................. 9 2.2.3 Portability ............................... 9 2.3 WebAssembly System Interface (WASI) .................. 10 2.4 Serverless Computing ............................ 10 2.5 Response Time ................................ 11 2.5.1 Latency ................................ 11 2.5.2 Retention ............................... 13 2.5.3 Response time limits ........................ 14 3 Technical Background 15 3.1 Fastly ..................................... 15 3.1.1 Lucet ................................. 16 3.1.2 Compute@Edge ........................... 17 3.2 Spotify ..................................... 20 viii CONTENTS 3.2.1 Web API ............................... 20 3.2.2 Metadata ............................... 20 3.2.3 Web-player .............................. 22 3.2.4 Response time ............................ 22 4 Design and Implementation 23 4.1 Prototype ................................... 23 4.1.1 Method ................................ 23 4.1.2 Implementation ............................ 24 4.2 Experiment .................................. 31 4.2.1 Passive Execution .......................... 32 4.2.2 Fake Requests ............................ 32 4.2.3 Metrics ................................ 33 4.2.4 Feature toggling ........................... 33 4.3 Visualization ................................. 34 4.3.1 Monitoring .............................. 34 4.3.2 BigQuery ............................... 34 5 Results 36 5.1 Latency .................................... 36 5.1.1 Compute@Edge ........................... 37 5.1.2 Spotify Web API ........................... 41 5.1.3 Comparison ............................. 43 5.2 Versatility ................................... 46 5.2.1 Computation ............................. 46 5.2.2 Storage ................................ 47 5.3 Feasibility ................................... 48 5.3.1 Implementation ............................ 48 5.3.2 Maintenance ............................. 49 5.3.3 Risks ................................. 49 6 Conclusions 51 6.1 Future Work ................................. 53 6.1.1 Mobile Data ............................. 53 6.1.2 Cloudflare workers .......................... 53 6.1.3 Proxy cloud systems with C@E .................. 53 ix CONTENTS 6.1.4 Critical Point Analysis ........................ 54 References 55 x Chapter 1 Introduction Latency is a neglected trait of global cloud applications, which edge computing attempts to improve. But how big is the dimension of improvement edge computing is capable of and are modern network edge solutions powerful enough to merit using it in addition to the cloud? With tech companies striving to increase their markets globally