Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api
benchmark-jupyter
benchmark
lambda
.gitignore
README.md
redeploy.sh
sample-config.sh

README.md

Lambda Performance Benchmark

This repository contains quickly hacked scripts to measure API Gateway, Lambda and VPC performance.

Was done for the purpose of this article.

DISCLAIMER: Use at your own risk. Quickly hacked. Main purpose was to analyze data in R, not to write a nicely looking and well documented scripts.

Structure

|- api/        - API Gateway Swagger template & deploy script
|- benchmark/  - Benchmark & keep alive Python scripts
   |- csv/     - Gathered data
   |- html/    - HTML pages with analysis of csv/ content
   |- r/       - R scripts for csv/ analysis
|- lambda/     - Python, JavaScript and ClojureScript lambda functions
                 with deployment script

Installation

Requirements

  • make, lein
  • awscli
  • scripta
  • Python 3.5

Environment Variables

You have to provide following env variables:

export AWS_DEFAULT_REGION=eu-west-1
export AWS_ACCOUNT_ID=123456789012
export LAMBDA_ROLE_NAME=JustTheRoleName
export VPC_SUBNET=subnet-abcdefgh
export VPC_SECURITY_GROUP=sg-abcdefgh
export REST_API_ID=abcdefghi
export REST_API_BASE=https://abcdefghi.execute-api.eu-west-1.amazonaws.com/v1
export REST_API_KEY=your-api-gateway-api-key

There's sample-config.sh file. You can edit it and provide env variables via source ./sample-config.sh.

Lambda

  • Provide env variables
cd lambda/cljs
./deploy.sh
cd ../js
make deploy
cd ../python
make deploy
  • Lambda functions in Python, Clojurescript, JavaScript languages
  • Lambda functions are deployed in 128, 256, 512, 768, 1024, 1280, 1536 MB variants
  • Lambda functions are deployed with VPC and without VPC
    • With VPC to test ENI pull time
  • Lambda function name is Performance$LANG$MEMORY or Performance$LANGVPC$MEMORY
  • 42 lambda functions deployed

API Gateway

  • Create REST API in the console
  • Provide env variables
cd api
./deploy.sh

Benchmark

What it does?

  • Sleeps for 0, 5, 10, 15, 30, 60, 300, 600, 900, 1800, 3600 seconds
    • Issues 30 requests for every endpoint and measure durations
    • Requests issued via 10 workers (parallel requests)
  • CSV file is generated at the end

Generate CSV

cd benchmark
./benchmark.py
You can’t perform that action at this time.