AWS EC2 弹性 IP 带宽使用和费用 [英] AWS EC2 Elastic IPs bandwidth usage and charges

查看:202
本文介绍了AWS EC2 弹性 IP 带宽使用和费用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些关于弹性 IP 及其费用的问题.有些博客说弹性IP会按你使用的带宽收费

<块引用><块引用>

弹性 IP 地址按带宽收费并按小时收费当它们没有附加到正在运行的实例时

来自http://things.zarate.org/scaling-a-single-ec2-instance-and-downsizing

根据我阅读一些博客和文档后的理解,只有如果您在实例之间通信中使用弹性IP,您才会被收费> 如果您有弹性 IP 在您的帐户上处于闲置状态而没有关联到您的实例

<块引用><块引用>

如果您使用公共或弹性 IP 在实例之间进行通信地址即使在您支付区域数据传输的同一地区费率(每 GB 输入/输出 0.01 美元).

来自http://www.cloudiquity.com/2009/02/using-amazon-ec2-public-ip-address-inside-ec2-network/

查看 AWS 计算器截图 -> http://shareimage.org/images/lzjj3eull2ux0lo663fr.png

所以我的困惑在于 AWS 是否会对使用弹性 IP 的任何类型的流量请求(使用我的浏览器、SSH)收费?

因此,如果例如:我使用弹性 IP(例如 8.8.8.8)而不是像 ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws 这样给出的公共 dns 名称 ssh 连接到我的实例.com,此带宽将注册为简单带宽输入/输出使用还是公共/弹性 IP 带宽?

谢谢

解决方案

您应该将数据传输费用问题与 Elastic IP 地址费用问题分离,因为它们彼此完全独立:

弹性 IP 地址

分配和使用一个每个实例的弹性 IP 地址基本上是免费的,除非如果弹性 IP 地址当前未与实例关联,请参阅弹性 IP 地址部分 在页面 Amazon EC2 定价:

<块引用>
  • 一个与正在运行的实例关联的弹性 IP 地址 0.00 美元
  • 每小时按比例与正在运行的实例关联的每个额外弹性 IP 地址 0.005 美元
  • 每个与正在运行的实例无关的弹性 IP 地址每小时 0.005 美元,按比例计算
  • 每月前 100 次重新映射,每个弹性 IP 地址重新映射 0.00 美元
  • 每个弹性 IP 地址重新映射 0.10 美元,每月额外重新映射超过 100 次

    [强调我的]

在相应的常见问题解答中解释了这种方法背后的基本原理为什么我的弹性 IP地址与实例无关?:

<块引用>

为了帮助确保我们的客户有效地使用弹性 IP 地址,当每个地址未与正在运行的实例相关联时,我们会对每个地址收取少量的小时费用.

数据传输

同样,关键方面在亚马逊页面的数据传输部分中进行了解释EC2 定价(在一些常见问题中有详细说明):

您主要为互联网数据传输付费,即传入"和传出"Amazon EC2的数据,具体不包括以下内容:

<块引用>

Amazon EC2 和其他 Amazon 之间没有数据传输费用同一区域内的 Web 服务(即 Amazon EC2 美国西部和美国西部的 Amazon S3).在 Amazon EC2 之间传输的数据位于同一区域不同可用区的实例将收取区域数据传输费用.在 AWS 之间传输的数据不同地区的服务将作为互联网数据收费转让双方转让.

警告

需要注意的重要警告确实在该声明下方:

<块引用>

公共和弹性 IP 以及弹性负载平衡数据传输

  • 每 GB 输入/输出 0.01 美元 – 如果您选择使用您的公共或弹性 IP 地址或 Amazon 内部的弹性负载均衡器进行通信EC2 网络,您将支付区域数据传输费率,即使实例位于同一可用区中.用于内部数据传输相同的可用区,您可以轻松避免此费用(并获得更好的网络性能)随时使用您的私有 IP可能.

补救措施

上述段落中没有提到的是 AWS DNS 基础设施的一个重要且非常有用的功能,请参阅 公共 IP 地址和外部 DNS 主机名:

<块引用>

我们为每个具有公共 IP 地址的实例提供外部DNS 主机名.我们将外部 DNS 主机名解析为公共 IP实例网络外的实例地址,以及来自网络内的实例的私有 IP 地址实例.

也就是说,它将公共 DNS(例如 ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com)解析为私有 IP 地址当您在 Amazon EC2 网络内部使用它时,以及在 Amazon EC2 网络外部使用它时使用公共或弹性 IP 地址.像这样,您会自动获得免费的可用区数据传输和降低的区域数据传输费用,例如他们正在积极应用他们的建议,以在 Amazon EC2 实例之间进行通信时始终使用内部地址 [这] 确保您的网络流量遵循通过我们网络的最高带宽、最低成本和最低延迟路径.

如果您直接使用 IP 地址(即没有 DNS),这显然行不通,因此在 EC2 上下文中通常最好避免这种情况和其他原因.

I have a little questions regarding Elastic IPs and its charge. Some blogs says that Elastic IP will charge you by the bandwidth you use

Elastic IP addresses charge by bandwidth and have an hourly price when they are not attached to a running instance

From http://things.zarate.org/scaling-a-single-ec2-instance-and-downsizing

From my understanding after reading some blogs and the documentation, you will only be charged if you use the elastic IPs in communicating between instances and if you have elastic IPs standing there idle on your account without being associated to your instance

If you communicate between instances using public or elastic IP address even in the same region you pay regional data transfer rates(0.01$ per GB in/out).

From http://www.cloudiquity.com/2009/02/using-amazon-ec2-public-ip-address-inside-ec2-network/

See AWS calculator screenshot -> http://shareimage.org/images/lzjj3eull2ux0lo663fr.png

So my confusion is on the part whether AWS charge for any kinds of traffic requests (using my browser, SSH) using the elastic IPs?

So if for example: I ssh-ed to my instances using the elastic IPs (For example 8.8.8.8) instead of the public dns name given like ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com, will this bandwidth registered as simple bandwidth in/out usage or the public/elastic IP bandwidth?

Thanks

解决方案

You should decouple the data transfer charge question from the Elastic IP address charge one, insofar they are completely independent from each other:

Elastic IP addresses

Allocating and using one Elastic IP addresses per instance is basically free, except if the Elastic IP address is not currently associated with an instance, see section Elastic IP Addresses on page Amazon EC2 Pricing:

  • $0.00 for one Elastic IP address associated with a running instance
  • $0.005 per additional Elastic IP address associated with a running instance per hour on a pro rata basis
  • $0.005 per Elastic IP address not associated with a running instance per hour on a pro rata basis
  • $0.00 per Elastic IP address remap for the first 100 remaps per month
  • $0.10 per Elastic IP address remap for additional remaps over 100 per month

    [emphasis mine]

The rationale behind this approach is explained in the respective FAQ Why am I charged when my Elastic IP address is not associated with an instance?:

In order to help ensure our customers are efficiently using the Elastic IP addresses, we impose a small hourly charge for each address when it is not associated to a running instance.

Data Transfer

Again, the key aspect is explained in section Data Transfer on page Amazon EC2 Pricing (and detailed by some FAQs):

You primarily pay for Internet Data Transfer, i.e. data transferred "in" and "out" of Amazon EC2, which specifically excludes the following:

There is no Data Transfer charge between Amazon EC2 and other Amazon Web Services within the same region (i.e. between Amazon EC2 US West and Amazon S3 in US West). Data transferred between Amazon EC2 instances located in different Availability Zones in the same Region will be charged Regional Data Transfer. Data transferred between AWS services in different regions will be charged as Internet Data Transfer on both sides of the transfer.

Caveat

The important caveat to be aware of indeed follows below that statement though:

Public and Elastic IP and Elastic Load Balancing Data Transfer

  • $0.01 per GB in/out – If you choose to communicate using your Public or Elastic IP address or Elastic Load Balancer inside of the Amazon EC2 network, you’ll pay Regional Data Transfer rates even if the instances are in the same Availability Zone. For data transfer within the same Availability Zone, you can easily avoid this charge (and get better network performance) by using your private IP whenever possible.

Remedy

Not mentioned in the aforementioned paragraph is an important and quite helpful feature of the AWS DNS infrastructure though, see Public IP Addresses and External DNS Hostnames:

We provide each instance that has a public IP address with an external DNS hostname. We resolve an external DNS hostname to the public IP address of the instance outside the network of the instance, and to the private IP address of the instance from within the network of the instance.

That is, it's resolving the public DNS (e.g. ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com) to the Private IP address when you are using it inside the Amazon EC2 network, and to the Public or Elastic IP address when using it outside the Amazon EC2 network. Like so you get the free Availability Zone Data Transfer and reduced charge Regional Data Transfer automatically, e.g. they are actively applying their advise to Always use the internal address when you are communicating between Amazon EC2 instances [which] ensures that your network traffic follows the highest bandwidth, lowest cost, and lowest latency path through our network.

This obviously doesn't work, if you are using the IP addresses directly (i.e. without DNS), which is thus usually best avoided for this and other reasons in the context of EC2.

这篇关于AWS EC2 弹性 IP 带宽使用和费用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆