A simple tool to benchmark http latency with curl
.
For details of the timings see Cheat Sheet on Curl Performance Metrics: how to benchmark server latency with curl.
The deploy-curl-performance-test-master workflow
- Deploy a AWS Lambda Function that runs
curl
on the given list of URLs regularly (every15 minutes
by default). - Produce the following set of CloudWatch Custom Metrics under the a custom Namespace (e.g.
CurlPerformance
.- DnsLookUpTimeInMs
- TcpConnectionTimeInMs
- TlsHandshakeTimeInMs
- RequestSentTimeInMs
- FirstByteTimeInMs
- ContentTransferTimeInMs
- TotalDurationInMs
- Failed (unit: None)
- Produce a CloudWatch Dashboard named
CurlPerformance
.
-
The upload-input-files-to-s3 workflow uploads the URL input files in inputs/ to a S3 bucket which is read by the Lambda Function.
-
URLs are specified in the corresponding
inputs/<AccountId>-<Region>.json
file. -
In the example below,
github_com
is used for the CloudWatch Metric DimensionId
in the NamespaceCurlPerformance
.{ "github_com": { "Url": "https://github.com" } }
-
To add URLs
- Add the URLs to the corresponding
inputs/<AccountId>-<Region>.json
. - Merge the change.
- The workflow will be triggered automatically to upload the file to the S3 bucket and recreate the CloudWatch Dashboard.
- Add the URLs to the corresponding
- Edit .github/workflows/deploy-curl-performance-test.yaml - add VPC ID and Subnet IDs to the step with id
VpcInfo
. - Edit .github/workflows/upload-input-files-to-s3.yaml - add the aws account alias to
accountenvironment
. - Create
inputs/<AccountId>-<Region>.json
. - Merge the change.
- Trigger the workflow deploy-curl-performance-test-master.
- The Lambda Function uses Python 3.7 Runtime which has
curl
installed in its Amazon Linux 1 environment. Some work is required to update the Runtime to Python 3.8 or 3.9 which do not havecurl
installed in the Amazon Linux 2 environment.