Arxiv:2001.10483V1 [Cs.DC] 28 Jan 2020 Ates 4 PB of Data Daily [6]
Total Page:16
File Type:pdf, Size:1020Kb
INFINICACHE: Exploiting Ephemeral Serverless Functions to Build a Cost-Effective Memory Cache∗ Ao Wang1†, Jingyuan Zhang1†, Xiaolong Ma2, Ali Anwar3, Lukas Rupprecht3, Dimitrios Skourtis3, Vasily Tarasov3, Feng Yan2, Yue Cheng1 1George Mason University 2University of Neveda, Reno 3IBM Research–Almaden Abstract objects that range in size from a few bytes to a few KBs [19]. Caching large objects (i.e., objects with sizes of MBs–GBs) Internet-scale web applications are becoming increasingly is believed to be relatively inefficient in an IMOC as large storage-intensive and rely heavily on in-memory object objects consume significant memory capacity and network caching to attain required I/O performance. We argue that bandwidth. This either causes cache churn with evictions of the emerging serverless computing paradigm provides a well- many small objects that would be reused soon if the cache is suited, cost-effective platform for object caching. We present too small, or incurs high cost for larger cache sizes. INFINICACHE, a first-of-its-kind in-memory object caching system that is completely built and deployed atop ephemeral Large object caching has been demonstrated to be effec- serverless functions. INFINICACHE exploits and orchestrates tive and beneficial in cluster computing [16, 38, 47, 58]. To serverless functions’ memory resources to enable elastic pay- verify that these benefits also apply to web applications, we per-use caching. INFINICACHE’s design combines erasure analyzed production traces from an IBM Docker registry [17] coding, intelligent billed duration control, and an efficient and identified two key properties for large objects: (1) large data backup mechanism to maximize data availability and objects are heavily reused with strong data locality and are cost effectiveness while balancing the risk of losing cached accessed less frequently than small ones, and (2) achieving a state and performance. We implement INFINICACHE on AWS fast access speed for large objects is critical for system perfor- Lambda and show that it: (1) achieves 31 – 96× tenant-side mance though it does not require as stringent a service level cost savings compared to AWS ElastiCache for a large-object- objective (SLO) as that for small objects, the latter of which only production workload, (2) can effectively provide 95:4% demands sub-millisecond latencies. These properties suggest data availability for each one hour window, and (3) enables that web applications can benefit from large object caching, comparative performance seen in a typical in-memory cache. which state-of-the-art IMOCs currently do not provide. The emerging serverless computing paradigm (cloud func- 1 Introduction tion services, or Function-as-a-Service (FaaS)) [36] intro- duces a new way of building and deploying applications, in Internet-scale web applications are becoming increasingly which the service providers take care of resource scaling and important as they offer many useful services to the end users. management. Developers can thus focus on developing the Examples range from social networks [22] that serve billions function logic without managing servers. Popular uses of of photo and video files every day to hosted container image serverless computing today are event-driven and stateless ap- repositories such as Docker Hub [5]. These web applica- plications such as web/API serving and batch ETL (extract, tions typically require a large storage capacity for the massive transform, and load) [1]. However, we find that serverless amount of data they must store. For instance, Docker Hub computing can also provide a potential cost-effective solution hosts over 2:6 million container images, and Facebook gener- for resolving the tension between small and large objects in arXiv:2001.10483v1 [cs.DC] 28 Jan 2020 ates 4 PB of data daily [6]. memory caching. Cloud object stores (e.g., Amazon S3, Google Cloud Stor- We demonstrate how to build an IMOC as a serverless ap- age, OpenStack Swift, etc.) have become the first choice for plication. A serverless application is structured as a collection serving the simple object GET/PUT requests of these storage- of cloud functions. A function has memory that can be used to intensive web applications. To improve request latencies store objects that are needed during its execution. We use this for better user experience, cloud object stores are typically memory to store cached objects. Functions are executed on being used in combination with networked, lookaside In- demand. In our serverless IMOC, the functions are invoked Memory Object Caches (IMOCs) such as Redis [10] and by the tenant to access the cached objects. FaaS providers Memcached [9]. Serving requests from an IMOC is much cache invoked functions and their state so in-memory objects faster than serving them directly from a backing object store. are retained between function invocations. This provides a However, due to the high cost of main memory, IMOCs are sufficient lifetime for cached objects. Providers only charge largely used only as a small cache for buffering small-sized tenants when a function is invoked, in our case, when a cached ∗This is the preprint version of a paper published in USENIX FAST 2020. object is accessed. Thus the memory capacity used to cache †These authors contributed equally to this work. an object is billed only when there is a request hitting that ob- 1 1.0 1.0 1.0 1.0 London 0.8 0.8 0.8 0.8 Dallas 0.6 0.6 0.6 0.6 0.4 0.4 CDF 0.4 CDF 0.4 London London London 0.2 Dallas 0.2 0.2 Dallas 0.2 Dallas Byte Fraction Object Fraction 0.0 0.0 0.0 0.0 10 4 10 2 100 102 104 10 4 10 2 100 102 104 100 101 102 103 104 100 101 102 103 Object size (MB) Object size (MB) Access Count Reuse Interval (hr) (a) Object size. (b) Object footprint. (c) Access count for obj. > 10 MB. (d) Reuse interval for obj. > 10 MB. Figure 1: Characteristics of object sizes and access patterns in the IBM Docker registry production traces. ject. Our serverless IMOC reduces the tenants’ monetary cost 2 Background and Motivation of memory capacity compared to other IMOCs that charge Large-scale web applications have increasingly complex stor- for memory capacity on an hourly basis whether the cached age workload characteristics. Many modern web applications objects are accessed or not. utilize a microservice architecture, which consists of hundreds Utilizing the memory of cloud functions for object caching to thousands of microservice modules [33]. Different modules introduces non-trivial challenges due to the limitations and exhibit different object size distributions and request patterns. constraints of serverless computing platforms: Cloud func- For example, a Docker image registry service uses Redis to tions have limited resource capacity (e.g., 1 CPU, up to sev- store small-sized container metadata (i.e., manifests), and an eral GB memory, and limited network bandwidth) with strict object store to store large-sized container images [17, 40]. network communication constraints (e.g., no inbound TCP While in-memory caching has been extensively studied in connection); providers may reclaim a function and its memory the context of large-scale web applications focusing on small at any time, creating a risk of loss of the cached data. objects, cloud cache management for large objects remains We present INFINICACHE, a cost-effective in-memory ob- poorly explored and poses further challenges. ject cache that exploits and orchestrates serverless cloud func- tions. INFINICACHE synthesizes a series of techniques into 2.1 Large Object Caching a holistic design to overcome the aforementioned challenges To obtain a better understanding of large object caching, we and to achieve high performance, cost effectiveness, scala- analyze production traces from an IBM Docker registry col- bility, and fault tolerance. INFINICACHE leverages erasure lected in 2017 from two datacenters (one in London, UK, and coding to: (1) provide fault tolerance against data loss due to the other in Dallas, US) [17]. The goal is to reveal patterns function reclamation by the service provider; (2) improve per- that enable us to make realistic assumptions for the design of formance by utilizing the aggregated network bandwidth of INFINICACHE. multiple cloud functions in parallel; and (3) use redundancy Extreme Variability in Object Size. We first analyze the to handle tail latencies caused by straggling functions. IN- object size distributions. As shown in Figure 1(a), we find that FINICACHE implements function orchestration policies that object sizes span over nine orders of magnitude, and that more improve reliability while lowering cost. Specifically, INFINI- than 20% of objects are larger than 10 MB in size. This ob- CACHE implements a lightweight data backup mechanism in servation highlights the extreme variability and heterogeneity which a cloud function periodically performs delta synchro- of real-world object store workloads, which further increases nization (delta-sync) with a clone of itself so as to minimize the complexity of cloud IMOC management. the chances that a reclaimed function causes a data loss. Tension between Small and Large Objects. Efficiently • Identify the opportunities and challenges of serverless managing both small and large objects in an IMOC is chal- function-based object caching by performing a long- lenging due to two performance-cost tradeoffs. First, with term analysis of the internal mechanisms of a popular limited cache capacity, large objects occupy a large amount of serverless computing platform (AWS Lambda [2]). memory and would cause evictions of many small objects that • Design and implement INFINICACHE, the very first in- might be reused in the near future, thus hurting performance. memory object caching system powered by ephemeral This is evidenced by Figure 1(b), where large objects (with and “stateless” cloud functions. size larger than 10 MB) occupy more than 95% of the total • Provide an analytical model of INFINICACHE’s fault storage footprint.