EC2 instances don’t just have a single network speed; they have a baseline and a burst capacity, and understanding the difference is key to avoiding unexpected performance bottlenecks.
Let’s see this in action with a common scenario: transferring a moderately large file to an S3 bucket from an EC2 instance.
# On your EC2 instance, ensure you have the AWS CLI installed and configured
# Replace 'your-bucket-name' and 'your-local-file.zip' with your actual details
aws s3 cp your-local-file.zip s3://your-bucket-name/
When you run this, you’re not just sending data; you’re engaging with the EC2 networking subsystem, which operates on a tiered speed model.
The Baseline: Your Guaranteed Throughput
Every EC2 instance type is provisioned with a guaranteed minimum network throughput, known as the "baseline bandwidth." This is the speed you can reliably expect for sustained network operations. Think of it as the steady flow rate from a faucet. For example, a t3.medium instance has a baseline bandwidth of 1 Gbps, while a m5.large has a baseline of 5 Gbps. This baseline is crucial for applications that require consistent network performance, like web servers serving many concurrent users or database replicas synchronizing data.
The Burst: Your Temporary Boost
Beyond the baseline, most instance types (especially the burstable ones like T-series and some M, C, and R series) also have a "burst bandwidth" capability. This is like a temporary turbocharger. When your instance’s network traffic exceeds its baseline, it can draw from this burst capacity, allowing for short periods of much higher throughput. This burst credit system is managed by Amazon EC2. For instance, a t3.medium has a baseline of 1 Gbps but can burst up to 5 Gbps. However, this burst capacity is not infinite and is governed by "network performance" credits.
How Burst Credits Work
EC2 instances accrue network performance credits when they are operating below their baseline network performance. When the instance’s network traffic exceeds its baseline, it consumes these accrued credits. If an instance runs out of burst credits, its network performance will be throttled down to its baseline. This is why you might experience great speeds initially, only to see them drop significantly after a while if your workload is consistently high. The rate at which credits are earned and spent depends on the instance type and its specific network performance configuration.
Understanding Your Instance’s Limits
You can find the baseline and burstable bandwidth for each EC2 instance type in the AWS documentation. For example, looking at the t3 instance family:
- t3.nano: Baseline 5 Gbps, Burst 5 Gbps
- t3.micro: Baseline 5 Gbps, Burst 5 Gbps
- t3.small: Baseline 5 Gbps, Burst 5 Gbps
- t3.medium: Baseline 1 Gbps, Burst 5 Gbps
- t3.large: Baseline 1 Gbps, Burst 5 Gbps
- t3.xlarge: Baseline 5 Gbps, Burst 5 Gbps
- t3.2xlarge: Baseline 5 Gbps, Burst 5 Gbps
Note: The actual numbers can vary slightly depending on the region and specific hardware generation. Always check the official documentation for the most up-to-date figures.
You can also monitor your instance’s network performance using Amazon CloudWatch. Key metrics to watch are NetworkIn and NetworkOut, which show the bytes transferred in and out, and NetworkPacketsIn and NetworkPacketsOut for packet counts. For burstable instances, you’ll also want to monitor CPUCreditBalance and CPUCreditUsage (though this is more for CPU, network credit behavior is analogous) to understand if you’re depleting your burst capacity.
When to Worry About Bursting
The burst mechanism is excellent for workloads with intermittent, high-bandwidth needs, such as development and testing environments, microservices, or applications that experience traffic spikes. However, if your application consistently requires network throughput above the baseline, you might be better off choosing an instance type with a higher baseline bandwidth. Continuously running at burst capacity without sufficient credits will lead to performance degradation, impacting user experience and application responsiveness.
Choosing the Right Instance Type
When selecting an EC2 instance, consider your application’s typical and peak network demands.
- Sustained High Throughput: If your application needs to consistently push large amounts of data, opt for instance families like
m5,c5,r5, ori3which offer higher dedicated baseline bandwidths. For example, anm5.xlargeoffers 5 Gbps baseline and 5 Gbps burst. - Intermittent High Throughput: If your application has periods of low network activity followed by short bursts of high activity, burstable instances like the
t3orm6g(with enhanced networking) can be cost-effective. At3.xlargeprovides a 5 Gbps baseline and can burst up to 5 Gbps. - Very High Throughput: For extreme network demands, consider instance families like
c5n,m5n,r5nwhich are specifically designed for high network performance and can reach up to 100 Gbps.
The "Hidden" Cost of Network Performance
The most common pitfall is assuming your network speed is constant. If you’re consistently hitting your burst limit without earning enough credits, you’ll experience throttled performance. This often manifests as slow file transfers, delayed API responses, or increased latency for end-users, and it’s frequently misdiagnosed as a general network issue or an application bug.
The next thing you’ll likely encounter is understanding how EBS volume performance interacts with your instance’s network throughput, as they can become competing resources for I/O.