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:
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 supports two billing options:
Further, there are two types of EIP addresses available:
We'll focus on BGP rather than BGP Pro, since BGP Pro is supported only in Hong Kong.
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:
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
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 pricing has two different modes:
Let's look at each in turn.
There are two charges here:
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 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.
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:
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
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:
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.
Here's a general rule-of-thumb you can follow:
This figure sums it up:
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 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:
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.
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.
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:
Further, tiered pricing is used - just like with Elastic IPs - meaning you are charged different rates for traffic above and below 5 Mbps.
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!
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.
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
Bandwidth plans are available in different time increments:
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:
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.
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:
Note that BGP Pro Elastic IPs are excluded.
Good stuff about the Data Transfer Plan:
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!
Great! Reach out to me at
firstname.lastname@example.org 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.
JDP - October 8, 2021
JDP - November 19, 2021
JDP - April 23, 2021
JDP - April 22, 2022
JDP - April 16, 2021
JDP - January 14, 2022
An independent public IP resource that decouples ECS and public IP resources, allowing you to flexibly manage public IP resources.Learn More
An easy-to-use and cost-effective data traffic package that offers affordable traffic-billed pricing.Learn More
Alibaba Cloud provides products and services to help you properly plan and execute data backup, massive data archiving, and storage-level disaster recovery.Learn More
Accelerate AI-driven business and AI model training and inference with Alibaba Cloud GPU technologyLearn More
More Posts by JDP