Skip to content

problems with the generate-traffic.sh script on the EC2 terminator-test-test-instance #36

@AstroTom

Description

@AstroTom

Hi Chetz, finally got back to playing :-)

As I've noted before, when running the traffic generation about 99% of the traffic goes to the internet, instead of to S3, DDBand ECR. Here is some output from version v0.7.1 today:

Collected Traffic Sample

Total: 160 records, 0.16 GB

Service Data (GB) Percentage
S3 0.00 0.8%
DynamoDB 0.00 0.1%
ECR 0.00 0.0%
Other 0.16 99.0%

Cost Estimate

Projected from 5-minute sample to monthly estimate

NAT Gateway Rate: $0.0450 per GB

Metric Amount
NAT Gateway Data Processing Cost $60.95/month
S3 Endpoint Savings $0.49/month
DynamoDB Endpoint Savings $0.08/month
ECR Traffic Cost over NAT (no free endpoint) $0.02/month
Estimated ECR Interface Endpoint Cost (2 endpoint(s), 1 AZ) $14.40/month
└ Fixed hourly component $14.40/month
└ Data processing component (0.36 GB/month) $0.00/month
Total Potential Savings $0.57/month

When I try for 15 minuutes the results are about the same.

I started looking at the code for generate-traffic.sh and I saw some issues. The main one is that the curl to get the region does not work:

REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/region)

This is because EC2 no longer supports the old IMDSv1 (with no token) by default, so the curl fails. You can either use the new IMDSv2 or simply add the --http-tokens optional option when creating (or modifying) the instance.

After I did that, I got 97% of the traffic going to ECR. ( I also changed the sleep from 10 seconds to 1. Not sure why any sleep is needed.

Total: 42 records, 0.14 GB

Service Data (GB) Percentage
S3 0.00 0.0%
DynamoDB 0.00 0.5%
ECR 0.14 97.3%
Other 0.00 2.2%

Cost Estimate

Projected from 5-minute sample to monthly estimate

NAT Gateway Rate: $0.0450 per GB

Metric Amount
NAT Gateway Data Processing Cost $55.98/month
S3 Endpoint Savings $0.00/month
DynamoDB Endpoint Savings $0.26/month
ECR Traffic Cost over NAT (no free endpoint) $54.47/month
Estimated ECR Interface Endpoint Cost (2 endpoint(s), 1 AZ) $26.50/month
└ Fixed hourly component $14.40/month
└ Data processing component (1210.40 GB/month) $12.10/month
Total Potential Savings $0.26/month

I am still not sure why S3 and Dynamo don't get more traffic. In the case of S3, I think it is because of the small size (1MB) of the file. I created a 500MB files and manually copied it and did get reasonable results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions