<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Living on the Edge: Serverless Computing and the Cost of Failure Resiliency</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>07/01/2019</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10118173</idno>
					<idno type="doi"></idno>
					<title level='j'>IEEE Workshop on Local and Metropolitan Area Networks</title>
<idno>1944-0367</idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Sameer Kulkarni</author><author>Guyue Liu</author><author>K. K. Ramarkishnan</author><author>Timothy Wood</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Serverless computing platforms have gained popularity because they allow easy deployment of services in a highly scalable and cost-effective manner. By enabling just-in-time startup of container-based services, these platforms can achieve good multiplexing and automatically respond to traffic growth, making them particularly desirable for edge cloud data centers where resources are scarce. Edge cloud data centers are also gaining attention because of their promise to provide responsive, low-latency shared computing and storage resources. Bringing serverless capabilities to edge cloud data centers must continue to achieve the goals of low latency and reliability.The reliability guarantees provided by serverless computing however are weak, with node failures causing requests to be dropped or executed multiple times. Thus serverless computing only provides a best effort infrastructure, leaving application developers responsible for implementing stronger reliability guarantees at a higher level. Current approaches for providing stronger semantics such as ``exactly once'' guarantees could be integrated into serverless platforms, but they come at high cost in terms of both latency and resource consumption. As edge cloud services move towards applications such as autonomous vehicle control that require strong guarantees for both reliability and performance, these approaches may no longer be sufficient.  In this paper we evaluate the latency, throughput, and resource costs of providing different reliability guarantees, with a focus on these emerging edge cloud platforms and applications.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>Edge computing <ref type="bibr">[1]</ref> seeks to provide more responsive service to users, with the promise of access to shared computing and storage with low latency, thus enabling and encouraging offloading processing from end-devices. It also reduces core bandwidth costs by moving cloud-resident applications closer to users. Reducing the latency costs from tens of milliseconds to one millisecond opens a new range of cloud application types related to Cyber Physical Systems (CPS) and the Internet of Things (IoT) <ref type="bibr">[1]</ref>. Applications such as autonomous vehicle control and live sensor feed analysis require both strong performance and reliability guarantees, e.g., mission critical communication IoT use cases such as factory automation and autonomous vehicles demand latency in the range of 250&#181;s-10ms and a reliability of 10 -9 packet loss rate <ref type="bibr">[2]</ref>. Cloud computing's fundamental appeal arises from the exploitation of multiplexing computing and storage by sharing resources and thus lowering costs to end-users. Serverless computing takes this multiplexing to the next level by reducing the time resources are committed to a particular user or application to just the time needed to execute an invoked function. Serverless computing thus provides a new approach to managing cloud resources by deploying applications in dynamically instantiated containers. For instance, Amazon provides AWS-Lambda <ref type="bibr">[3]</ref>, an event-driven, serverless computing platform that enables to implement and deploy application code in any of the supported languages (Python, NodeJS, Java, C#, Go, Ruby, and Powershell), and execute on-demand as docker-containers. The serverless infrastructure manages the queuing of requests and can automatically scale backend service containers to meet fluctuating demands. The elastic nature of serverless computing makes it an ideal match for edge computing data centers, where the small scale of each site places tight restrictions on the number of servers that can be deployed there. Unlike mega-data-centers, the limited capacity of an edge data center requires efficient use of resources with applications only consuming the resources they need. This minimizes waste and fragmentation compared to the traditional approach of deploying fixed size virtual machines with dedicated resources for time periods of hours or days.</p><p>Unfortunately, the combination of serverless and edge computing is not as perfect a fit as it initially appears. It is well known that serverless computing can incur high overhead if requests reach a "cold" service, causing delays on the order of hundreds of milliseconds to instantiate a new container. In this paper we focus on a second, less explored challenge: the difficulty of providing reliable processing with a serverlessbased infrastructure. Just as people have come to depend on network-based services and cloud computing facilities to be as reliable as their own dedicated computing systems, serverless computing needs to evolve and mature to achieve the same reliability expectations. We believe that the limited reliability semantics of today's serverless platforms (e.g., AWS Lambda and Microsoft Azure functions support only at-least once semantics) poses high risk for emerging CPS and IoT applications, leaving them truly "living on the edge" in terms of the risk of failure and its consequences.</p><p>A number of the edge computing applications mentioned above depend on high throughput and low latency processing of streaming applications. While 'traditional' stream processing frameworks are designed for applications with dedicated resources (at least for significant time periods), their functionality is likely to be needed in the serverless context. Moreover, they typically reside on large-scale data centers that are built and managed for being resilient to failures with redundant resources, we see them having to also evolve to be supported on edge data centers. Furthermore, the edge computing applications such as for IoT and CPS as well as even some vehicular applications may have varying reliability requirements. Some, by the nature of disseminating and processing data in an idempotent manner may require little or no reliability guarantees, and 'only' require good responsiveness.</p><p>On the other hand, there are many applications, such as vehicular safety, processing medical data etc., that require high reliability, and the environment needs to be robust to failures. Thus, it is useful to understand the costs of providing failure resiliency of these stream processing frameworks so that we can examine their utility for serverless computing in an edge computing environment, and also how this failure resiliency can be configured appropriately on an as-needed basis.</p><p>In this paper we systematically evaluate the costs associated with providing different reliability guarantees. We use Apache-Storm/Trident <ref type="bibr">[4]</ref> and Apache-Kafka <ref type="bibr">[5]</ref> stream processing frameworks to evaluate the throughput, latency, and resource cost associated with request processing ranging from best effort service to exactly once guarantees.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. BACKGROUND</head><p>We look at a canonical serverless architecture and examine its applicability for an Edge Cloud computing platform supporting stream based applications like IoT, data analytics, and (responsive) web applications.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Serverless Computing</head><p>Serverless computing is a system architecture paradigm that incorporates the "Backend as a Service" (BaaS) i.e., services like storage (object store and/or key-value databases), messaging (push event notifications), user management (authentication, authorization) etc. , and "Functions as a Service (FaaS) i.e., provide the capability to deploy and run user-custom code in ephemeral containers on a compute platform. Figure <ref type="figure">1</ref> describes the typical architecture of Serverless, where the user requests (Rest API) can be processed by any of the executors (function containers). Thus serverless computing removes the need for a traditional always-on server components. Serverless architectures seek to significantly reduce the operational cost and complexity, and greatly improve service scalability and availability <ref type="bibr">[6]</ref>. However, supporting lowlatency stateful services and providing reliable services with guaranteed stream processing semantics are key challenges affecting the applicability of serverless computing paradigm to many sensitive web applications.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Stream Processing</head><p>Stream processing, also referred to as event processing, refers to continuous processing of unbounded series of data or events <ref type="bibr">[7]</ref>. Stream processing can be described using the directed acyclic graph (DAG), where the edges represent the flow of data/events and the vertices represent the operations/functions that are application-specific logic to process data.</p><p>Stream processing allows applications to readily exploit a limited form of parallel processing in-terms of both task parallelism (e.g., Storm) and data parallelism (e.g., Kafka, Spark) <ref type="bibr">[8]</ref>. Note that stream processing includes the eventstream processing and reactive programming models that enable processing of functions and generation of new events in reaction to processed data/events, elements which are commonly employed in Serverless computing as well.</p><p>Stream processing engines execute the processing graph of streams, and allow injection of events into the processing graph. Users write code to create stream processing operations and chain them together into a processing graph, which can then be run exploiting parallelism in a cluster of computing devices. Stream processing engines tend to be natively parallel and distributed and may span multiple data centers <ref type="bibr">[9]</ref>. Thus, stream processing platforms can form the basis of serverless computing. In addition, Stream processing can be either stateless or stateful. In the latter case, the state is usually stored in some external data-store (database), and this externalized state-store concept is extensively employed in serverless architectures to persist state across invocations. Furthermore, works <ref type="bibr">[10]</ref>, <ref type="bibr">[11]</ref> have demonstrated the feasibility of using serverless computing for big-data stream processing engines like Spark and Flint.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Stream or Event Processing Reliability Semantics</head><p>Different types of failures, e.g., of network links, machines (server nodes) and software process crashes etc., can result in loss of data and inconsistent stream processing across the data center. Stream/event processing platforms provide different reliability modes or the processing semantics for the data stream to provide failure resiliency for streaming applications. Accordingly, there are three different modes (at-most once, at-least once, and exactly once), provided by the streaming platforms as described below:</p><p>&#8226; At-most once: In this approach, sending a message/event from sender to receiver provides no guarantee that a given message will be delivered and executed upon. Any given message may be delivered once or it may not be delivered at all. In a nutshell this is a 'Best-effort' approach where a data loss is possible. &#8226; At-least once: This approach ensures that sending a message/event guarantees the delivery of message at least once. However, in the event of anomalies, the message could be delivered more than once. Thus, it is a 'No-loss model' where the messages are guaranteed to be delivered at-least once, and they may be redelivered (possible duplicate that are processed again). This approach requires the sender and receiver to actively participate and coordinate on message request or delivery in the events of failure.</p><p>&#8226; Exactly once: This is a 'No-loss, no-duplicates model' where messages are guaranteed to be delivered only-once. This approach also requires the sender and receiver to actively participate and coordinate on message request or delivery in the event of a failure and additionally they need to provide the transaction semantics for state update and state roll-back for recovery.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Evaluation Platforms: Apache Kafka and Storm</head><p>We consider several aspects as the key decision factors for different streaming platforms, namely: Reliability, Latency, Scale, and Throughput. Storm <ref type="bibr">[4]</ref> is considered to be the highest performance streaming engine with low-latency, while Kakfa <ref type="bibr">[9]</ref> is the most widely deployed platform that is leveraged as either a distributed messaging platform in several streaming platforms (e.g., Spark, Storm, Flink, etc) or can be deployed entirely as a stream processing platform. Further, Kafka and Storm/Trident are two of the streaming platforms that can support and guarantee exactly-once processing semantics, while most of the other streaming platforms tend to be best-effort which can guarantee either only-once (at-most once) or at-least once processing semantics <ref type="bibr">[12]</ref>, <ref type="bibr">[13]</ref>. III. STREAMING PLATFORMS: STORM AND KAFKA Today's cloud environments support several stream processing platforms, such as Apache Spark <ref type="bibr">[14]</ref>, Samza <ref type="bibr">[13]</ref>, Flink <ref type="bibr">[15]</ref>, etc. We briefly describe the streaming platforms used in this work, Apache Storm <ref type="bibr">[4]</ref> and Apache Kafka <ref type="bibr">[5]</ref>. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Data Source</head><note type="other">Kafka Broker</note></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Apache Storm</head><p>Apache Storm <ref type="bibr">[4]</ref> is an open source distributed real-time stream processing platform. Storm provides a scalable architecture for processing unbounded data streams at scale and provides strong fault tolerance mechanisms. The key components of the Apache Storm stream processing framework are:</p><p>&#8226; Tuples: correspond to a unit of data in the data stream. It is a named list of values, where each value can be of any type and can be dynamically typed i.e., the field types do not need to be declared. &#8226; Spouts: represent the source of the data stream. Spouts can read data from different data sources such as a database, distributed file system, messaging framework like Kafka, etc. Spouts generate a stream of tuples that can be fed into a network of bolts (see below) to carry out the required data processing. Spouts can broadly be classified into two types:</p><p>1) Unreliable: They provide 'at-most once message processing' semantics, and do not have the capability to replay the tuples. Once a tuple is emitted, it can not be replayed irrespective of whether the tuple got processed successfully or not. 2) Reliable: These can provide 'at-least once or exactly once message processing' and have the capability to replay tuples in the event of any failures. &#8226; Bolts: represent the processing logic or the functions in Storm. Different operations such as filtering, aggregating, joining, etc. can be realized with Bolts. They process the tuples and can also anchor and emit a new stream of tuples.</p><p>Figure <ref type="figure">2</ref> shows an Apache Storm cluster architecture's components. It is made up of two types of processes, namely i) Nimbus and ii) Supervisor. Nimbus is a process running on a master node that is responsible for tracking the progress of data processing while the Supervisor process runs on worker nodes and is responsible for executing the data processing logic. Nimbus is responsible for scheduling, monitoring, and distributing the stream processing tasks. Zookeeper is used to manage the Storm cluster and monitor heartbeats from the workers and supervisors. Reliability modes: Storm can at-best guarantee that every event will be processed "at-least once". Trident is a highlevel abstraction built on top of Storm, and provides the primitives for performing stateful processing through the use of a database or persistence store to provide 'exactly-once' processing semantics. Another notable difference is that unlike Storm which performs tuple-by-tuple processing, Trident processes the stream of tuples in 'mini-batches'. This allows to provide the notion of transaction, by assigning a transactionID for each of the processed batch of tuples. Trident performs beginCommit() at the beginning of each batch and once all processing for the batch of tuples completes successfully, the transaction is considered to be successful and Trident will call Commit() at the end to update the state. However, in the event of any failure in processing for any of the tuples in the batch, Trident requests for the entire batch to be re-transmitted.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Apache Kafka</head><p>Kafka, as a distributed messaging system, is one of the common component included in other stream processing engines like Storm <ref type="bibr">[4]</ref>, Spark <ref type="bibr">[14]</ref>, etc. for scalability purposes. Figure <ref type="figure">3</ref> shows the usage of Kafka as a distributed messaging broker in the Storm streaming platform. This enables the persistence of messages in the Kafka partitioned topics (can be across multiple nodes in the case of cluster) and improves on the reliability of processing the messages in the event of any failures with Storm cluster. There are three key concepts in Kafka as described below:</p><p>&#8226; Record &amp; Topic: Kafka uses a cluster of servers to store streams of records, and each record has a key, a value, and a timestamp. These records are classified into topics.</p><p>&#8226; Producer: publishes the records to one or more topics. From Kafka 0.11 release on-wards, the producer can be configured to function in an idempotent and transactional mode, which strengthens the delivery semantics from providing at-least once to exactly once semantics.</p><p>&#8226; Consumer: subscribes to different topics of their interest and receive the records produced in them. Each consumer belongs to a 'consumer group' and cooperatively works with other consumers to achieve load balancing and resiliency. Reliability modes: Kafka supports both 'at-least once' and exactly-once' delivery semantics. Kafka's exactly once semantics is built on top of idempotency and transaction features. Idempotency is achieved by using a sequence number to de-duplicate the duplicate (multiple) writes, and transaction allows for atomic writes across multiple topics. These two features together offer end-to-end 'exactly-once' guarantees for Kafka Streams. Also, for the stream processing applications like Storm, Spark, that extend from Kafka can ensure exactlyonce provided the streams can rewind the offsets and rollback the corresponding external state updates.</p><p>IV. EVALUATION</p><p>We describe our evaluation testbed and demonstrate the overheads incurred for supporting different reliability semantics with two different streaming platforms Apache Storm and Apache Kafka.</p><p>A. Evaluation setup 1) Hardware: Our experimental testbed used the Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz dual-socket server with 20 cores each with hyper-threading enabled and 252GB RAM, running Ubuntu SMP Linux kernel 4.4.0-142-generic.</p><p>2) Software: We deployed the following software packages: i) Apache-Storm ver. 1.2.2, ii) Zookeeper ver. 3.4.13 and iii) Apache Kafka ver. 2.1.0.</p><p>3) Workload: Due to the lack of standard benchmarks for real-world streaming platforms, we make use of the available benchmark tools deployed in earlier works <ref type="bibr">[8]</ref>, <ref type="bibr">[12]</ref> and extend them to fit our evaluation needs. We evaluated for both reliable and unreliable stream processing for the three different reliability semantics discussed in Section II-C. The evaluation platform configurations for the three reliability variants for message processing are shown in Table <ref type="table">I</ref>  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Analysis with Trident/Storm</head><p>For Apache Storm and Trident experiments, we extend Intel's Storm-benchmark package <ref type="bibr">[16]</ref> and implemented variants of WordCount topology, which provides a good measure of the overhead introduced by Storm as the Spouts and Bolts in this topology do minimal work <ref type="bibr">[12]</ref>. This WordCount topology demonstrates a very simple streaming example consisting of spouts and two bolts. Spouts read sentences from a given source file (input stream of data) and emit them to the 'Split' bolts. The split bolts in turn split these sentences into words and send to the 'Count' bolt where the count of words is updated. We configure the Storm, Trident stream and topology parameters as shown in the Table <ref type="table">II</ref>. Also, we configure the Kafka stream producers to use the same number (4) of producer spouts. In order to keep the replication overhead minimal, we set the Kafka message replication factor to 1.  Impact on Throughput and Latency: Figure <ref type="figure">4</ref> compares the throughput (i.e., the number of messages processed per second) for different reliability modes (note the log scale for the Y-axis). We observe that the at-most once processing mode provides &#8764;850K messages per second (mps), while the throughput drops by 4X with at-least once semantics resulting in &#8764;150-200Kmps. Further, exactly-once semantics drastically degrades the throughput even more, providing atbest &#8764;85Kmps and intermittently not processing any messages for brief periods. The corresponding impact on latency is shown in Figure <ref type="figure">5</ref>. We observe an average processing latency of 5ms for both at-most and at-least once semantics, while there is an order of magnitude increase in latency &#8764;8X-20X for the exactly-once (transactional) mode <ref type="foot">1</ref>Impact on Resource utilization: We also collect the CPU and disk usage statistics (averaged over a 10 seconds interval) using the 'dstat' tool <ref type="bibr">[17]</ref>. Figure <ref type="figure">6</ref> shows the CPU utilization observed across the three modes. we can observe that the CPU utilization increases by &#8764;4X for both at-least and exactly-once semantics in comparison to the at-most once mode. We also  profile the disk read and write usage statistics and observe &#8764;10X increase in the disk usage for the at-least and exactlyonce semantic experiments as shown in Figure <ref type="figure">7</ref>. We noticed most of disk usage to be due to the disk writes performed by the Kafka producer and commit state updates by Trident. Note, the CPU and disk usage per work done (throughput) is far worse (2X-20X) for exactly-once mode than the at-least once mode. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Analysis with Kafka Streams</head><p>We measure the performance of Kafka by running the Word-Count streaming application. For these experiments, we switch the producer into the non-transactional mode and transactional mode with a commit interval of 1ms, 10ms, and 100ms. As shown in Figure <ref type="figure">8</ref>, compared to the nontransactional mode, a large 100ms commit interval makes the throughput drop by 2X. But, even more importantly, a small 1ms commit interval leads to 58X degradation for 64B records and 11X degradation for 1024B records. To evaluate the latency overheads, we throttle the sending rate to 1MB/s to avoid large, unnecessary queuing latency. As shown in Figure <ref type="figure">9</ref>, a 100ms commit interval has an average 3.3ms latency, but a 1ms commit interval incurs an average 21ms latency which is 12X and 83X larger than the non-transactional mode. To summarize, these non-negligible overheads pose challenges when using the streaming platforms like Storm, Kafka for emerging edge and serverless based applications that have strict reliability, correctness and latency requirements, and requires us to re-examine existing solutions.</p><p>V. RELATED WORK Serverless and Edge Computing: Previous works have explored various problems associated with serverless computing.</p><p>Notably, with the focus on large-scale data centers, <ref type="bibr">[18]</ref>, <ref type="bibr">[19]</ref>, <ref type="bibr">[20]</ref>, <ref type="bibr">[21]</ref> have studied issues pertaining to the pricing model, programming model, autoscaling, and startup delay associated with the serverless computing. Some of the projects <ref type="bibr">[10]</ref>, <ref type="bibr">[11]</ref> have looked at how to apply the serverless model into big data stream processing engines. However, the latency and reliability issues of using the serverless computing model at the edge haven't yet drawn much attention.</p><p>Streaming Engine Analysis: Works <ref type="bibr">[8]</ref>, <ref type="bibr">[22]</ref>, <ref type="bibr">[23]</ref>, <ref type="bibr">[24]</ref> have compared different stream processing platforms. However, they focus primarily on the comparison of supported features and evaluate throughput, latency through tests over different distances to the data center. In contrast, our work focuses on the overheads and impact on throughput, latency and resource utilization for providing different reliability semantics for stream processing.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VI. CONCLUSION AND FUTURE WORK</head><p>To summarize, in this work, we have looked at Serverless Computing -an emerging paradigm replacing many of the stream/event processing based web applications. We highlighted the difficulty of current Serverless applications in achieving reliable event/data processing.</p><p>We evaluated the overheads associated with providing 'exactly-once' reliable message processing semantics with the state-of-the-art streaming platforms like Apache Storm/Trident and Apache Kafka. Because of the significant overheads, there is a large performance degradation both in terms of latency (increases almost 20X-80X), and throughput (drops by 4X-50X). In addition, the resource overheads, specifically the CPU and disk usage, are around 4X-10X increase. Hence, we reason that the direct adoption of such approaches with serverless computing at the edge may be problematic, bordering on being infeasible. These mechanisms as implemented would greatly hinder the efficient operation of edge computing resources. We believe it is necessary to revisit these mechanisms for providing reliable processing and failure resiliency approaches for edge computing.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>We only plot the first 10 minutes of the results, which indicate that the latency levels off. But, we observed that latency rises back up intermittently to 100ms when the tests were run for a longer interval (30+ minutes).</p></note>
		</body>
		</text>
</TEI>
