Maximizing Amazon S3 transfer throughput to Amazon EC2 instances

4 minute read
Content level: Expert
0

Maximize the throughput of file transfers to or from Amazon EC2 to your Amazon EC2 instances.

Amazon S3 is an object storage service offering industry-leading scalability, data availability, security, and performance.

Amazon S3 is capable of transferring gigabytes per second to or from sources including Amazon EC2 instances. Achieving this level of performance requires ensuring your instance's configuration and transfer software are properly configured. This article discusses how to maximize transfer performance to get the most out of Amazon S3.

Factors to consider

There are four factors to consider when it comes to S3 transfer performance with Amazon EC2 instances:

  1. Instance network (ENI) bandwidth. Each EC2 instance type has a network bandwidth limit to which all data transfers are subject. The limit can range from "Low to Moderate" (under 5Gbps burst) to 200Gbps or more. Some instance types offer high sustained bandwidth, while other instance types offer burst bandwidth that is significantly higher than sustained bandwidth.
  2. Transfer flow rate limits. Regardless of instance bandwidth, each connection to Amazon S3 has a maximum transfer rate of 5Gbps. In order to achieve higher throughput, your application can use multiple simultaneous connections for transfers. Amazon S3 supports byte-range objects requests, so even a single large object can be transferred via multiple connections by splitting the request into multiple ranged subrequests. Examples of applications that support parallel transfers include the AWS CLI with the AWS Common Runtime (AWS CRT) enabled and third-party applications such as s5cmd.
  3. Requests from an S3 bucket in a different AWS Region than the EC2 instance. If the EC2 instance from which you're making the request is in a different AWS Region than your S3 bucket, and your EC2 instance has fewer than 32 vCPUs, there is a 5Gbps bandwidth limit, regardless of the number of simultaneous transfers. If your EC2 instance has more 32 vCPUs or more, there is an aggregate bandwidth limit of 50% of the instance network (ENI) bandwidth.
  4. EBS interface bandwidth. If you're downloading an object from S3 to an Amazon EBS volume attached to your EC2 instance, your transfer will be limited by the instance's available EBS bandwidth. The limit can range from about 2Gbps to 100Gbps or more. Some instance types offer high sustained bandwidth, while other instance types offer burst bandwidth that is significantly higher than sustained bandwidth.
  5. EBS volume bandwidth. If you're downloading an object from S3 to an Amazon EBS volume attached to your EC2 instance, your transfer will be limited by the volume's configured throughput limit. These limits can be up to 4,000MiB's on io2 Block Express volumes. You can create a RAID 0 stripe of multiple EBS volumes using your operating system's software, but you cannot exceed the transfer rate ceiling imposed by the instance's EBS interface bandwidth.

The maximum transfer rate you can achieve is subject to the smallest of the bottlenecks listed above. For example, if you have an EC2 instance with 5Gbps of maximum ENI bandwidth, the most you will be able to transfer to/from Amazon S3 is 5Gbps (about 625 MiB/s). Similarly, if you have an EC2 instance with 100Gbps of maximum ENI bandwidth but are downloading an object to an EBS volume configured with 250MiB/second of throughput, the most you will be able to transfer is 250MiB/s.

Maximizing Throughput

To maximize Amazon S3 performance to/from Amazon EC2 instances, we recommend the following:

  1. Ensure the S3 bucket is in the same AWS Region as the EC2 instance to/from which the data will be transferred.
  2. Ensure the EC2 instance used for transfer has a baseline (not burst) maximum network throughput limit that meets your requirements.
  3. If transferring to/from an Amazon EBS volume, ensure both the instance's maximum EBS volume bandwidth meets your requirements and the configured volume transfer rate (or sum of each volume's configured transfer rate, if using RAID 0 striping) meets your requirements.
  4. Ensure the transfer application is capable of performing parallel requests across multiple connections, and uses multiple byte-range requests for large file transfers.
AWS
EXPERT
published a month ago2170 views