Skip to content

Use the AWS CDK to deploy a testbed for the TechEmpower Web Framework Benchmarks.

Notifications You must be signed in to change notification settings

aws-asean-builders/techempower-benchmarks-aws-cdk

Repository files navigation

TechEmpower Benchmarks / AWS CDK

Uses the AWS Cloud Development Kit (CDK) to deploy a simple compute fleet for running the TechEmpower Web Framework Benchmarks on AWS.

Architecture

Architecture Diagram

The resulting Cloudformation stack deploys the above resources. The default configuration of the instances are:

  • 3x m5.xlarge
  • 1x t3.small
  • 1x VPC 50.0.0.0/24
  • 2x subnets in the same AZ
    • 1x private subnet, routed to a NAT gateway
    • 1x public subnet, routed to an IGW
  • 1x security group assigned to all four EC2 instances
    • allows all intra-SG comms
    • allows SSH from 0.0.0.0/0

Usage

This codebase was written in a Node.js v8.11+ environment. Should still work on any version above that, as long as the AWS CDK requirements matches somehow.

Note that the AWS CDK is still in developer preview release, and will likely introduce breaking changes up until it releases formally.

Installing and Configuring the AWS CDK

More detailed instructions here.

  1. Install the AWS CDK.
npm i -g aws-cdk
  1. Feed your AWS credentials into the CDK. If you've got the AWS CLI configured on your machine, you're most likely good to go.

Setting up the codebase

  1. Clone the repository.
  2. npm i
  3. Copy .env.defaults onto just .env. Reasonable defaults are already plugged in, but feel free to change things up.
  4. You will need a keypair to use for ssh-ing onto the controller instance. You can create one on your EC2 console, or your can use one you already have. Make sure the value of TEB_TESTCONTROLLER_KEYNAME matches your keypair.
  5. npm run build. This parses the Typescript files into JS, and prepares for CFN deployment.
  6. cdk deploy will parse everything into CFN templates, and provision resources on AWS.

Running tests

The controller instance serves as your testbed's control plane, and instructs the other instances (client, server, database) to perform the necessary actions to run and catalog the tests. You generally won't need to go into any of the instances except the controller. As such, only your controller instance will have a public IPv4 address.

ssh -i <your keypair> ec2-user@<controller public IP>

Once inside, the benchmark scripts will be in /home/ec2-user/FrameworkBenchmarks. There will be a tfb script you can run to execute the tests. Make sure to plug in the private IPv4 addresses into the script invocation:

More info on how to run the tests are here.

cd FrameworkBenchmarks
./tfb \
  --network-mode host \
  --client-host <client private IP> \
  --server-host <server private IP> \
  --database-host <database private IP>

Once the tests are done, you should have the results cataloged in ./results.

About

Use the AWS CDK to deploy a testbed for the TechEmpower Web Framework Benchmarks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published