Uses the AWS Cloud Development Kit (CDK) to deploy a simple compute fleet for running the TechEmpower Web Framework Benchmarks on AWS.
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
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.
More detailed instructions here.
- Install the AWS CDK.
npm i -g aws-cdk
- 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.
- Clone the repository.
npm i
- Copy
.env.defaults
onto just.env
. Reasonable defaults are already plugged in, but feel free to change things up. - 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 ofTEB_TESTCONTROLLER_KEYNAME
matches your keypair. npm run build
. This parses the Typescript files into JS, and prepares for CFN deployment.cdk deploy
will parse everything into CFN templates, and provision resources on AWS.
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
.