dvassallo / s3-benchmark

Measure Amazon S3's performance from any location.
MIT License
821 stars 133 forks source link

Added support for IMDSv2 and Amazon S3 OneZone Express #31

Open cmilanf opened 9 months ago

cmilanf commented 9 months ago

This PR includes a pair of commits:

  1. Upgrades the usage of Instance Metadata Service to v2. v2 requires to authenticate each call with a token that is requested via the getToken() function. It also upgrades AWS Go SDK v2 version to 1.24.1. This commit is based in the changes proposed by #25.
  2. Adds main-express.go file, that is a duplicate of main.go, but with the code modified to benchmark the new Amazon S3 Express OneZone specifically.
ekaynar commented 6 months ago

@cmilanf Does the code automatically renew the token when it expires?

cmilanf commented 6 months ago

@ekaynar No, it generates a token in the getToken() function with a TTL of 21600 seconds (that's a default value). As the IMDSv2 is only used to retrieve details from the instance (availability zone, region, instance type...), you only need just a few seconds to get the information and then proceed to the benchmark, you shouldn't need to renew the token unless you are implementing a different use case.