Skip to content
This repository has been archived by the owner on Mar 8, 2019. It is now read-only.

washingtonpost/lambda-load-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lambda-load-test

AWS Lambda Load Test

This project aims to find the limits of AWS Lambda behind a custom http proxy (nginx + node.js).

Setup

Create two c4.8xlarge EC2 instances with the following User Data init scripts.

  • Security Group with port 80 open.
  • Instance Role with permission to AWS Lambda and CloudWatch.

Server - User Data

#!/bin/bash
# Instal nginx, git and start
sudo yum update -y
sudo yum install -y nginx git
service nginx start

# Install node & npm
sudo yum install -y --enablerepo=epel npm
sudo npm install -g forever

# Pull down code, install deps, and run
sudo git clone https://github.com/WPMedia/lambda-load-test
cd lambda-load-test/http-proxy
sudo npm start

# Configure nginx
sudo cp /lambda-load-test/http-proxy/node_backend.conf /etc/nginx/conf.d/.
sudo cp /lambda-load-test/http-proxy/api.conf /etc/nginx/default.d/.
service nginx restart

# Setup Custom CloudWatch Metrics
cd /
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
chmod a+x /lambda-load-test/http-proxy/ephemeral-port-count.sh
(crontab -l ; echo "* * * * * /lambda-load-test/http-proxy/ephemeral-port-count.sh) | crontab

Client - User Data

#!/bin/bash
# Install git and dev tools
sudo yum update -y
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y git

# Pull down load test
sudo git clone https://github.com/WPMedia/lambda-load-test
cd /lambda-load-test/test
sudo chmod a+x loadtest.sh

# Install wrk
sudo git clone https://github.com/wg/wrk.git
cd wrk
sudo make

# Run tests
#./loadtest1.sh > results1.txt
#./loadtest2.sh > results2.txt

Results

Results 1 Results 2

The requests per second seemed to plateau at 120 rps. I've ased AWS for a Lambda service limit increase.

test/ephemeral.png

Releases

No releases published

Packages

No packages published