大网数据广告活动
服务器运维问答

NAT gateway high availability - AWS

· 52CE 我爱测

Would you configure a NAT gateway on every AZ for HA? Is that an overkill? It costs more than $500 a year of continuous running. It does make sense for a business critical system. You could create 2 NAT gateways on 2 AZs and have…

问题原文

原帖链接 · sethu · CC BY-SA 3.0

Would you configure a NAT gateway on every AZ for HA? Is that an overkill? It costs more than $500 a year of continuous running. It does make sense for a business critical system. You could create 2 NAT gateways on 2 AZs and have the third one use one or the other to reduce some $.

My other question was, if one AZ fails, how do you automatically cut over to the NAT gateway on another AZ? As far as I can see it, you need to update the Route tables to point to the other NAT gateway manually. Do people set up a periodic ping to the NAT instance and then implement an update to the route table if it fails? If that's the case, assuming there will be a small outage anyway, why not create a new NAT gateway on another AZ when the old one fails and then update the route table? You will save $500 and achieve the same thing.

社区高分解答

原帖链接 · Tim · CC BY-SA 3.0

How many you need depends your RTO and RPO. Also, for reference, NAT instance and NAT Gateway (comparison).

A NAT gateway is around $400/year depending on your region. It's highly available so you don't need redundancy in an AZ, and you can share them between your AZs. However if you want really high availability you can create one per AZ. Depending on your RPO/RTO you're probably best to start with one and create others if uptime is below what you want. They've very high bandwidth, up to 10Gbps.

Note that you pay for bandwidth between AZs. The EC2 pricing page covers this. EC2 to EC2 traffic (ie to a NAT instance) is definitely charged. It's not clear if traffic from EC2 to a NAT Gateway is charged, but it's probably safe to assume it is.

For comparison, a t2.micro with a one year all upfront reservation is $70, you can run your own NAT instance(s). Three of them is still cheaper than the managed gateway. However bandwidth is limited, and if you have a lot of instances doing a lot of network access they will quickly become a bottleneck. You can of course scale up the t2 family as required - each jump tends to approximately double CPU and network performance.

If you really want to roll your own there's an AWS pattern here.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-04-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。