×
Community Blog Friday Blog - Week 30 - Understanding Network Traffic Costs - Part 2

Friday Blog - Week 30 - Understanding Network Traffic Costs - Part 2

Join us this week as we dive deeper into network pricing for EIPs, ECS public IPs, OSS, and the wonders of the Data Transfer Plan.

Jeremy Pedersen

Understanding Network Traffic Costs: Part 2

Welcome back! Wow...we've now been posting a weekly blog 30 weeks in a row! I can't believe we've come this far. From myself and the rest of the Alibaba Cloud training team: thanks for sticking with us!

Ok, let's get on with it!

Like many public cloud providers, traffic into Alibaba Cloud (ingress traffic) is typically free, but traffic out (egress traffic) is not.

Let's dive into how egress traffic pricing works and look at some ways to reduce costs.

Last week, we talked about traffic costs for Classic Load Balancers (CLBs). This week, we'll be talking about:

  1. Elastic IPs (EIPs)
  2. ECS public IPs
  3. Object Storage Service (OSS)

NAT Gateways and Application Load Balancers (ALB) both bind to the Elastic IP (EIP) service, so the EIP section of today's post covers them as well.

Finally, we'll talk about bandwidth sharing plans, which reduce egress traffic costs significantly for both EIPs and other outbound traffic, so skip ahead to the end of the post if you're interested in that.

To keep things simple, I'm looking only at traffic costs here, not other fees associated with each service. Oh, and all examples will use pricing for the Singapore Region, since prices vary by region.

Elastic IP (EIP) Traffic Costs

Elastic IP supports two billing options:

  1. Pay-As-You-Go (actually, there are "sub-modes" here, more on that later):
  2. Subscription

Further, there are two types of EIP addresses available:

  1. BGP (multi-ISP)
  2. BGP Pro (also multi-ISP)

We'll focus on BGP rather than BGP Pro, since BGP Pro is supported only in Hong Kong.

Subscription

Subscription Elastic IPs use a 'pay-by-bandwidth' billing mode: you set in advance the maximum bandwidth (in Mbps) that your EIP can handle. Any traffic under that threshold is covered by your subscription. Subscriptions are charged on a monthly basis.

Further, bandwidth charges vary based on where your EIP is located. In many cases, a group of different Alibaba Cloud Regions will all be charged at the same rate. For instance, EIP's "China" region includes all Mainland China regions plus Hong Kong, meaning EIPs in any of those regions will charge the same rate for egress traffic.

Let's continue our tradition from last week's blog, and focus on prices in Singapore. This means (for the purposes of EIP billing) that we'll be using the prices for the Asia Pacific EIP region.

Prices would then come out to:

  1. 3.40 USD/month for 1 Mbps
  2. 6.80 USD/month for 2 Mbps
  3. 10.20 USD/month for 3 Mbps
  4. 13.60 USD/month for 4 Mbps
  5. 17.00 USD/month for 5 Mbps

What if we need 6 or more Mbps per month? The price is then calculated by this magical little formula:

17.00 + (n-5) x 11.83

Where n represents our total bandwidth.

So, if we needed 10 Mbps worth of bandwidth, the resulting cost per month would be:

17.00 + (10-5) x 11.83 = 76.15 USD / month

Ok, easy enough! Let's now turn our attention to Pay-As-You-Go pricing.

Pay-As-You-Go

Pay-As-You-Go pricing has two different modes:

  1. Pay-by-data-transfer
  2. Pay-by-bandwidth

Let's look at each in turn.

Pay-By-Data-Transfer

There are two charges here:

  1. The "Configuration fee" (the cost to reserve the public IP address, even if there is no traffic)
  2. The "Data transfer fee" (total data transferred, in GB)

Rates are charged hourly. In Singapore, reserving an Elastic IP will cost you 0.006 USD/hour. Bandwidth costs for Singapore are 0.081 USD/GB.

Pay-By-Bandwidth

Pay-by-bandwidth is a compromise between monthly Subscription billing and traffic-based Pay-As-You-Go. You don't have to reserve your EIP for an entire month (as with Subscription), but you are paying for a fixed amount of outbound network traffic (in Mbps).

In this billing mode, you are billed hourly.

  1. The "configuration" charge for reserving a Pay-by-bandwidth EIP in Singapore is 0.151 USD (per day).**
  2. Bandwidth uses a "tiered" pricing model, with one rate for traffic at or below 5 Mbps and another rate for traffic above this threshold.

Prices between 1 and 5 Mbps are calculated as:

Bandwidth cost (USD/day) x days x max bandwidth value

Above 5 Mbps, the price is:

Bandwidth cost (5 Mbps) x days + (n - 5) x Bandwidth cost (> 5 Mbps) x days 

Let's translate all this into plain English:

  1. EIP charges you a configuration fee (per day) for Pay-by-bandwidth EIPs
  2. EIP then charges you a fixed USD/day rate for bandwidth consumed between 1-5 Mbps
  3. EIP then charges you another fixed rate for traffic above 5 Mbps

Let's have an example to make this clearer.

Let's assume I use 10 Mbps for two days. In this case, my cost is:

0.71 USD (5 Mbps for 1 day) x 2 + (10-5) × 0.5 (USD/day) x 2 days = 6.42 USD

Stuff You Can Do To Reduce Costs: Changing EIP Bandwidth

You can actually alter the maximum bandwidth of a Pay-by-bandwidth EIP.

Since bills are calculated by the hour, altering your maximum bandwidth throughout the day can be a good way to save money, if your traffic is predictable (or if you are willing and able to implement scaling yourself by calling the Alibaba Cloud API).

This graph (shamelessly borrowed from the documentation) illustrates the point nicely:

changing_bandwidth

As long as we are careful to scale our bandwidth up and down ahead of the demand curve, we can maintain good network performance while saving money.

Let's imagine a scenario where your bandwidth is set at 1 Mbps for the first 12 hours of the day, then 5 Mbps for the next 12 hours.

In this scenario, your costs would come out to:

0.14 USD (1 Mbps / day) x 12/24 hours + 0.71 USD (5 Mbps/day) x 12/24 = 0.425 USD

If you had just left your bandwidth as 5 Mbps the entire day, your cost would be:

0.71 USD (5 Mbps/day) x 24/24 hours = 0.71 USD

In this case, the savings is relatively small, but over time (or for larger traffic fluctuations) it could be significant.

Which One Should I Use?

Here's a general rule-of-thumb you can follow:

  1. For steady, highly predictable traffic, use Subscription
  2. For steady, fluctuating traffic, use Pay-As-You-Go (Pay-by-bandwidth)
  3. For highly unpredictable traffic "spikes", use Pay-As-You-Go (Pay-by-traffic)

This figure sums it up:

choosing_eip_bandwidth

Important note: Both Subscription and Pay-by-bandwidth offer guaranteed capacity. If you pay for 50 Mbps, you will be able to achieve throughput of 50 Mbps, even if there is a lot of network activity happening in the Region that houses your EIP.

Pay-by-traffic, on the other hand, offers best-effort capacity. Technically, EIPs in Pay-by-traffic mode will let you scale up to 200 Mbps per Elastic IP address, but if there is a sudden burst of network activity in the region housing your EIP, you might not be able to use that much bandwidth.

This means that Subscription and Pay-by-bandwidth are far better choices when you need to be able to absolutely guarantee a certain amount of bandwidth, even though you'll end up paying for that privilege.

ECS Public IPs

ECS public IP addresses connect you to the public internet just like EIPs do, with one crucial exception: a standard ECS public IP is always bound to its parent ECS instance. It cannot be attached to a Load Balancer, NAT Gateway, or a different ECS instance.

Public IPs come into existence when your ECS instance is created, and are bound to that instance until it is released.

This means public IPs are somewhat less flexible than EIPs, but they do cost slightly less.

There are two billing methods for public ECS IP addresses:

  1. Pay-by-traffic
  2. Pay-by-bandwidth

Note that this is separate from the "Subscription" and "Pay-As-You-Go" payment mods for ECS itself. Both Subscription and Pay-As-You-Go ECS instances can use either of these network traffic billing methods.

Pay-By-Traffic

Regardless of whether your ECS instance is Pay-As-You-Go or Subscription, your network bills will be generated on the hour every hour. Your pay a fixed amount for each GB of egress traffic you generate.

When you use Pay-by-traffic, you can set an upper limit on bandwidth to keep yourself from generating an enormous bill. For instance, I could limit my Pay-by-traffic public IP to a maximum rate of 2 Mbps, if I wanted to.

Pay-By-Bandwidth

This works more or less the same was as Pay-by-bandwidth for Elastic IPs, except that the billing period changes based on what type of ECS instance billing method you use:

  1. Network traffic for Pay-As-You-Go instances is charged hourly
  2. Network traffic for Subscription instances is charged for the duration of the ECS subscription, which could be several months or even up to a year

Further, tiered pricing is used - just like with Elastic IPs - meaning you are charged different rates for traffic above and below 5 Mbps.

Doing The Math: How Do You Calculate Your Usage?

Let's imagine we generate 10 Mbps of network traffic continuously for 24 hours.

1. Using Pay-by-traffic billing

10 Mbps / 8 Mbit/MB * 24 hours * 3600 seconds/hour = 108,000.0 MB = 105.5 GB

At the standard rate for Singapore (0.081 USD/GB), the cost is then:

105.5 GB x 0.081 USD/GB = 8.55 USD / day

2. Using Pay-by-bandwidth billing

We'll assume this is a Pay-As-You-Go ECS instance first, so we will use the hourly rates. We also need to split our calculation into two "halves": the first 5 Mbps are charged at one rate, and the next 5 Mbps at another:

0.0296 USD/hr (5 Mbps) x 24 hours + 0.021 USD/hr (>5 Mbps) x (10-5) x 24 = 3.23 USD / day

We can see that for this "sustained traffic" scenario, Pay-by-bandwidth billing is a lot cheaper here.

If we have a monthly (Subscription) ECS instance, the prices work out a bit differently:

17 USD/month + (10-5) x 11.8 USD/month = 76.00 USD / month

Dividing by 30, we get a much lower daily cost:

76.00 USD/month / 30 = 2.53 USD / day

Of course, keep in mind that real world scenarios may not be this simple. If you want to have the ability to scale your bandwidth hour by hour, you'll need to use a Pay-As-You-Go instance, which will allow you to adjust your bandwidth up and down hourly.

So, there is a potential tradeoff here. Purchasing a Subscription ECS instance will save you money on your ECS instance, but might cost you money on network bandwidth, because you'll lose the flexibility to adjust your bandwidth up and down.

Tip: You can potentially get around this by binding an Elastic IP to a Subscription ECS instance. The Elastic IP will allow you to change your bandwidth hourly, since it is independent of the ECS instance it is attached to. Sure, you'll have to pay the 0.006 USD/hour "configuration fee" for the EIP itself, but over a month that only adds up to 4.32 USD, probably an insignificant amount compared to your network bandwidth costs and ECS instance costs!

How to choose?

  1. If your bandwidth needs are unpredictable, choose Pay-by-traffic (regardless of whether you are using Subscription or Pay-As-You-Go ECS)
  2. If your bandwidth needs are extremely predictable, choose Pay-by-bandwidth plus ECS Subscription
  3. If your bandwidth needs are somewhat predictable, choose Pay-by-bandwidth plus ECS Pay-as-you-go, or go with a Pay-by-bandwidth EIP address and a Subscription ECS instance, whichever is cheaper.

Object Storage Service (OSS)

Ok, time for some good news! OSS bandwidth pricing is much, much simpler!

You can pay either Pay-As-You-Go or purchase a "Bandwidth Plan", which covers your traffic costs up to a certain number of Gigabytes.

Pay-As-You-Go

In Singapore, Pay-As-You-Go outbound traffic is free from 0-100 GB. For the next 100 GB to 10 TB it's 0.080 USD / GB.

This means that using Pay-As-You-Go to download 200 GB of data from OSS in Singapore would cost:

100 GB x 0 USD + 100 GB x 0.080 USD/GB = 8.00 USD

That's it.

Bandwidth Plans (Data Transfer Plans)

Bandwidth plans are available in different time increments:

  1. 1 Month
  2. 6 Months
  3. 1 Year

The discounts you get scale up with time, and you purchase outbound bandwidth in increments of GB (Gigabytes) or TB (Terabytes).

A 1 month, 100 GB data transfer plan would cost me 8.00 USD, the same as the Pay-As-You-Go costs above, but it has the advantage that:

  1. The discount increases if I purchase longer-term bandwidth plans
  2. The plan covers all my buckets in a given Alibaba Cloud region, so I can share the bandwidth package across multiple buckets

In general, if you have a rough idea what your outbound bandwidth is going to look like, buy a data transfer plan!

Another tip: Egress costs per Gigabyte are cheaper for OSS than they are for ECS. Consider reducing your outbound ECS network traffic costs by moving static files like images and video to OSS, and serving them directly from there.

Data Transfer Plans (Shared Bandwidth)

Gee, that OSS bandwidth plan sure is nice, right? If only there was something like that for other Alibaba Cloud services.

Haha, I'm kidding! Of course there is: the Data Transfer Plan.

Data Transfer Plans work for:

  1. ECS public IPs
  2. Elastic IPs (EIPs)
  3. Classic Server Load Balancers (CLBs)

Note that BGP Pro Elastic IPs are excluded.

Good stuff about the Data Transfer Plan:

  1. If I buy a Data Transfer Plan for the Singapore region, it applies across all my CLB, EIP, and ECS public network traffic, all at once
  2. I can stack or purchase multiple plans: if I bought a plan for this month and it is nearly used up, I can buy another. The billing system will use up the bandwidth from each plan in their order of expiration, meaning that the Data Transfer Plan that is expiring the soonest will be used first.

If you have multiple public network services generating (semi-predictable) internet traffic, you should be using Data Transfer Plans.

There are monthly and yearly plans, and they charge by traffic, so you pay in increments of Gigabytes or Terabytes, from 50 GB up to 50 TB.

Note: Bandwidth plans only apply to Pay-by-traffic public IPs, so if you are planning to use this feature, make sure your EIPs, ECS public IPs, and CLBs are all using Pay-by-traffic billing.

That's it for this week. See you next week!

I've Got A Question!

Great! Reach out to me at jierui.pjr@alibabacloud.com and I'll do my best to answer in a future Friday Q&A blog.

You can also follow the Alibaba Cloud Academy LinkedIn Page. We'll re-post these blogs there each Friday.

Not a LinkedIn person? We're also on Twitter and YouTube.

0 0 0
Share on

JDP

41 posts | 53 followers

You may also like

Comments

JDP

41 posts | 53 followers

Related Products