Home icon

Best Practices for TCP Connection Management on EC2

Networking & Content Delivery Blog



This article provides best practices for managing TCP connections on EC2, particularly for Nitro V6 instances which changed the default idle timeout from 5 days to 350 seconds.

  • Nitro V6 reduces default TCP idle timeout to 350 seconds to prevent conntrack exhaustion
  • Idle connections accumulating can exhaust conntrack allowance, causing connection failures
  • Configure explicit ENI timeouts via AWS CLI, Launch Templates, or CloudFormation
  • Implement TCP keepalives at kernel or application level to prevent timeout drops
  • Set keepalive probes to start at 240 seconds or less for 350-second timeout
  • Close idle connections explicitly rather than relying on infrastructure timeouts
  • Align timeout values across application, ENI, load balancer, and NAT gateway layers
  • Test workloads on Nitro V6 before production migration with realistic idle periods
  • Monitor conntrack metrics via ethtool and CloudWatch for capacity and exceeded events

Resilient applications implement TCP keepalives, configure explicit timeouts, close idle connections cleanly, and monitor conntrack usage across all infrastructure layers.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Jun 10
2026
Best practices for securing your IPv6 infrastructure on AWS using VPC Block Public Access
Nov 10
2025
Use Amazon VPC Lattice to streamline and secure TCP resource connectivity across multiple AWS Accounts
Aug 18
2025
Best practices for resilience and availability on Amazon ECS
Aug 21
2025
Best Practices to Optimize Failover Times for Overlay Tunnels on AWS Direct Connect

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.