├── .github └── FUNDING.yml ├── README.md ├── LICENSE ├── benchmark-t1.sh ├── benchmark-x1e.sh ├── benchmark-g3.sh ├── benchmark-p2.sh ├── benchmark-p3.sh ├── benchmark-m3.sh ├── benchmark-d2.sh ├── benchmark-a1.sh ├── benchmark-h1.sh ├── athena.sql ├── global-wrapper.yaml ├── benchmark-r3.sh ├── benchmark-c4.sh ├── benchmark-r5.sh ├── benchmark-m5.sh ├── benchmark-c5.sh ├── benchmark-m4.sh ├── benchmark-r4.sh ├── benchmark-x1.sh ├── benchmark-z1d.sh ├── benchmark-t2.sh ├── benchmark-t3.sh ├── benchmark-i3.sh ├── global.yaml └── benchmark.yaml /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: widdix 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EC2 Network Benchmark 2 | 3 | All you need to run your own Network Benchmarks on EC2. 4 | 5 | ## Instructions 6 | 7 | 1. Create a VPC or VPC wrapper based on our [VPC templates](http://templates.cloudonaut.io/en/stable/vpc/). 8 | 1. Create a stack based on `global.yaml` which will create an S3 bucket to store the results of your network benchmarks. 9 | 1. Create a stack based on `benchmark.yaml` to run a network benchmark or use one of the `benchmark-*.sh` scripts to do so. 10 | 11 | Create a stack based on `global-wrapper.yaml` if you want to run your network benchmark in multiple regions. Requires a stack based on `global.yaml` within another region. 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 widdix 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /benchmark-t1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create t1.micro 0.02 27 | 28 | wait_create_complete t1.micro 29 | 30 | delete t1.micro 31 | 32 | wait_delete_complete t1.micro 33 | -------------------------------------------------------------------------------- /benchmark-x1e.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create x1.16xlarge 0 27 | create x1.32xlarge 0 28 | 29 | wait_create_complete x1.16xlarge 30 | wait_create_complete x1.32xlarge 31 | 32 | delete x1.16xlarge 33 | delete x1.32xlarge 34 | 35 | wait_delete_complete x1.16xlarge 36 | wait_delete_complete x1.32xlarge 37 | -------------------------------------------------------------------------------- /benchmark-g3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create g3.4xlarge 1.21 27 | create g3.8xlarge 0 28 | create g3.16xlarge 0 29 | 30 | wait_create_complete g3.4xlarge 31 | wait_create_complete g3.8xlarge 32 | wait_create_complete g3.16xlarge 33 | 34 | delete g3.4xlarge 35 | delete g3.8xlarge 36 | delete g3.16xlarge 37 | 38 | wait_delete_complete g3.4xlarge 39 | wait_delete_complete g3.8xlarge 40 | wait_delete_complete g3.16xlarge 41 | -------------------------------------------------------------------------------- /benchmark-p2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create p2.xlarge 0.972 27 | create p2.8xlarge 0 28 | create p2.16xlarge 0 29 | 30 | wait_create_complete p2.xlarge 31 | wait_create_complete p2.8xlarge 32 | wait_create_complete p2.16xlarge 33 | 34 | delete p2.xlarge 35 | delete p2.8xlarge 36 | delete p2.16xlarge 37 | 38 | wait_delete_complete p2.xlarge 39 | wait_delete_complete p2.8xlarge 40 | wait_delete_complete p2.16xlarge 41 | -------------------------------------------------------------------------------- /benchmark-p3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create p3.2xlarge 0 27 | create p3.8xlarge 0 28 | create p3.16xlarge 0 29 | 30 | wait_create_complete p3.2xlarge 31 | wait_create_complete p3.8xlarge 32 | wait_create_complete p3.16xlarge 33 | 34 | delete p3.2xlarge 35 | delete p3.8xlarge 36 | delete p3.16xlarge 37 | 38 | wait_delete_complete p3.2xlarge 39 | wait_delete_complete p3.8xlarge 40 | wait_delete_complete p3.16xlarge 41 | -------------------------------------------------------------------------------- /benchmark-m3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create m3.medium 0.073 27 | create m3.large 0.146 28 | create m3.xlarge 0.293 29 | create m3.2xlarge 0.585 30 | 31 | wait_create_complete m3.medium 32 | wait_create_complete m3.large 33 | wait_create_complete m3.xlarge 34 | wait_create_complete m3.2xlarge 35 | 36 | delete m3.medium 37 | delete m3.large 38 | delete m3.xlarge 39 | delete m3.2xlarge 40 | 41 | wait_delete_complete m3.medium 42 | wait_delete_complete m3.large 43 | wait_delete_complete m3.xlarge 44 | wait_delete_complete m3.2xlarge 45 | -------------------------------------------------------------------------------- /benchmark-d2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create d2.xlarge 0.735 27 | create d2.2xlarge 1.47 28 | create d2.4xlarge 2.94 29 | create d2.8xlarge 0 30 | 31 | wait_create_complete d2.xlarge 32 | wait_create_complete d2.2xlarge 33 | wait_create_complete d2.4xlarge 34 | wait_create_complete d2.8xlarge 35 | 36 | delete d2.xlarge 37 | delete d2.2xlarge 38 | delete d2.4xlarge 39 | delete d2.8xlarge 40 | 41 | wait_delete_complete d2.xlarge 42 | wait_delete_complete d2.2xlarge 43 | wait_delete_complete d2.4xlarge 44 | wait_delete_complete d2.8xlarge 45 | -------------------------------------------------------------------------------- /benchmark-a1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=vpc-2azs ParameterKey=ParentGlobalStack,ParameterValue=benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create a1.medium 27 | create a1.large 28 | create a1.xlarge 29 | create a1.2xlarge 30 | create a1.4xlarge 31 | 32 | wait_create_complete a1.medium 33 | wait_create_complete a1.large 34 | wait_create_complete a1.xlarge 35 | wait_create_complete a1.2xlarge 36 | wait_create_complete a1.4xlarge 37 | 38 | delete a1.medium 39 | delete a1.large 40 | delete a1.xlarge 41 | delete a1.2xlarge 42 | delete a1.4xlarge 43 | 44 | wait_delete_complete a1.medium 45 | wait_delete_complete a1.large 46 | wait_delete_complete a1.xlarge 47 | wait_delete_complete a1.2xlarge 48 | wait_delete_complete a1.4xlarge 49 | -------------------------------------------------------------------------------- /benchmark-h1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create h1.2xlarge 0.611 27 | create h1.4xlarge 1.222 28 | create h1.8xlarge 2.444 29 | create h1.16xlarge 4.888 30 | 31 | wait_create_complete h1.2xlarge 32 | wait_create_complete h1.4xlarge 33 | wait_create_complete h1.8xlarge 34 | wait_create_complete h1.16xlarge 35 | 36 | delete h1.2xlarge 37 | delete h1.4xlarge 38 | delete h1.8xlarge 39 | delete h1.16xlarge 40 | 41 | wait_delete_complete h1.2xlarge 42 | wait_delete_complete h1.4xlarge 43 | wait_delete_complete h1.8xlarge 44 | wait_delete_complete h1.16xlarge 45 | -------------------------------------------------------------------------------- /athena.sql: -------------------------------------------------------------------------------- 1 | 2 | # Delete existing table 3 | 4 | DROP TABLE networkbenchmark; 5 | 6 | # Create table 7 | 8 | CREATE EXTERNAL TABLE networkbenchmark ( 9 | `intervals` array 11 | >>, 12 | instanceType string, 13 | region string 14 | ) 15 | PARTITIONED BY (d date) 16 | ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' 17 | LOCATION 's3://ec2-network-benchmark-global-s3bucket-1e2fy8tntcdz5/v2/'; 18 | 19 | 20 | # Load partiations from S3 21 | 22 | MSCK REPAIR TABLE networkbenchmark; 23 | 24 | # results in Gbit/s 25 | # counter = more or less minute of the benchmark 26 | # cardinality(intervals): filter results with X intervals 27 | 28 | SELECT 29 | (min(interval.sum.bits_per_second)/1000000000) AS min, 30 | (max(interval.sum.bits_per_second)/1000000000) AS max, 31 | (avg(interval.sum.bits_per_second)/1000000000) AS avg, 32 | (stddev(interval.sum.bits_per_second)/1000000000) AS stddev, 33 | (approx_percentile(interval.sum.bits_per_second, 0.95)/1000000000) AS p95, 34 | (approx_percentile(interval.sum.bits_per_second, 0.90)/1000000000) AS p90, 35 | (approx_percentile(interval.sum.bits_per_second, 0.70)/1000000000) AS p70, 36 | (approx_percentile(interval.sum.bits_per_second, 0.50)/1000000000) AS p50, 37 | (approx_percentile(interval.sum.bits_per_second, 0.30)/1000000000) AS p30, 38 | (approx_percentile(interval.sum.bits_per_second, 0.05)/1000000000) AS p05, 39 | region, 40 | instancetype 41 | FROM networkbenchmark CROSS JOIN UNNEST(intervals) WITH ORDINALITY AS t(interval, counter) 42 | WHERE d >= from_iso8601_date('2018-04-12') AND cardinality(intervals) = 60 43 | GROUP BY region, instancetype 44 | ORDER BY region, instancetype; 45 | -------------------------------------------------------------------------------- /global-wrapper.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: 'EC2 Network Benchmark: global (wrapper)' 4 | Parameters: 5 | ParentVPCStack: 6 | Description: 'Stack name of parent VPC stack based on vpc/vpc-*azs.yaml template.' 7 | Type: String 8 | S3BucketName: 9 | Description: 'A wrapper for the S3BucketName' 10 | Type: String 11 | IAMInstanceProfileName: 12 | Description: 'A wrapper for the IAMInstanceProfileName' 13 | Type: String 14 | Resources: 15 | SecurityGroup: 16 | Type: AWS::EC2::SecurityGroup 17 | Properties: 18 | GroupDescription: !Sub '${AWS::StackName}-client' 19 | VpcId: 20 | 'Fn::ImportValue': !Sub '${ParentVPCStack}-VPC' 21 | SecurityGroupIngress: 22 | Type: 'AWS::EC2::SecurityGroupIngress' 23 | Properties: 24 | GroupId: !Sub '${SecurityGroup.GroupId}' 25 | IpProtocol: tcp 26 | FromPort: '5201' 27 | ToPort: '5201' 28 | SourceSecurityGroupId: !Sub '${SecurityGroup.GroupId}' 29 | Outputs: 30 | SecurityGroupId: 31 | Description: 'The security group id allowing traffic for iperf3.' 32 | Value: !Sub '${SecurityGroup.GroupId}' 33 | Export: 34 | Name: !Sub '${AWS::StackName}-SecurityGroupId' 35 | S3BucketName: 36 | Description: 'The name of the S3 bucket storing the network benchmark results.' 37 | Value: !Ref S3BucketName 38 | Export: 39 | Name: !Sub '${AWS::StackName}-S3BucketName' 40 | IAMInstanceProfileName: 41 | Description: 'The name of the IAM instance profile granting write access to S3 for storing network benchmark results.' 42 | Value: !Ref IAMInstanceProfileName 43 | Export: 44 | Name: !Sub '${AWS::StackName}-IAMInstanceProfileName' 45 | -------------------------------------------------------------------------------- /benchmark-r3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create r3.large 0.185 27 | create r3.xlarge 0.371 28 | create r3.2xlarge 0.741 29 | create r3.4xlarge 1.482 30 | create r3.8xlarge 2.964 31 | 32 | wait_create_complete r3.large 33 | wait_create_complete r3.xlarge 34 | wait_create_complete r3.2xlarge 35 | wait_create_complete r3.4xlarge 36 | wait_create_complete r3.8xlarge 37 | 38 | delete r3.large 39 | delete r3.xlarge 40 | delete r3.2xlarge 41 | delete r3.4xlarge 42 | delete r3.8xlarge 43 | 44 | wait_delete_complete r3.large 45 | wait_delete_complete r3.xlarge 46 | wait_delete_complete r3.2xlarge 47 | wait_delete_complete r3.4xlarge 48 | wait_delete_complete r3.8xlarge 49 | -------------------------------------------------------------------------------- /benchmark-c4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create c4.large 0.113 27 | create c4.xlarge 0.226 28 | create c4.2xlarge 0.453 29 | create c4.4xlarge 0.905 30 | create c4.8xlarge 1.811 31 | 32 | wait_create_complete c4.large 33 | wait_create_complete c4.xlarge 34 | wait_create_complete c4.2xlarge 35 | wait_create_complete c4.4xlarge 36 | wait_create_complete c4.8xlarge 37 | 38 | delete c4.large 39 | delete c4.xlarge 40 | delete c4.2xlarge 41 | delete c4.4xlarge 42 | delete c4.8xlarge 43 | 44 | wait_delete_complete c4.large 45 | wait_delete_complete c4.xlarge 46 | wait_delete_complete c4.2xlarge 47 | wait_delete_complete c4.4xlarge 48 | wait_delete_complete c4.8xlarge 49 | 50 | -------------------------------------------------------------------------------- /benchmark-r5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create r5.large 0 27 | create r5.xlarge 0 28 | create r5.2xlarge 0 29 | create r5.4xlarge 0 30 | create r5.12xlarge 0 31 | create r5.24xlarge 0 32 | 33 | wait_create_complete r5.large 34 | wait_create_complete r5.xlarge 35 | wait_create_complete r5.2xlarge 36 | wait_create_complete r5.4xlarge 37 | wait_create_complete r5.12xlarge 38 | wait_create_complete r5.24xlarge 39 | 40 | delete r5.large 41 | delete r5.xlarge 42 | delete r5.2xlarge 43 | delete r5.4xlarge 44 | delete r5.12xlarge 45 | delete r5.24xlarge 46 | 47 | wait_delete_complete r5.large 48 | wait_delete_complete r5.xlarge 49 | wait_delete_complete r5.2xlarge 50 | wait_delete_complete r5.4xlarge 51 | wait_delete_complete r5.12xlarge 52 | wait_delete_complete r5.24xlarge 53 | 54 | -------------------------------------------------------------------------------- /benchmark-m5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="5.136" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create m5.large 0.107 27 | create m5.xlarge 0.214 28 | create m5.2xlarge 0.428 29 | create m5.4xlarge 0 30 | create m5.12xlarge 0 31 | create m5.24xlarge 0 32 | 33 | wait_create_complete m5.large 34 | wait_create_complete m5.xlarge 35 | wait_create_complete m5.2xlarge 36 | wait_create_complete m5.4xlarge 37 | wait_create_complete m5.12xlarge 38 | wait_create_complete m5.24xlarge 39 | 40 | delete m5.large 41 | delete m5.xlarge 42 | delete m5.2xlarge 43 | delete m5.4xlarge 44 | delete m5.12xlarge 45 | delete m5.24xlarge 46 | 47 | wait_delete_complete m5.large 48 | wait_delete_complete m5.xlarge 49 | wait_delete_complete m5.2xlarge 50 | wait_delete_complete m4.4xlarge 51 | wait_delete_complete m5.4xlarge 52 | wait_delete_complete m5.24xlarge 53 | -------------------------------------------------------------------------------- /benchmark-c5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create c5.large 0.096 27 | create c5.xlarge 0.192 28 | create c5.2xlarge 0.384 29 | create c5.4xlarge 0.768 30 | create c5.9xlarge 1.728 31 | create c5.18xlarge 3.456 32 | 33 | wait_create_complete c5.large 34 | wait_create_complete c5.xlarge 35 | wait_create_complete c5.2xlarge 36 | wait_create_complete c5.4xlarge 37 | wait_create_complete c5.9xlarge 38 | wait_create_complete c5.18xlarge 39 | 40 | delete c5.large 41 | delete c5.xlarge 42 | delete c5.2xlarge 43 | delete c5.4xlarge 44 | delete c5.9xlarge 45 | delete c5.18xlarge 46 | 47 | wait_delete_complete c5.large 48 | wait_delete_complete c5.xlarge 49 | wait_delete_complete c5.2xlarge 50 | wait_delete_complete c5.4xlarge 51 | wait_delete_complete c5.9xlarge 52 | wait_delete_complete c5.18xlarge 53 | 54 | -------------------------------------------------------------------------------- /benchmark-m4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create m4.large 0.111 27 | create m4.xlarge 0.222 28 | create m4.2xlarge 0.444 29 | create m4.4xlarge 0.888 30 | create m4.10xlarge 2.22 31 | create m4.16xlarge 3.552 32 | 33 | wait_create_complete m4.large 34 | wait_create_complete m4.xlarge 35 | wait_create_complete m4.2xlarge 36 | wait_create_complete m4.4xlarge 37 | wait_create_complete m4.10xlarge 38 | wait_create_complete m4.16xlarge 39 | 40 | delete m4.large 41 | delete m4.xlarge 42 | delete m4.2xlarge 43 | delete m4.4xlarge 44 | delete m4.10xlarge 45 | delete m4.16xlarge 46 | 47 | wait_delete_complete m4.large 48 | wait_delete_complete m4.xlarge 49 | wait_delete_complete m4.2xlarge 50 | wait_delete_complete m4.4xlarge 51 | wait_delete_complete m4.10xlarge 52 | wait_delete_complete m4.16xlarge 53 | 54 | -------------------------------------------------------------------------------- /benchmark-r4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create r4.large 0.148 27 | create r4.xlarge 0.296 28 | create r4.2xlarge 0.593 29 | create r4.4xlarge 1.186 30 | create r4.8xlarge 2.371 31 | create r4.16xlarge 4.742 32 | 33 | wait_create_complete r4.large 34 | wait_create_complete r4.xlarge 35 | wait_create_complete r4.2xlarge 36 | wait_create_complete r4.4xlarge 37 | wait_create_complete r4.8xlarge 38 | wait_create_complete r4.16xlarge 39 | 40 | delete r4.large 41 | delete r4.xlarge 42 | delete r4.2xlarge 43 | delete r4.4xlarge 44 | delete r4.8xlarge 45 | delete r4.16xlarge 46 | 47 | wait_delete_complete r4.large 48 | wait_delete_complete r4.xlarge 49 | wait_delete_complete r4.2xlarge 50 | wait_delete_complete r4.4xlarge 51 | wait_delete_complete r4.8xlarge 52 | wait_delete_complete r4.16xlarge 53 | 54 | -------------------------------------------------------------------------------- /benchmark-x1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create x1e.xlarge 1 27 | create x1e.2xlarge 0 28 | create x1e.4xlarge 0 29 | create x1e.8xlarge 0 30 | create x1e.16xlarge 0 31 | create x1e.32xlarge 0 32 | 33 | wait_create_complete x1e.xlarge 34 | wait_create_complete x1e.2xlarge 35 | wait_create_complete x1e.4xlarge 36 | wait_create_complete x1e.8xlarge 37 | wait_create_complete x1e.16xlarge 38 | wait_create_complete x1e.32xlarge 39 | 40 | delete x1e.xlarge 41 | delete x1e.2xlarge 42 | delete x1e.4xlarge 43 | delete x1e.8xlarge 44 | delete x1e.16xlarge 45 | delete x1e.32xlarge 46 | 47 | wait_delete_complete x1e.xlarge 48 | wait_delete_complete x1e.2xlarge 49 | wait_delete_complete x1e.4xlarge 50 | wait_delete_complete x1e.8xlarge 51 | wait_delete_complete x1e.16xlarge 52 | wait_delete_complete x1e.32xlarge 53 | -------------------------------------------------------------------------------- /benchmark-z1d.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create z1d.large 0.208 27 | create z1d.xlarge 0.416 28 | create z1d.2xlarge 0 29 | create z1d.3xlarge 0 30 | create z1d.6xlarge 0 31 | create z1d.12xlarge 4.992 32 | 33 | wait_create_complete z1d.large 34 | wait_create_complete z1d.xlarge 35 | wait_create_complete z1d.2xlarge 36 | wait_create_complete z1d.3xlarge 37 | wait_create_complete z1d.6xlarge 38 | wait_create_complete z1d.12xlarge 39 | 40 | delete z1d.large 41 | delete z1d.xlarge 42 | delete z1d.2xlarge 43 | delete z1d.3xlarge 44 | delete z1d.6xlarge 45 | delete z1d.12xlarge 46 | 47 | wait_delete_complete z1d.large 48 | wait_delete_complete z1d.xlarge 49 | wait_delete_complete z1d.2xlarge 50 | wait_delete_complete z1d.3xlarge 51 | wait_delete_complete z1d.6xlarge 52 | wait_delete_complete z1d.12xlarge 53 | 54 | -------------------------------------------------------------------------------- /benchmark-t2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create t2.nano 0 27 | create t2.micro 0.0126 28 | create t2.small 0.025 29 | create t2.medium 0.05 30 | create t2.large 0.1008 31 | create t2.xlarge 0.2016 32 | create t2.2xlarge 0.4032 33 | 34 | wait_create_complete t2.nano 35 | wait_create_complete t2.micro 36 | wait_create_complete t2.small 37 | wait_create_complete t2.medium 38 | wait_create_complete t2.large 39 | wait_create_complete t2.xlarge 40 | wait_create_complete t2.2xlarge 41 | 42 | delete t2.nano 43 | delete t2.micro 44 | delete t2.small 45 | delete t2.medium 46 | delete t2.large 47 | delete t2.xlarge 48 | delete t2.2xlarge 49 | 50 | wait_delete_complete t2.nano 51 | wait_delete_complete t2.micro 52 | wait_delete_complete t2.small 53 | wait_delete_complete t2.medium 54 | wait_delete_complete t2.large 55 | wait_delete_complete t2.xlarge 56 | wait_delete_complete t2.2xlarge 57 | 58 | -------------------------------------------------------------------------------- /benchmark-t3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create t3.nano 0 27 | create t3.micro 0.0104 28 | create t3.small 0.0228 29 | create t3.medium 0.0456 30 | create t3.large 0.0912 31 | create t3.xlarge 0.1824 32 | create t3.2xlarge 0.3648 33 | 34 | wait_create_complete t3.nano 35 | wait_create_complete t3.micro 36 | wait_create_complete t3.small 37 | wait_create_complete t3.medium 38 | wait_create_complete t3.large 39 | wait_create_complete t3.xlarge 40 | wait_create_complete t3.2xlarge 41 | 42 | delete t3.nano 43 | delete t3.micro 44 | delete t3.small 45 | delete t3.medium 46 | delete t3.large 47 | delete t3.xlarge 48 | delete t3.2xlarge 49 | 50 | wait_delete_complete t3.nano 51 | wait_delete_complete t3.micro 52 | wait_delete_complete t3.small 53 | wait_delete_complete t3.medium 54 | wait_delete_complete t3.large 55 | wait_delete_complete t3.xlarge 56 | wait_delete_complete t3.2xlarge 57 | 58 | -------------------------------------------------------------------------------- /benchmark-i3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | INSTANCE_TYPE_SERVER="c5.18xlarge" 4 | SPOT_PRICE_SERVER="3.456" 5 | 6 | # $1 = client instance type 7 | function create { 8 | aws cloudformation create-stack --stack-name ec2-network-benchmark-${1//./-} --parameters ParameterKey=ParentVPCStack,ParameterValue=ec2-network-benchmark-vpc ParameterKey=ParentGlobalStack,ParameterValue=ec2-network-benchmark-global ParameterKey=InstanceTypeClient,ParameterValue=$1 ParameterKey=SpotPriceClient,ParameterValue=$2 ParameterKey=InstanceTypeServer,ParameterValue=$INSTANCE_TYPE_SERVER ParameterKey=SpotPriceServer,ParameterValue=$SPOT_PRICE_SERVER --template-body file://benchmark.yaml 9 | } 10 | 11 | # $1 = client instance type 12 | function wait_create_complete { 13 | aws cloudformation wait stack-create-complete --stack-name ec2-network-benchmark-${1//./-} 14 | } 15 | 16 | # $1 = client instance type 17 | function delete { 18 | aws cloudformation delete-stack --stack-name ec2-network-benchmark-${1//./-} 19 | } 20 | 21 | # $1 = client instance type 22 | function wait_delete_complete { 23 | aws cloudformation wait stack-delete-complete --stack-name ec2-network-benchmark-${1//./-} 24 | } 25 | 26 | create i3.large 0.172 27 | create i3.xlarge 0.344 28 | create i3.2xlarge 0.688 29 | create i3.4xlarge 1.376 30 | create i3.8xlarge 2.752 31 | create i3.16xlarge 5.504 32 | create i3.metal 5.504 33 | 34 | wait_create_complete i3.large 35 | wait_create_complete i3.xlarge 36 | wait_create_complete i3.2xlarge 37 | wait_create_complete i3.4xlarge 38 | wait_create_complete i3.8xlarge 39 | wait_create_complete i3.16xlarge 40 | wait_create_complete i3.metal 41 | 42 | delete i3.large 43 | delete i3.xlarge 44 | delete i3.2xlarge 45 | delete i3.4xlarge 46 | delete i3.8xlarge 47 | delete i3.16xlarge 48 | delete i3.metal 49 | 50 | wait_delete_complete i3.large 51 | wait_delete_complete i3.xlarge 52 | wait_delete_complete i3.2xlarge 53 | wait_delete_complete i3.4xlarge 54 | wait_delete_complete i3.8xlarge 55 | wait_delete_complete i3.16xlarge 56 | wait_delete_complete i3.metal 57 | -------------------------------------------------------------------------------- /global.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: 'EC2 Network Benchmark: global' 4 | Metadata: 5 | 'AWS::CloudFormation::Interface': 6 | ParameterGroups: 7 | - Label: 8 | default: 'Parent Stacks' 9 | Parameters: 10 | - ParentVPCStack 11 | Parameters: 12 | ParentVPCStack: 13 | Description: 'Stack name of parent VPC stack based on vpc/vpc-*azs.yaml template.' 14 | Type: String 15 | Resources: 16 | S3Bucket: 17 | Type: 'AWS::S3::Bucket' 18 | Properties: {} 19 | SecurityGroup: 20 | Type: AWS::EC2::SecurityGroup 21 | Properties: 22 | GroupDescription: !Sub '${AWS::StackName}-client' 23 | VpcId: 24 | 'Fn::ImportValue': !Sub '${ParentVPCStack}-VPC' 25 | SecurityGroupIngress: 26 | Type: 'AWS::EC2::SecurityGroupIngress' 27 | Properties: 28 | GroupId: !Sub '${SecurityGroup.GroupId}' 29 | IpProtocol: tcp 30 | FromPort: '5201' 31 | ToPort: '5201' 32 | SourceSecurityGroupId: !Sub '${SecurityGroup.GroupId}' 33 | IAMInstanceProfile: 34 | Type: 'AWS::IAM::InstanceProfile' 35 | Properties: 36 | Path: '/' 37 | Roles: 38 | - !Ref IAMRole 39 | IAMRole: 40 | Type: 'AWS::IAM::Role' 41 | Properties: 42 | AssumeRolePolicyDocument: 43 | Version: '2012-10-17' 44 | Statement: 45 | - Effect: Allow 46 | Principal: 47 | Service: 48 | - 'ec2.amazonaws.com' 49 | Action: 50 | - 'sts:AssumeRole' 51 | Path: '/' 52 | Policies: 53 | - PolicyName: s3 54 | PolicyDocument: 55 | Version: '2012-10-17' 56 | Statement: 57 | - Effect: Allow 58 | Action: 's3:PutObject' 59 | Resource: !Sub '${S3Bucket.Arn}/*' 60 | - Effect: Allow 61 | Action: 62 | - 'autoscaling:DescribeAutoScalingGroups' 63 | - 'ec2:DescribeInstances' 64 | Resource: '*' 65 | Outputs: 66 | StackName: 67 | Description: 'Stack name' 68 | Value: !Sub '${AWS::StackName}' 69 | SecurityGroupId: 70 | Description: 'The security group id allowing traffic for ipref3.' 71 | Value: !Sub '${SecurityGroup.GroupId}' 72 | Export: 73 | Name: !Sub '${AWS::StackName}-SecurityGroupId' 74 | S3BucketName: 75 | Description: 'The name of the S3 bucket storing the network benchmark results.' 76 | Value: !Ref S3Bucket 77 | Export: 78 | Name: !Sub '${AWS::StackName}-S3BucketName' 79 | IAMInstanceProfileName: 80 | Description: 'The name of the IAM instance profile granting write access to S3 for storing network benchmark results.' 81 | Value: !Ref IAMInstanceProfile 82 | Export: 83 | Name: !Sub '${AWS::StackName}-IAMInstanceProfileName' 84 | -------------------------------------------------------------------------------- /benchmark.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: 'EC2 Network Benchmark: benchmark' 4 | Metadata: 5 | 'AWS::CloudFormation::Interface': 6 | ParameterGroups: 7 | - Label: 8 | default: 'Parent Stacks' 9 | Parameters: 10 | - ParentVPCStack 11 | - ParentGlobalStack 12 | - Label: 13 | default: 'EC2 Parameters' 14 | Parameters: 15 | - InstanceTypeClient 16 | - InstanceTypeServer 17 | Parameters: 18 | ParentVPCStack: 19 | Description: 'Stack name of parent VPC stack based on vpc/vpc-*azs.yaml template.' 20 | Type: String 21 | ParentGlobalStack: 22 | Description: 'Stack name of parent global stack based on global.yaml template.' 23 | Type: String 24 | Default: '' 25 | InstanceTypeClient: 26 | Description: 'The instance type for the EC2 instance.' 27 | Type: String 28 | Default: 't2.micro' 29 | SpotPriceClient: 30 | Description: 'The spot price for the EC2 instance.' 31 | Type: Number 32 | Default: 0 33 | InstanceTypeServer: 34 | Description: 'The instance type for the EC2 instance.' 35 | Type: String 36 | Default: 't2.micro' 37 | SpotPriceServer: 38 | Description: 'The spot price for the EC2 instance.' 39 | Type: Number 40 | Default: 0 41 | Mappings: 42 | RegionMap: 43 | # AMD64: 44 | # CreationDate: '2018-11-14T09:06:55.000Z' 45 | # Name: amzn2-ami-hvm-2.0.20181114-x86_64-gp2 46 | # Owner: amazon 47 | # ARM64: 48 | # CreationDate: '2018-11-27T03:53:23.000Z' 49 | # Name: amzn2-ami-hvm-2.0.20181114.1-arm64-gp2 50 | # Owner: amazon 51 | ap-northeast-1: 52 | AMD64: ami-0a2de1c3b415889d2 53 | ap-northeast-2: 54 | AMD64: ami-0b4fdb56a00adb616 55 | ap-south-1: 56 | AMD64: ami-06bcd1131b2f55803 57 | ap-southeast-1: 58 | AMD64: ami-0b84d2c53ad5250c2 59 | ap-southeast-2: 60 | AMD64: ami-08589eca6dcc9b39c 61 | ca-central-1: 62 | AMD64: ami-076b4adb3f90cd384 63 | eu-central-1: 64 | AMD64: ami-034fffcc6a0063961 65 | eu-west-1: 66 | AMD64: ami-09693313102a30b2c 67 | ARM64: ami-0b97e17c772f052e6 68 | eu-west-2: 69 | AMD64: ami-0274e11dced17bb5b 70 | eu-west-3: 71 | AMD64: ami-051707cdba246187b 72 | sa-east-1: 73 | AMD64: ami-0112d42866980b373 74 | us-east-1: 75 | AMD64: ami-009d6802948d06e52 76 | ARM64: ami-0f8c82faeb08f15da 77 | us-east-2: 78 | AMD64: ami-02e680c4540db351e 79 | ARM64: ami-0998858ab6ad47da8 80 | us-west-1: 81 | AMD64: ami-011b6930a81cd6aaf 82 | us-west-2: 83 | AMD64: ami-01bbe152bf19d0289 84 | ARM64: ami-0f374ff3bc5bb0929 85 | Conditions: 86 | HasSpotPriceClient: !Not [!Equals [!Ref SpotPriceClient, 0]] 87 | HasSpotPriceServer: !Not [!Equals [!Ref SpotPriceServer, 0]] 88 | IsArmInstance: !Equals [ !Select [ 0, !Split ['.', !Ref InstanceTypeClient] ], 'a1' ] 89 | Resources: 90 | ClientMachineLaunchConfig: 91 | Type: 'AWS::AutoScaling::LaunchConfiguration' 92 | Properties: 93 | SpotPrice: !If [HasSpotPriceClient, !Ref SpotPriceClient, !Ref 'AWS::NoValue'] 94 | IamInstanceProfile: 95 | 'Fn::ImportValue': !Sub '${ParentGlobalStack}-IAMInstanceProfileName' 96 | ImageId: 97 | Fn::If: 98 | - IsArmInstance 99 | - !FindInMap [RegionMap, !Ref 'AWS::Region', ARM64] 100 | - !FindInMap [RegionMap, !Ref 'AWS::Region', AMD64] 101 | InstanceType: !Ref InstanceTypeClient 102 | SecurityGroups: 103 | - 'Fn::ImportValue': !Sub '${ParentGlobalStack}-SecurityGroupId' 104 | InstanceMonitoring: true 105 | UserData: 106 | 'Fn::Base64': !Join 107 | - '' 108 | - - "#!/bin/bash -x \n" 109 | - "bash -ex << \"TRY\"\n" 110 | - " amazon-linux-extras enable epel \n" 111 | - " yum install -y epel-release \n" 112 | - " yum clean all \n" 113 | - " yum -y install iperf3 jq \n" 114 | - " sleep 60 \n" 115 | - !Sub "SERVER_INSTANCE_ID=$(aws autoscaling describe-auto-scaling-groups --region ${AWS::Region} --auto-scaling-group-name ${ServerMachineAutoScalingGroup} --query AutoScalingGroups[*].Instances[0].InstanceId --output text) \n" 116 | - !Sub "SERVER_PRIVATE_IP=$(aws ec2 describe-instances --region ${AWS::Region} --instance-ids $SERVER_INSTANCE_ID --query Reservations[0].Instances[0].PrivateIpAddress --output text) \n" 117 | - " iperf3 --client $SERVER_PRIVATE_IP --time 3600 --interval 60 --version4 --json -P 10 | jq -c '{start: .start, intervals: .intervals, end: .end, instanceType: \"" 118 | - !Sub "${InstanceTypeClient}" 119 | - "\", region: \"" 120 | - !Sub "${AWS::Region}" 121 | - "\"}' | gzip | aws s3 cp - \"s3://" 122 | - 'Fn::ImportValue': !Sub '${ParentGlobalStack}-S3BucketName' 123 | - !Sub "/v2/d=$(date +%Y-%m-%d)/${InstanceTypeClient}-$(date +%s).json.gz\" \n" 124 | - "TRY\n" 125 | - !Sub "/opt/aws/bin/cfn-signal -e $? --region ${AWS::Region} --stack ${AWS::StackName} --resource ClientMachineAutoScalingGroup \n" 126 | ClientMachineAutoScalingGroup: 127 | Type: 'AWS::AutoScaling::AutoScalingGroup' 128 | Properties: 129 | LaunchConfigurationName: !Ref ClientMachineLaunchConfig 130 | MinSize: 1 131 | MaxSize: 1 132 | DesiredCapacity: 1 133 | VPCZoneIdentifier: 134 | - 'Fn::ImportValue': !Sub '${ParentVPCStack}-SubnetAPublic' 135 | Tags: 136 | - Key: Name 137 | Value: 'EC2 Network Benchmark Client' 138 | PropagateAtLaunch: true 139 | CreationPolicy: 140 | ResourceSignal: 141 | Count: 1 142 | Timeout: PT75M 143 | ServerMachineLaunchConfig: 144 | Type: 'AWS::AutoScaling::LaunchConfiguration' 145 | Properties: 146 | SpotPrice: !If [HasSpotPriceServer, !Ref SpotPriceServer, !Ref 'AWS::NoValue'] 147 | IamInstanceProfile: 148 | 'Fn::ImportValue': !Sub '${ParentGlobalStack}-IAMInstanceProfileName' 149 | ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMD64] 150 | InstanceType: !Ref InstanceTypeServer 151 | SecurityGroups: 152 | - 'Fn::ImportValue': !Sub '${ParentGlobalStack}-SecurityGroupId' 153 | InstanceMonitoring: true 154 | UserData: 155 | 'Fn::Base64': !Sub | 156 | #!/bin/bash -x 157 | bash -ex << "TRY" 158 | yum-config-manager --enable epel 159 | yum clean all 160 | yum -y install iperf3 161 | TRY 162 | /opt/aws/bin/cfn-signal -e $? --region ${AWS::Region} --stack ${AWS::StackName} --resource ServerMachineAutoScalingGroup 163 | iperf3 -s 164 | ServerMachineAutoScalingGroup: 165 | Type: "AWS::AutoScaling::AutoScalingGroup" 166 | Properties: 167 | LaunchConfigurationName: !Ref ServerMachineLaunchConfig 168 | MinSize: 1 169 | MaxSize: 1 170 | DesiredCapacity: 1 171 | VPCZoneIdentifier: 172 | - 'Fn::ImportValue': !Sub '${ParentVPCStack}-SubnetAPublic' 173 | Tags: 174 | - Key: Name 175 | Value: 'EC2 Network Benchmark Server' 176 | PropagateAtLaunch: true 177 | CreationPolicy: 178 | ResourceSignal: 179 | Count: 1 180 | Timeout: PT15M 181 | Outputs: 182 | StackName: 183 | Description: 'Stack name' 184 | Value: !Sub '${AWS::StackName}' 185 | --------------------------------------------------------------------------------