<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Towards Performance and Cost Simulation in Function as a Service</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Distributed Systems Group, University of Bamberg</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <fpage>43</fpage>
      <lpage>46</lpage>
      <abstract>
        <p>Function as a Service (FaaS) promises a more cost-eficient deployment and operation of cloud functions compared to related cloud technologies, like Platform as a Service (PaaS) and Container as a Service (CaaS). Scaling, cold starts, function configurations, dependent services, network latency etc. influence the two conflicting goals cost and performance. Since so many factors have impact on these two dimensions, users need a tool to simulate the function in an early development stage to solve these conflicting goals. Therefore, a simulation framework is proposed in this paper.</p>
      </abstract>
      <kwd-group>
        <kwd>Serverless Computing</kwd>
        <kwd>Function as a Service</kwd>
        <kwd>FaaS</kwd>
        <kwd>Benchmarking</kwd>
        <kwd>Load Pattern</kwd>
        <kwd>Cold Start</kwd>
        <kwd>Pricing</kwd>
        <kwd>Simulation Framework</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Function as a Service (FaaS) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is a new, event-driven computing model in
the cloud, where single functions are executed in containers on a per request
basis. It promises a faster, easier and more cost-eficient development, deployment
and operation due to the abstraction of operational tasks by the FaaS provider.
Scaling to zero as one of the game changers avoids running instances of cloud
functions unnecessarily. Also the most granular pay-per-use model in the overall
cloud stack leads to a serious cost reduction for suited use cases. Therefore, it
is not surprising that early cost studies [
        <xref ref-type="bibr" rid="ref1 ref12">1, 12</xref>
        ] compared this new paradigm
with established ones, like monolithic architectures or microservices deployed on
virtual machines and container infrastructure.
      </p>
      <p>
        The position paper is structured as follows. Sect. 2 puts the work in relation to
already conducted studies and approaches, which are important for a simulation
framework for FaaS. Based on these insights and the lack of a reproducible and
structured approach, Sect. 3 describes the main objectives of the dissertation
plan and concludes with a short discussion.
One of the first cost comparisons between monolithic, microservice and cloud
function architecture was done by Villamizar et al. [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. They state that cloud
functions saved more than 70% cost compared to the other implementations in
their use case scenario. Another case study [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] reduced cost up to 95%. But, there
are also cases, where cloud functions are more costly than traditional Virtual
Machine (VM) based solutions. An example use case is a large distributed data
processing application by Lee et al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which is ten times more expensive.
      </p>
      <p>
        The overall price is calculated by multiplying the execution time and the
price for the function configuration. Performance, i.e. execution time, of a cloud
function directly influences the price calculation. Due to this billing model,
there exist a lot of publications, which focus on performance. McGrath and
Brenner [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] implemented a performance-oriented FaaS platform on top of a
cloud provider to gain control over the infrastructure and improve the throughput
and scaling property. Lloyd et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] identified a performance variation of
1500% w.r.t. the cold and warm infrastructure components of a FaaS platform.
      </p>
      <p>
        They also assessed the throughput by concurrent access of cloud functions
on diferent FaaS platforms, especially the commercial ones, like Amazon Web
Services (AWS) Lambda, Google Cloud Functions, Azure Functions and IBM
OpenWhisk. A similar multi-provider study proposed a CPU-intensive
benchmark [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to compare the diferent FaaS oferings and support customers to select
the right platform for their needs.
      </p>
      <p>
        Pricing and performance is "dificult to decipher", as Back and
Andrikopozlos [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] stated. They also implemented a first minimal wrapper to harmonize the
diferent function handler interfaces of the major FaaS platforms. Applications
with bursty workloads are in focus of their work since these applications could
especially profit from the characteristics of FaaS.
3
      </p>
    </sec>
    <sec id="sec-2">
      <title>Simulation Framework</title>
      <p>Since the conducted research reveals a mixed picture so far, there is a need to
combine all these directions together in a structured way. By now, the related
work investigates aspects in isolation and preconditions for benchmarks and
other experiments are often not clear to readers. Besides the abstraction of
operational tasks in FaaS, cost and performance are important considerations
when deciding to build or migrate an application which includes cloud function
building blocks. To shed light on the cost and performance perspective of FaaS,
this paper proposes a simulation framework.</p>
      <p>
        This framework is of conceptual nature to assess single cloud functions. The
overall idea is to simulate a single cloud function in isolation under various
circumstances in an early development phase. Chaining or orchestration of functions is
out of scope. Influential factors, like the cold start, are investigated by conducting
benchmarks [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] on the diferent FaaS platforms. Results of these experiments
are aggregated to mean values and their deviations to cover the best, worst and
average case. These values serve as an input for the simulation framework and
enable local testing of a cloud function on a developers machine. It also shows
the variation in price and performance w.r.t. the function characteristics, e.g.
CPU-bound functions or IO-bound functions.
      </p>
      <p>Towards Performance and Cost Simulation in Function as a Service</p>
      <p>
        Therefore, the following research objectives are of particular interest. They are
preparatory work to get a solid foundation for the overall goal of the dissertation.
Load Patterns - Benchmarking applications is a problematic field as
Huppler [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] noted. Repeatability, verifiability and economical considerations are
some of his requirements for a good benchmark. Since FaaS introduces a
completely diferent scaling notion than related paradigms, such as PaaS or
CaaS, the requirements for a suited FaaS benchmark are diferent. There is a
lack of standardized load patterns for the cloud and especially for the
eventtriggered execution of cloud functions. The idea is to extract standardized
load patterns via a literature study or real world use cases, group them and
define template patterns. The catalog contains a few generic, parameterized
load patterns, such as linear or bursty workloads, and could also serve as
a reference for other benchmarks in the cloud area. Based on such a load
pattern catalog, experiments are controllable and comparable.
      </p>
      <p>
        Each function is executed in a lightweight container environment. If the
load pattern leads to a lot of up and downscaling, the execution time is
directly influenced due to the cold start overhead and communication setup
to dependent services. To understand the impact of these application load
patterns on cloud function price and performance compared to IaaS, PaaS or
CaaS, their characteristics [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] need deeper investigation and the proposed
load pattern research is the first step towards this understanding.
Cold Start - Cold starts are an inherent problem of every virtualization
technology. Discussed in the previous aspect, the scaling property of FaaS results
in a lot of cold starts. Based on our previous work [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and results conducted
similarly [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], there is a cold start overhead present ranging between 300ms
up to seconds for a single function. This execution time overhead has a direct
performance and cost impact.
      </p>
      <p>
        Pricing - Pay-per-use billing model leads to a simple pricing for cloud function at
a first glance. Only execution time, memory setting and number of invocations
are necessary. But a single cloud function is rarely an application in the sense
of serving business value to the customer. To get FaaS in production, a lot of
additional services are mandatory, like databases, API gateways etc. Cost
models like the CostHat model [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] could be adapted from the microservice to
the nanoservice scope and include such mandatory services.
      </p>
      <p>
        Portability - Portability is another important aspect. Only when portability
is ensured, a simulation is useful to test, if the function shows a better
performance on another platform. Therefore, the transformation efort and
the estimated savings have to be considered w.r.t. cost or performance.
Wrapper utilities [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] are a first step to enable portable functions and allow a
comparison between custom functionality. Since cloud functions profit from
rich provider ecosystems and are tightly integrated with other services, like
databases, messaging systems etc., the main problem of portability are the
custom interfaces of these services.
      </p>
      <p>A simulation framework for cloud functions to solve conflicting goals between
cost and performance is only realizable, if the items of the previous section are
assessed in detail. The presented research objectives are a starting point and
cover, to the best of the author’s understanding, the most important objectives
relevant to the proposed framework. This leads to the conclusion, that the author
is aware, that there might be missing dimensions and aspects, which will be also
considered when they arise. Similar to the problem of dev-prod parity in software
engineering, a proof of concept is necessary. This validation step is at first a
simulation, second conducting experiments and third, compare the simulated
values to the metered ones in a real life experiment (sim-prod parity).</p>
      <p>Typically, a function with fewer resources allocated is slower, but cheaper and
vice versa. The catalog of load patterns, the configurations of cloud functions,
the cold start values for diferent languages, providers and other dimensions and
the price structure are the input besides the cloud function code for simulating
the cost. Additional meta data are needed in form of a model, which depicts
the interaction with other services in the provider’s ecosystem. A small-sized
benchmark is the processing step of our simulation framework. The simulation is
reproducible since the parameters are constant and only the local execution on
a client’s machine could influence the outcome slightly. A report serves as the
output, where the user can see the best configuration and provider for his use
case dependent on his leading dimension.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Adzic</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chatley</surname>
          </string-name>
          , R.: Serverless Computing:
          <article-title>Economic and Architectural Impact</article-title>
          .
          <source>In: Proc. ESEC/FSE</source>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Back</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Andrikopoulos</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Using a Microbenchmark to Compare Function as a Service Solutions</article-title>
          .
          <source>In: Service-Oriented and Cloud Computing</source>
          . Springer International Publishing (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. van Eyk,
          <string-name>
            <surname>E.</surname>
          </string-name>
          , et al.:
          <article-title>The SPEC Cloud Group's Research Vision on FaaS and Serverless Architectures</article-title>
          .
          <source>In: Proc. WoSC</source>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Huppler</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>The art of building a good benchmark</article-title>
          .
          <source>In: Performance Evaluation and Benchmarking</source>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Jackson</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Clynch</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>An Investigation of the Impact of Language Runtime on the Performance and Cost of Serverless Functions</article-title>
          .
          <source>In: Proc. WoSC</source>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Satyam</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fox</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Evaluation of Production Serverless Computing Environments</article-title>
          .
          <source>In: Proc. CLOUD</source>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Leitner</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cito</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stöckli</surname>
          </string-name>
          , E.:
          <article-title>Modelling and Managing Deployment Costs of Microservice-Based Cloud Applications</article-title>
          .
          <source>In: Proc. UCC</source>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          , et al.:
          <article-title>Serverless Computing: An Investigation of Factors Influencing Microservice Performance</article-title>
          .
          <source>In: Proc. IC2E</source>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Malawski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , et al.:
          <article-title>Benchmarking Heterogeneous Cloud Functions</article-title>
          .
          <source>In: Euro-Par 2017: Parallel Processing Workshops</source>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Manner</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , et al.:
          <article-title>Cold Start Influencing Factors in Function as a Service</article-title>
          .
          <source>In: Proc. WoSC</source>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>McGrath</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brenner</surname>
            ,
            <given-names>P.R.</given-names>
          </string-name>
          : Serverless Computing:
          <article-title>Design, Implementation, and Performance</article-title>
          .
          <source>In: Proc. ICDCSW</source>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Villamizar</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , et al.:
          <article-title>Infrastructure Cost Comparison of Running Web Applications in the Cloud Using AWS Lambda and Monolithic and Microservice Architectures</article-title>
          .
          <source>In: Proc. CCGrid</source>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>