正在启动 S3 虫洞
Launching S3 Wormhole

原始链接: https://www.daemonology.net/blog/2026-12-02-Launching-S3-Wormhole.html

Colin Percival 介绍了 S3 Wormhole:一种非官方的私有预览网络技巧,用于降低 AWS 跨可用区数据传输成本。AWS 可用区为了实现韧性而相互隔离,Well-Architected Framework 建议采用多可用区部署,但可用区之间的流量在每个方向上收费 0.01 美元/GB,导致一些客户避免使用多可用区设计。S3 Wormhole 将流量从 EC2 实例路由到源可用区中的 S3 端点,然后从目标可用区中的端点取回流量,并将其重新注入 EC2 网络。由于同一区域内 EC2 到 S3 的传输是免费的,因此可避免直接跨可用区收费。Percival 报告称,TCP 吞吐量为 10 Gbps,UDP 吞吐量为 41.2 Gbps;基准测试显示,其成本比直接跨可用区传输低 93%。主要注意事项包括 EC2 端点成本、S3 请求费用、需要网关 VPC 端点、增加的延迟/抖动、数据包聚合的取舍、TCP 调优、安全组限制,以及对跨区域流量没有收益。常见问题确认,它不是 AWS 官方服务,也不符合 HIPAA 合规要求。

一条 Hacker News 帖子讨论了“启动 S3 虫洞”这一巧妙技巧:它利用同一 AWS 区域内 S3 到 EC2 的免费流量,来规避昂贵的跨可用区数据传输和 NAT 网关费用。评论者称它有点“邪门”,但称赞其巧思,同时也指出这凸显了 AWS 定价的荒谬:S3 复制涉及校验和、元数据、持久写入/删除以及跨可用区流量,但仍可能比普通的跨可用区传输更便宜。有人质疑它是否违反 AWS 条款,但多数人认为并不违反,除了可能存在命名方面的顾虑。一位评论者建议用折扣低优先级流量作为更好的解决方案,另一位则提议使用带有广播写入和压缩功能的 S3 编排工具来降低传输成本。
相关文章

原文
I'm excited to announce S3 Wormhole, a new networking technology which allows customers to dramatically reduce their cross-AZ data transfer costs.

At AWS, resilience starts with the infrastructure. Every AWS Region is made up of multiple Availability Zones, and each Availability Zone consists of one or more discrete data centers with independent and redundant power, networking, and connectivity. Availability Zones are separated from each other by a meaningful physical distance — many kilometers, though all within 100 km (60 miles) — so that a fire, flood, or tornado affecting one Availability Zone does not affect the others. Each Availability Zone has its own dedicated connections to utility power and its own standalone backup power; common points of failure such as generators and cooling equipment are never shared, and Availability Zones are designed to be supplied by independent power substations.

To help customers take advantage of this infrastructure, AWS created the Well-Architected Framework, which captures decades of experience building and operating workloads in the cloud and organizes it into six pillars: operational excellence, security, reliability, performance efficiency, cost optimization, and sustainability. Customers who follow its best practices build systems that are more secure, more reliable, and more efficient.

One of the most important recommendations in the Reliability pillar is to deploy workloads to multiple locations. Because Availability Zones are independent, an application whose compute is distributed across multiple Availability Zones can keep running even if an entire Availability Zone becomes impaired.

However, data transferred between Availability Zones in the same Region is charged at $0.01/GB in each direction — $0.01/GB as it leaves one Availability Zone and another $0.01/GB as it enters the other. For applications which move large volumes of data — database replication, distributed caches, streaming pipelines, service meshes — these charges add up quickly. And in conversations with customers, I've found that the fear of cross-AZ data transfer charges is often more powerful than the charges themselves: many customers deploy their applications into a single Availability Zone, not because they have measured what a multi-AZ deployment would cost, but because they are worried about what it might cost. As one customer told me, "I know how much bandwidth it takes to download a 1 MB web page. But I have no idea how much bandwidth 50 SQL queries add up to."

Until now, you had to choose between the Reliability pillar and the Cost Optimization pillar. S3 Wormhole eliminates that tradeoff: with S3 Wormhole, you can build applications which span multiple Availability Zones, exactly as the Well-Architected Framework recommends, without worrying about cross-AZ data transfer costs.

How S3 Wormhole works

Under the hood, S3 Wormhole uses one of Amazon's basic building blocks, Amazon S3. Traffic from your application is routed into an S3 Wormhole endpoint in the same Availability Zone, which writes it to S3; an S3 Wormhole endpoint in the destination Availability Zone retrieves it and injects it back into the EC2 network. Since data transfer between Amazon EC2 and Amazon S3 in the same Region is free, your data reaches the other Availability Zone without incurring cross-AZ data transfer charges.

The following diagram shows the S3 Wormhole architecture.

S3 Wormhole architecture

Performance S3 Wormhole is designed for high-throughput workloads. To measure its performance, I launched a pair of Graviton4-based c8gn.8xlarge instances as the two ends of a wormhole and two more instances as workload generators. Using iperf3, I measured 10 Gbps of TCP throughput across 128 parallel streams:

$ iperf3 -c 10.77.18.10 -P 128 -t 180 -i 1 | tail -4 | head -2
[SUM]   0.00-180.00 sec   213 GBytes  10.2 Gbits/sec  29905             sender
[SUM]   0.00-180.59 sec   211 GBytes  10.0 Gbits/sec                  receiver

I've also measured 41.2 Gbps of UDP throughput; UDP is easier than TCP since it doesn't have congestion control.

Things to know

Let me share some important technical details that I think you'll find useful.

  • S3 Wormhole endpoints must reach S3 through a gateway VPC endpoint. If your traffic goes through a NAT gateway instead, its $0.045/GB data processing charge makes S3 Wormhole more expensive than the cross-AZ data transfer it replaces.
  • S3 Wormhole endpoints are EC2 instances, and thus have a base cost depending on the instance size, regardless of whether they are busy or idle. You'll want to estimate your traffic and pick an appropriate size; for any size of instance, the amount of bandwidth supported is 10-60 times higher than the break-even point, assuming standard on-demand instance and data transfer pricing.
  • Traffic is carried through S3 in objects of up to 16 MiB by default. The efficiency of S3 Wormhole depends on being able to fit many packets into objects; below about 270 kB per object, S3 request charges alone exceed cross-AZ data transfer charges. With the default timing (aggregation waits no more than 25 ms) this translates to 86.4 Mbps of throughput; the aggregation wait is configurable but there is a tradeoff between cost reduction and added latency.
  • Wormholes inherently have high latency and jitter. As such, TCP congestion control algorithms which perform well on satellite links are essential for obtaining good performance; TCP BBR can often deliver over 10x the throughput of TCP CUBIC. Depending on your operating system, you may also need to tune network buffers to obtain maximal performance.
  • S3 Wormhole delivers traffic through an intermediate network path, so security group rules which reference another security group do not match traffic carried through S3 Wormhole. Consistent with other middlebox deployments in Amazon VPC, the security groups for the instances at both ends must allow the traffic using the private IP address of the other instance, or the CIDR range of the subnet containing it, as the source; a rule which references the other instance's security group will not allow the traffic.
  • S3 Wormhole connects Availability Zones within a single Region. Reading from a bucket in another Region incurs inter-Region data transfer charges, so a cross-Region wormhole would save nothing.
Pricing and availability

You pay for the infrastructure used by S3 Wormhole inside your AWS account — Amazon EC2 instances for the S3 Wormhole endpoints, and Amazon S3 requests — but the S3 Wormhole service itself is free. Data in transit is stored in S3 Standard only briefly and is deleted once it has been delivered, so storage charges are negligible.

In the benchmark example above, transferring 10 Gbps between Availability Zones directly would incur cross-AZ data transfer charges of $90 per hour. Using S3 Wormhole, the same traffic costs 93% less:

ResourceCost per hour
S3 PUT requests (109 per second)$1.973
S3 GET requests (107 per second)$0.155
2 × c8gn.8xlarge On-Demand$3.792
Total$5.92

S3 Wormhole is available today in private preview. If you're interested in reducing your cross-AZ data transfer costs, email [email protected].

— cperciva

Colin Percival

Colin Percival

Colin has been using AWS for over 20 years and is the founder of the Tarsnap online backup service. He was named an AWS Hero in 2019 and works tirelessly to point out bugs and design flaws in AWS services, and to poke large bears very carefully. If you want to sell him something, be sure that it is secure.

Frequently Asked Questions

Q. Is this an official AWS service?
A. Of course not.

Q. Why didn't this launch on April 1st?
A. Because important new AWS infrastructure traditionally launches in the week of Cyber Monday.

Q. Is this HIPAA compliant?
A. No. Doctors routinely use fax machines, but never carrier pigeons.

Q. Did anyone at Amazon know you were doing this?
A. Absolutely not. If they knew, they would have had to try to stop me. Amazonians aren't just people I work with; they're my friends, and I don't want anyone to get in trouble for me being irredeemably weird.

blog comments powered by
联系我们 contact @ memedata.com