Home

Awesome

S3 Benchmark

Your Amazon S3 performance depends on 3 things:

  1. Your distance to the S3 endpoint.
  2. The size of your objects.
  3. The number of parallel transfers you can make.

With this tool you can measure S3's performance from any location, using different thread counts and object sizes. Here's an example from a c5.4xlarge EC2 instance:

Benchmark results from a c5.4xlarge EC2 instance

Usage

Download

macOS

curl -OL https://github.com/dvassallo/s3-benchmark/raw/master/build/darwin-amd64/s3-benchmark

Linux 64-bit x86

curl -OL https://github.com/dvassallo/s3-benchmark/raw/master/build/linux-amd64/s3-benchmark

Linux 64-bit ARM

curl -OL https://github.com/dvassallo/s3-benchmark/raw/master/build/linux-arm64/s3-benchmark

Credentials

This tool needs AWS credentials with full S3 permissions. If you run this on EC2, it will automatically use your EC2 instance profile. Otherwise it will try to find the credentials from the usual places.

Run

Make the file executable:

chmod +x s3-benchmark

Run a quick test (takes a few minutes):

./s3-benchmark

Or run the full test (takes a few hours):

./s3-benchmark -full

See this for all the other options.

Build

  1. Install Go

    sudo apt-get install golang-go
    

    or

    sudo yum install go
    

    may work too.

  2. Setup Go environment variables (Usually GOPATH and GOBIN) and test Go installation

  3. Clone the repo

  4. Install dep

    go get -u github.com/golang/dep/cmd/dep
    
  5. Go to source directory and run dep ensure

  6. Run go run main.go

S3 to EC2 Bandwidth

I ran this benchmark on all current generation EC2 instance types as of 2019-04-02. I put the data in an interactive spreadsheet that you can download here. Feel free to share it with your friends and colleagues.

Analysis

Here's the maximum download throughput I got from all 155 instance types:

EC2 Instance TypeMax S3 Throughput MB/s
c5n.18xlarge8,003
p3dn.24xlarge6,269
c5n.9xlarge5,741
c5n.2xlarge2,861
c5n.4xlarge2,851
r5.metal2,718
z1d.12xlarge2,718
r5d.24xlarge2,718
i3.metal2,716
r5.24xlarge2,714
m5d.24xlarge2,714
r4.16xlarge2,714
h1.16xlarge2,713
m5.metal2,713
x1.32xlarge2,711
c5d.18xlarge2,710
c5.18xlarge2,710
p3.16xlarge2,710
x1e.32xlarge2,709
m5.24xlarge2,709
z1d.metal2,708
i3.16xlarge2,707
f1.16xlarge2,706
m4.16xlarge2,705
g3.16xlarge2,705
p2.16xlarge2,702
m5d.metal2,673
m5a.24xlarge1,801
m5ad.24xlarge1,706
r5ad.24xlarge1,699
r5a.24xlarge1,562
c5n.xlarge1,543
x1.16xlarge1,410
p2.8xlarge1,409
g3.8xlarge1,400
x1e.16xlarge1,400
r4.8xlarge1,400
i3.8xlarge1,400
p3.8xlarge1,400
h1.8xlarge1,399
c5.9xlarge1,387
r5.12xlarge1,387
z1d.6xlarge1,387
m5.12xlarge1,387
m5d.12xlarge1,387
c5d.9xlarge1,387
r5d.12xlarge1,386
g3.4xlarge1,163
r4.4xlarge1,163
f1.4xlarge1,163
i3.4xlarge1,162
x1e.8xlarge1,162
h1.4xlarge1,161
h1.2xlarge1,161
x1e.4xlarge1,160
m5.4xlarge1,157
r5a.4xlarge1,156
r5.4xlarge1,156
r5d.4xlarge1,156
m5a.12xlarge1,156
m5d.4xlarge1,156
m5ad.4xlarge1,156
c5d.4xlarge1,156
r5ad.12xlarge1,156
c5.4xlarge1,156
m5ad.12xlarge1,156
r5a.12xlarge1,156
m5a.4xlarge1,155
r5ad.4xlarge1,155
z1d.3xlarge1,155
a1.4xlarge1,153
i3.2xlarge1,143
p3.2xlarge1,142
x1e.2xlarge1,138
f1.2xlarge1,137
r5ad.2xlarge1,136
m5d.2xlarge1,136
r4.2xlarge1,135
r5d.2xlarge1,134
m5.2xlarge1,133
z1d.2xlarge1,132
m5ad.xlarge1,132
c5d.2xlarge1,132
m5a.2xlarge1,132
m5ad.2xlarge1,131
r5a.2xlarge1,131
c5.2xlarge1,131
r5ad.xlarge1,130
r5.2xlarge1,129
r4.xlarge1,127
m5a.xlarge1,125
g3s.xlarge1,124
r5a.xlarge1,123
i3.xlarge1,119
z1d.xlarge1,116
m5.xlarge1,114
c5.xlarge1,114
m5d.xlarge1,114
r5.xlarge1,114
r5d.xlarge1,113
c5d.xlarge1,113
i2.8xlarge1,092
d2.8xlarge1,066
c4.8xlarge1,066
m4.10xlarge1,066
z1d.large1,002
x1e.xlarge980
c5.large949
a1.2xlarge944
c5d.large942
r5d.large936
m5d.large891
m5.large873
c5n.large851
r5.large846
r5ad.large783
m5ad.large762
r5a.large740
a1.xlarge737
m5a.large726
i3.large624
t3.2xlarge569
t3.xlarge568
t3.medium558
t3.large553
d2.4xlarge544
c4.4xlarge544
r4.large541
a1.large514
t3.small395
t3.micro349
t3.nano319
c4.2xlarge272
d2.2xlarge272
m4.4xlarge246
i2.4xlarge244
g2.8xlarge237
a1.medium169
p2.xlarge154
t2.nano118
m4.2xlarge118
i2.2xlarge118
g2.2xlarge118
t2.2xlarge116
t2.xlarge113
t2.large109
t2.medium108
c4.xlarge102
d2.xlarge102
m4.xlarge87
i2.xlarge80
c4.large71
m4.large53
t2.micro46
t2.small39

Here's the performance of all instances with 32 MB objects (the legend is truncated, but all instances are plotted):

S3 Throughput from All Instance Types

And here's the same chart with just the 3 outlier instances that have 50 Gigabit or more network bandwidth:

S3 Throughput from Outlier Instance Types

Here's a typical throughput profile showing how object size affects performance:

S3 Throughput by Object Size

S3's 90th percentile time to first byte is typically around 20 ms regardless of the object size. However, small instances start to see elevated latencies with increased parallelization due to their limited resources. Here's the p90 first byte latency on a small instance:

Time to First Byte Latency Small Instance

And here's the p90 first byte latency on a larger instance:

Time to First Byte Latency Large Instance

Unlike the first byte latency, the time to last byte obviously follows the object size. S3 seems to deliver downloads at a rate of about 93 MB/s per thread, so this latency is a function of that and the first byte latency — at least until the network bandwidth gets saturated. Here's one example:

Time to Last Byte Latency

If you want to analyze the data further, you can download the spreadsheet with all the raw data and the interactive features shown in the screenshots. Here's a 45 second demo of what you can do with it.

License

This project is released under the MIT License.