Giter VIP home page Giter VIP logo

princetonuniversity / faas-profiler Goto Github PK

View Code? Open in Web Editor NEW
104.0 9.0 29.0 1.3 MB

An open source tool for testing and profiling FaaS and serverless platforms

Home Page: http://parallel.princeton.edu/FaaSProfiler.html

License: MIT License

Python 70.25% Shell 7.14% JavaScript 17.65% HTML 0.43% Swift 2.06% Ruby 2.47%
serverless functions-as-a-service openwhisk profiling-faas-platforms faas benchmarking load-generator

faas-profiler's Introduction

FaaSProfiler is a tool for testing and profiling FaaS platforms. We built FaaSProfiler based on the real needs and limitations we faced early on conducting our serverless research:

  • Arbitrary mix of functions and invocation patterns. FaaSProfiler enables the description of various invocation patterns, function mixes, and activity windows in a clean, user-friendly format.
  • FaaS-testing not plug-and-play. Each function should be invoked independently at the right time. Precisely invoking hundreds or thousands of functions per second needs a reliable, automated tool. We achieve this with FaaSProfiler.
  • Large amount of performance and profiling data. FaaSProfiler enables fast analysis of performance profiling data (e.g., latency, execution time, wait time, etc.) together with resource profiling data (e.g. L1-D MPKI, LLC misses, block I/O, etc.). The user can specify which parameters to profile and make use of the rich feature sets of open-source data analysis libraries like Python pandas

We have used FaaSProfiler for our research and will continue to use and improve it. We hope it accelerates testing early-stage research ideas for others by enabling quick and precise profiling of FaaS platforms on real servers. Enjoy this tool, and please don't forget citing our research paper when you use it:

Mohammad Shahrad, Jonathan Balkind, and David Wentzlaff. "Architectural Implications of Function-as-a-Service Computing." 2019 52nd Annual IEEE/ACM International Symposium on Microarchitecture (MICRO 52), October 2019.

Setting Things Up

Set up OpenWhisk if testing locally

[You don't need this if you intend to use the generic endpoint mode to test remote functions.]

FaaSProfiler has been fully tested on OpenWhisk. Please make sure to set up and install OpenWhisk before using FaaSProfiler.

Important Note: Some of the default OpenWhisk configuration limits might be too restrictive for your setup. Do not forget to configure those parameters (particularly these: invocationsPerMinute, concurrentInvocations, firesPerMinute, and sequenceMaxLength).

Configure FaaSProfiler

After cloning this repo run the one-time configuration script:

bash configure.sh

Usage Guide

Specify the Test

The first step is to prepare a workload configuration file that tells FaaSProfiler about your scenario. A sample workload configuration file, called workload_configs_local_openwhisk.json, has been provided. You can base your own on this JSON file and configure it. Here are some details:

  1. Primary fields:
    1. test_duration_in_seconds: Determines the length of the test in seconds.
    2. random_seed: If set to null, the randomization seed varies with time. For deterministic invocations set this variable to a 32-bit unsigned integer.
    3. blocking_cli: This true/false option determines whether consecutive invocations use blocking cli calls.
    4. endpoint: Specifies the endpoint type for functions to be invoked. By default, the value is set to "local_openwhisk", which denotes functions are deployed on an OpenWhisk deployed locally (on the same machine that hosts FaaSProfiler). Changing the value to "generic" allows invoking remote functions (e.g., on AWS Lambda, Google Cloud Functions, etc.). Skimming through the workload_configs_generic_endpoint.json can guide you on how to use this option. Note that when invoking remote functions with the generic endpoint, you won't be able to do performance profiling and effectively, FaaSProfiler becomes a tool to assist you in creating precise and reproducible invocations.
    5. instances: This is a collection of invocation instances. Each instance describes the invocation behavior for an application (OpenWhisk action). However, multiple instances of the same application can also be deployed with different distributions, input parameters, or activity windows to create more complicated patterns.
  2. Each invocation instance:
    1. application: This should be the same as the OpenWhisk action name. (You can see the list of successfully built OpenWhisk actions using wsk action list -i)
    2. FaaSProfiler supports two invocation types. You need to select one, for each instance, and configure it accordingly. i. Synthetic traffic: 1. distribution: SWI currently supports Uniform and Poisson distributions. 2. rate: Function invocations per second. For a Poisson distribution, this is lambda. A rate of zero means no invocations. ii. Trace-based traffic: 1. interarrivals_list: The list of interarrival times. This mode allows replaying real traces using FaaSProfiler.
    3. activity_window: If set to null, the application is invoked during the entire test. By setting a time window, one can limit the activity of the application to a sub-interval of the test. There is no need to provide this parameter when using trace-based traffic.
    4. param_file: This optional entry allows specifying an input parameter JSON file, similar to option -P in WSK CLI.
    5. data_file: This optional entry allows specifying binary input files such as images for the function.
  3. Performance monitoring (perf_monitoring) field, where you can specify:
    1. runtime_script: This is a script that is run at the beginning of the test. Therefore, it allows specifying performance monitoring tools such as perf, pqos, or blktrace to run at the same time as the test. An example for this script is provided at monitoring/RuntimeMonitoring.sh. This field can be ignored by setting it to null.
    2. post_script: This is a script that runs after the test ends which aims to allow automating post-analysis. This field can be ignored by setting it to null.

We advise the user to go over the workload_configs.json file to familiarize themselves with these fields.

Run the Test

Simply run the following script (replace CONFIG_FILE with the name of your workload config file):

./WorkloadInvoker -c CONFIG_FILE

Test logs can be found in logs/SWI.log.

Analyze the Test

The Workload Analyzer module analyzes a workload after it is run. Here is how to use it:

  1. Run the Workload Analyzer:
./WorkloadAnalyzer -r -p
  1. Certain features can be controlled by input arguments:
    1. -v or --verbose: prints the detailed test data
    2. -p or --plot: plots the test results
    3. -s or --save_plot: save test result plots (this option should be used with -p)
    4. -a or --archive: archive the test results in an pickle file (in the data_archive directory)
    5. -r or --read_results: also gather the results of function invocations
  2. Analysis logs can be found in logs/WA.log.

Compare Archived Tests

The Comparative Analyzer module compares the results of tests archived in the data_archive directory.

Latest Tested Environments

Environment/Tool Tested Version(s)
Python 3.8 (fully tested), 3.10 (partially tested)
OS Ubuntu 16.04.4 LTS, Ubuntu 20.04.1 LTS
Python Library Latest Tested Version
requests-futures 1.0.1
matplotlib 3.3.3
numpy 1.19.5
pandas 1.2.0
seaborn 0.11.1

faas-profiler's People

Contributors

dependabot[bot] avatar engshahrad avatar getziadz avatar goiri avatar jbalkind avatar yl3469 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

faas-profiler's Issues

custom Pintool

To study the branch prediction behaviour, you have used a "custom pintool" to generate branch traces. I wanted to genrate these traces and wanted to observe their behaviour on 1-level branch predictors as they have lower warm-up times. Can you please give me the access to the tool or the traces?
Thank you

Making `max_workers` a configurable parameter in the workload config JSON

I used faas-profiler to send traffic to Knative (endpoint: generic) and it only sends in 100 async request invocations even though my workload config JSON has an ideal peak average concurrency of more than 100.

Steps to reproduce:

Use the workload_configs_generic_endpoint.json under faas-profiler and specify your host and URL (I used it with interarrivals_list with average peak concurrency > 100).
run $ ./WorkloadInvoker -c workload_configs_generic_endpoint.json

Fix

Pass the field in the JSON as max_worker and propagate it through the WorkloadInvoker instead of hardcoding it.

vagrant support

Thanks a lot sir.
I am running open whisk using vagrant. I am not able to get FaaS profiler up and running. I have changed APIHOST and APIKEY in workload invoker file. However i do not know further Configurations to be done. Trivial it may sound, but can you please guide me through the process.I will be really thankful to you.

Originally posted by @navdeepkk in #1 (comment)

Adding support for generic endpoints

By default, faasprofiler invokes OpenWhisk functions deployed locally. In two ongoing projects at the UBC CIRRUS Lab we have extended this to be able to invoke functions with remote endpoints (residing on cloud platforms). I think there is value in bringing this feature to faasprofiler main repo. This change goes beyond just changing scripts, and new documentation should be added to assist users who would only like to use faasprofiler for invoking remote functions. Creating this issue to track this.

Error with profilling

{
"test_name": "example_test",
"test_duration_in_seconds": 15,
"random_seed": 100,
"blocking_cli": true,
"instances":{
"instance1":{
"application": "/guest/hello-c",
"distribution": "Poisson",
"rate": 25,
"activity_window": [5,10]
}
},
"perf_monitoring":{
"runtime_script": null,
"post_script": null
}
}
I use the above workload_configs.json. The language that I am using is C. I run ./WorkloadInvoker -c workload_configs.json and then I run ./WorkloadAnalyzer -r -p and I get the following messages. Can you help?
test

Monitoring Invokers

In the current implementation, the monitoring scripts can only run in the server that runs faas profiler. How do you recommend adding support for running the monitoring scripts on the invoker nodes?

WorkloadAnalyzer Output Explanation

Could you explain what exactly each column in WorkloadAnalyzer's output represents? More specifically:

  • duration
  • waitTime
  • initTime
  • latency
  • invocation period

Thank you in advance.

GetActivationRecordsSince() return None("no matching index found")

I have deployed openwhisk using ansible on three machines and a simple hello.py is created and invoked successfully.
workload.json is defined as
{
"test_name": "example_test",
"test_duration_in_seconds": 15,
"random_seed": 100,
"blocking_cli": false,
"instances":{
"instance1":{
"application": "hellopy",
"interarrivals_list": [1,2,3,5,10]
}
},
"perf_monitoring":{
"runtime_script": "monitoring/RuntimeMonitoring.sh",
"post_script": null
}
}
And, ./WorkloadInvoker -c workload.json works well.
But, ./WorkloadAnalyzer -r -p returns
'''
Invocations by Workload Invoker :4
Records read from CouchDB: 0
Test Dataframe:
Empty DataFrame
Columns: [func_name, activationId, start, end, duration, waitTime, initTime, latency, lang, results]
Index: []
No invocations found!
''''
I check GetActivationRecordsSince() manually, "{'docs': [], 'bookmark': 'nil', 'warning': 'no matching index found, create an index to optimize query time'}" is returned.

Therefore, I have two problems,

  1. Why no records? maybe some configurations are miss?
  2. How do I get the return value of an application(my app 'hellopy' will return "hello world!")?

Microbenchmarks

Hi, I was just reading your paper and it said you have used 28 micribenchmarks. I was just tring to do what is done in the paper but was not able to get the microbenchmarks. Can you please provide the micro benchmarks you have written.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.