Git Product home page Git Product logo

s3-benchmark's Introduction

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 Type Max S3 Throughput MB/s
c5n.18xlarge 8,003
p3dn.24xlarge 6,269
c5n.9xlarge 5,741
c5n.2xlarge 2,861
c5n.4xlarge 2,851
r5.metal 2,718
z1d.12xlarge 2,718
r5d.24xlarge 2,718
i3.metal 2,716
r5.24xlarge 2,714
m5d.24xlarge 2,714
r4.16xlarge 2,714
h1.16xlarge 2,713
m5.metal 2,713
x1.32xlarge 2,711
c5d.18xlarge 2,710
c5.18xlarge 2,710
p3.16xlarge 2,710
x1e.32xlarge 2,709
m5.24xlarge 2,709
z1d.metal 2,708
i3.16xlarge 2,707
f1.16xlarge 2,706
m4.16xlarge 2,705
g3.16xlarge 2,705
p2.16xlarge 2,702
m5d.metal 2,673
m5a.24xlarge 1,801
m5ad.24xlarge 1,706
r5ad.24xlarge 1,699
r5a.24xlarge 1,562
c5n.xlarge 1,543
x1.16xlarge 1,410
p2.8xlarge 1,409
g3.8xlarge 1,400
x1e.16xlarge 1,400
r4.8xlarge 1,400
i3.8xlarge 1,400
p3.8xlarge 1,400
h1.8xlarge 1,399
c5.9xlarge 1,387
r5.12xlarge 1,387
z1d.6xlarge 1,387
m5.12xlarge 1,387
m5d.12xlarge 1,387
c5d.9xlarge 1,387
r5d.12xlarge 1,386
g3.4xlarge 1,163
r4.4xlarge 1,163
f1.4xlarge 1,163
i3.4xlarge 1,162
x1e.8xlarge 1,162
h1.4xlarge 1,161
h1.2xlarge 1,161
x1e.4xlarge 1,160
m5.4xlarge 1,157
r5a.4xlarge 1,156
r5.4xlarge 1,156
r5d.4xlarge 1,156
m5a.12xlarge 1,156
m5d.4xlarge 1,156
m5ad.4xlarge 1,156
c5d.4xlarge 1,156
r5ad.12xlarge 1,156
c5.4xlarge 1,156
m5ad.12xlarge 1,156
r5a.12xlarge 1,156
m5a.4xlarge 1,155
r5ad.4xlarge 1,155
z1d.3xlarge 1,155
a1.4xlarge 1,153
i3.2xlarge 1,143
p3.2xlarge 1,142
x1e.2xlarge 1,138
f1.2xlarge 1,137
r5ad.2xlarge 1,136
m5d.2xlarge 1,136
r4.2xlarge 1,135
r5d.2xlarge 1,134
m5.2xlarge 1,133
z1d.2xlarge 1,132
m5ad.xlarge 1,132
c5d.2xlarge 1,132
m5a.2xlarge 1,132
m5ad.2xlarge 1,131
r5a.2xlarge 1,131
c5.2xlarge 1,131
r5ad.xlarge 1,130
r5.2xlarge 1,129
r4.xlarge 1,127
m5a.xlarge 1,125
g3s.xlarge 1,124
r5a.xlarge 1,123
i3.xlarge 1,119
z1d.xlarge 1,116
m5.xlarge 1,114
c5.xlarge 1,114
m5d.xlarge 1,114
r5.xlarge 1,114
r5d.xlarge 1,113
c5d.xlarge 1,113
i2.8xlarge 1,092
d2.8xlarge 1,066
c4.8xlarge 1,066
m4.10xlarge 1,066
z1d.large 1,002
x1e.xlarge 980
c5.large 949
a1.2xlarge 944
c5d.large 942
r5d.large 936
m5d.large 891
m5.large 873
c5n.large 851
r5.large 846
r5ad.large 783
m5ad.large 762
r5a.large 740
a1.xlarge 737
m5a.large 726
i3.large 624
t3.2xlarge 569
t3.xlarge 568
t3.medium 558
t3.large 553
d2.4xlarge 544
c4.4xlarge 544
r4.large 541
a1.large 514
t3.small 395
t3.micro 349
t3.nano 319
c4.2xlarge 272
d2.2xlarge 272
m4.4xlarge 246
i2.4xlarge 244
g2.8xlarge 237
a1.medium 169
p2.xlarge 154
t2.nano 118
m4.2xlarge 118
i2.2xlarge 118
g2.2xlarge 118
t2.2xlarge 116
t2.xlarge 113
t2.large 109
t2.medium 108
c4.xlarge 102
d2.xlarge 102
m4.xlarge 87
i2.xlarge 80
c4.large 71
m4.large 53
t2.micro 46
t2.small 39

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.

s3-benchmark's People

Contributors

darpandodiya avatar dvassallo avatar iwat avatar jkroepke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

s3-benchmark's Issues

Python

Do you think that you could replicate this tool using Python?

Insecure Endpoints

There doesn't appear to be a flag/option to test against insecure (self-signed or otherwise untrusted) endpoints. Am I simply missing something? I'll offer a preemptive mea culpa here...I've inherited a lab in a crappy state and I'm trying to get that straightened out, including valid certs. from an internal CA for everything. In the meantime I've got a need to do some S3 benchmarking/testing.

S3 Download from Internet

An interesting benchmark and if I understand it correctly it measures latencies and throughput when being accessed from S3 instances. I think it would be interesting to see how it behaves when accessed from outside Amazon network, e.g. downloading object with browser.

Support (KMS) SSE

It would be fascinating to see how S3's SSE (both KMS and the old-fashioned flavor) affect throughput and latencies. Might require some finagling to figure out how/if per-object data keys are getting cached somewhere in S3 after getting KMS to decrypt the data key.

Misleading name/description of payload parameter

It says:

The minimum object size to test, with 1 = 1 KB

I had to look through the code to understand that "payload" is a power of 2 which is then multiplied by 1KB. So, in short:

# assuming payload is > 0
multiplier = 2 ^ (payload - 1)
object_min_size = 1KB * multiplier

So, you see, you have to pass -payload-min=16 to get 32 MB object, and -payload-min=17 to get 64 MB object while the parameter clearly says it is an object size. Why is it encoded in such a weird way then?

Same applies to payload-max. I suggest either renaming this parameter to something better corresponding to the actual meaning, or - even better - allow user to define object min and max size like:
-payload-min=1000 - meaning 1 MB

Analysis

Howdy,

Great tool, thanks so much. I'm also interested in how you built the Analysis XLS. Would you be able to share that?

Question: Did the EBS volume matter?

There isn't any mentioning of EBS in this benchmark. Given that a gp2 volume is limited to 250 MB/s, the bottleneck on a CPU that supports 10-gigabit network is more likely to be the hard-drive I/O.

@dvassallo Do you have information about the EBS volume types you've used? Is hard drive I/O not a factor?

Unable to benchmark custom s3 endpoint from openstack vm

Hi,

Environment setup:
testvm => 2x harpoxy-s3 => 3x ceph radosgw

Rados gw runs on dedicated hardware while testvm and haproxy-s3 runs on openstack. This setup works good since i was able to use rclone to POST/GET objects on this custom s3. Note that radosgw are completly standalone and not integrated with openstack keystone at all.

Problem definition:
As a second step i wanted to run s3-benchmark just to check overall long term performance.

This is how my credentials are set:

[fedora@brtest ~]$ cat ~/.aws/credentials 
[brtest]
aws_access_key_id = xxx
aws_secret_access_key = xxxx

I get something like that:

[fedora@brtest ~]$ ./s3-benchmark --endpoint s3.ourdomain.io --region custom-signing-region --bucket-name benchmark

--- SETUP --------------------------------------------------------------------------------------------------------------------

panic: Filed to create S3 bucket: EC2RoleRequestError: no EC2 instance role found
caused by: EC2MetadataError: failed to make EC2Metadata request
caused by: 404 Not Found

The resource could not be found.

   

goroutine 1 [running]:
main.setup()
	/Users/daniel/go/src/github.com/dvassallo/s3-benchmark/main.go:229 +0xa35
main.main()
	/Users/daniel/go/src/github.com/dvassallo/s3-benchmark/main.go:113 +0x44

I believe the issue is caused by fact that aws-go-sdk recognizes our openstack api as a valid aws api and tries to obtain s3 credentials this way.

fedora@brtest ~]$ curl http://169.254.169.254/latest/meta-data/
ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
hostname
instance-action
instance-id
instance-type
local-hostname
local-ipv4
placement/
public-hostname
public-ipv4
public-keys/
reservation-id

Would it possible to force s3-benchmark to skip aws autodetection ??

Regards,
Bart

InvalidLocationConstraint: The specified location-constraint is not valid

Trying to run the benchmark tool from an EC2 instance on an existing bucket:

[ec2-user@ip-172-31-2-167 ~]$ ./s3-benchmark    -bucket-name dhavivresearch -full -region us-east-1

--- SETUP --------------------------------------------------------------------------------------------------------------------

panic: Filed to create S3 bucket: InvalidLocationConstraint: The specified location-constraint is not valid
        status code: 400, request id: 41997BE73BC03A06, host id: ZNEaOvY5TyFs0PR3xh73aUAPVg6y18y9iV/bzJH4TJYiQ8/sKPk+wIqReWkRtpH3/wV+oV53Sns=

goroutine 1 [running]:
main.setup()
        /Users/daniel/go/src/github.com/dvassallo/s3-benchmark/main.go:229 +0xa35
main.main()
        /Users/daniel/go/src/github.com/dvassallo/s3-benchmark/main.go:113 +0x44

Is parameter samples ignored?

It looks like -samples 1000000 or, eg. -samples 100 makes no difference. Shouldn't 1000000 samples take longer than 100?

Handling AWS profiles

Hello, it would be nice to have a --profile option to indicate which credentials to use in .aws/credentials

S3 Upload benchmarks

Hi,
Very nice project. Thanks for open sourcing it.
Please consider adding S3 upload benchmarks as well.

Report upload performance

Thanks for building this! It would be great if there was an option to report upload performance instead of download with everything the same otherwise.

Build fails on progressbar

Hi @dvassallo,

Great utility!

I'm attempting to run dep ensure but the process fails. Any guidance is appreciated!

...
	v0.2.0: Could not introduce github.com/schollz/[email protected], as its subpackage github.com/schollz/progressbar/v2 is missing. (Package is required by (root).)
	v0.1.0: Could not introduce github.com/schollz/[email protected], as its subpackage github.com/schollz/progressbar/v2 is missing. (Package is required by (root).)
	master: Could not introduce github.com/schollz/progressbar@master, as its subpackage github.com/schollz/progressbar/v2 is missing. (Package is required by (root).)
	finish: Could not introduce github.com/schollz/progressbar@finish, as its subpackage github.com/schollz/progressbar/v2 is missing. (Package is required by (root).)
	time: Could not introduce github.com/schollz/progressbar@time, as its subpackage github.com/schollz/progressbar/v2 is missing. (Package is required by (root).)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.