You are on page 1of 23

Alibaba Cloud

Alibaba Cloud

CDN CDN
Acceleration in Hong Kong
Acceleration in Hong Kong
(China), Macao (China),
(China),
Taiwan Macao
(China), (China),
and regions
Taiwan (China), andChina
outside regions
outside China

Document Version: 20200923

Document Version: 20200923


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Legal disclaimer

Legal disclaimer
Alibaba Cloud reminds you t o carefully read and fully underst and t he t erms and condit ions of t his legal
disclaimer before you read or use t his document . If you have read or used t his document , it shall be
deemed as your t ot al accept ance of t his legal disclaimer.

1. You shall download and obt ain t his document from t he Alibaba Cloud websit e or ot her Alibaba
Cloud-aut horized channels, and use t his document for your own legal business act ivit ies only. T he
cont ent of t his document is considered confident ial informat ion of Alibaba Cloud. You shall
st rict ly abide by t he confident ialit y obligat ions. No part of t his document shall be disclosed or
provided t o any t hird part y for use wit hout t he prior writ t en consent of Alibaba Cloud.

2. No part of t his document shall be excerpt ed, t ranslat ed, reproduced, t ransmit t ed, or
disseminat ed by any organizat ion, company or individual in any form or by any means wit hout t he
prior writ t en consent of Alibaba Cloud.

3. T he cont ent of t his document may be changed because of product version upgrade, adjust ment ,
or ot her reasons. Alibaba Cloud reserves t he right t o modify t he cont ent of t his document
wit hout not ice and an updat ed version of t his document will be released t hrough Alibaba Cloud-
aut horized channels from t ime t o t ime. You should pay at t ent ion t o t he version changes of t his
document as t hey occur and download and obt ain t he most up-t o-dat e version of t his document
from Alibaba Cloud-aut horized channels.

4. T his document serves only as a reference guide for your use of Alibaba Cloud product s and
services. Alibaba Cloud provides t his document based on t he "st at us quo", "being defect ive", and
"exist ing funct ions" of it s product s and services. Alibaba Cloud makes every effort t o provide
relevant operat ional guidance based on exist ing t echnologies. However, Alibaba Cloud hereby
makes a clear st at ement t hat it in no way guarant ees t he accuracy, int egrit y, applicabilit y, and
reliabilit y of t he cont ent of t his document , eit her explicit ly or implicit ly. Alibaba Cloud shall not
t ake legal responsibilit y for any errors or lost profit s incurred by any organizat ion, company, or
individual arising from download, use, or t rust in t his document . Alibaba Cloud shall not , under
any circumst ances, t ake responsibilit y for any indirect , consequent ial, punit ive, cont ingent ,
special, or punit ive damages, including lost profit s arising from t he use or t rust in t his document
(even if Alibaba Cloud has been not ified of t he possibilit y of such a loss).

5. By law, all t he cont ent s in Alibaba Cloud document s, including but not limit ed t o pict ures,
archit ect ure design, page layout , and t ext descript ion, are int ellect ual propert y of Alibaba Cloud
and/or it s affiliat es. T his int ellect ual propert y includes, but is not limit ed t o, t rademark right s,
pat ent right s, copyright s, and t rade secret s. No part of t his document shall be used, modified,
reproduced, publicly t ransmit t ed, changed, disseminat ed, dist ribut ed, or published wit hout t he
prior writ t en consent of Alibaba Cloud and/or it s affiliat es. T he names owned by Alibaba Cloud
shall not be used, published, or reproduced for market ing, advert ising, promot ion, or ot her
purposes wit hout t he prior writ t en consent of Alibaba Cloud. T he names owned by Alibaba Cloud
include, but are not limit ed t o, "Alibaba Cloud", "Aliyun", "HiChina", and ot her brands of Alibaba
Cloud and/or it s affiliat es, which appear separat ely or in combinat ion, as well as t he auxiliary
signs and pat t erns of t he preceding brands, or anyt hing similar t o t he company names, t rade
names, t rademarks, product or service names, domain names, pat t erns, logos, marks, signs, or
special descript ions t hat t hird part ies ident ify as Alibaba Cloud and/or it s affiliat es.

6. Please direct ly cont act Alibaba Cloud for any errors of t his document .

> Document Version:20200923 I


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Document convent ions

Document conventions
Style Description Example

A danger notice indicates a situation Danger:


Danger that will cause major system changes,
Resetting will result in the loss of
faults, physical injuries, and other
user configuration data.
adverse results.

Warning:
A warning notice indicates a situation
Warning that may cause major system changes, Restarting will cause business
faults, physical injuries, and other interruption. About 10 minutes are
adverse results. required to restart an instance.

A caution notice indicates warning Notice:


Notice information, supplementary
If the weight is set to 0, the server
instructions, and other content that
no longer receives new requests.
the user must understand.

Note:
A note indicates supplemental
Note instructions, best practices, tips, and You can use Ctrl + A to select all
other content. files.

Closing angle brackets are used to Click Settings> Network> Set network
>
indicate a multi-level menu cascade. type.

Bold formatting is used for buttons ,


Bold menus, page names, and other UI Click OK.
elements.

Run the cd /d C:/window command to


Courier font Courier font is used for commands
enter the Windows system folder.

bae log list --instanceid


Italic formatting is used for
Italic
parameters and variables. Instance_ID

T his format is used for an optional


[] or [a|b] value, where only one item can be ipconfig [-all|-t]
selected.

T his format is used for a required


{} or {a|b} value, where only one item can be switch {active|stand}
selected.

> Document Version:20200923 I


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
T able of Cont ent s

Table of Contents
1.Overview 05

2.CDN nodes in Hong Kong (China), Macao (China), Taiwan (China),


… and
08 regions o

3.Configure CDN acceleration 10

3.1. Configure CDN acceleration in accelerated regions outside


… mainland
10 China in

3.2. Make API calls to accelerate content delivery outside mainland


… China
13

4.Billing rules 17

4.1. Overview 17

4.2. Pay by traffic 18

4.3. Pay by bandwidth 19

4.4. Billing of value-added services 19

4.5. Overdue payments 20

4.6. FAQ 20

5.Query the bandwidth or data usage 21

6.FAQ 23

> Document Version:20200923 I


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Overview

1.Overview
Alibaba Cloud Content Delivery Network (CDN) retrieves resources from origin servers and
caches the resources on CDN nodes deployed across the world. When a client sends a request,
the system does not need to send the request to the origin server. Instead, the system
automatically retrieves the requested resource cached on the CDN node that is closest to the
client and returns the resource to the client. This topic describes how content delivery is
accelerated in accelerated regions outside mainland China.

Benefits
Alibaba Cloud CDN provides more than 2,800 nodes deployed across the world. More than 500
nodes are deployed across 70 countries and regions outside mainland China, including China
(Hong Kong), China (Macao), and China (Taiwan). Alibaba Cloud CDN supports a total bandwidth
capacity of 130 Tbit/s and 10 GE network interface controllers (NICs). Each CDN node provides 40
TB to 1.5 PB of data storage, and a bandwidth capacity of 40 Gbit/s to 200 Gbit/s. Alibaba Cloud
CDN offers the following benefits:

Stability and high speed


Stable performance and high efficiency: a cache hit ratio of higher than 95%, a smooth video
streaming rate of higher than 95%, and a response time of milliseconds.
Network-wide monitoring and intelligent service systems: 24/7 network-wide and intelligent
monitoring and scheduling based on service quality.

Cost-effectiveness
You can elastically scale resources and pay for the resources based on the actual usage.
Content delivery can be accelerated across Internet service providers (ISPs) and regions.
Alibaba Cloud CDN supports the pay-by-data-transfer and pay-by-bandwidth metering
methods. Both metering methods charge fees on a pay-as-you-go basis. You can select a
metering method based on your business requirements.
Alibaba Cloud CDN automatically responds to traffic spikes of accelerated domain names and
makes adjustments to reduce workloads on origin servers.
Ease of use

Alibaba Cloud CDN provides an easy-to-use console. In the CDN console, you can customize
configurations of domain names. For example, you can add, delete, modify, and query domain
names. In addition, Alibaba Cloud CDN also allows you to customize hotlink protection rules,
cache policies, and HTTP response headers.
Alibaba Cloud CDN provides a wide array of API operations that enable you to use the features
of Alibaba Cloud CDN. For example, you can call API operations to activate Alibaba Cloud CDN,
refresh content, query monitoring data, and download and deliver log data.

High efficiency and intelligence

Alibaba Cloud CDN provides standard configurations that can be quickly and automatically
applied.
The Alibaba Cloud CDN console can quickly respond to user requests to ensure a smooth user
experience. Compared with other CDN services, Alibaba Cloud CDN does not require manual
intervention, which minimizes the response time.

Scenarios

> Document Version:20200923 5


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Overview

Alibaba Cloud CDN can be applied in the following scenarios to accelerate content delivery in
regions outside mainland China, including China (Hong Kong), China (Macao), and China
(Taiwan):

Small image files: Your websites or applications offer downloads of images and small files in
formats such as HTML, CSS, and JavaScript.
Downloads of large files: Your websites or applications offer downloads of files larger than 20
MB, such as game applications, client applications, or mobile apps.
On-demand audio and video streaming: Your websites or applications offer on-demand video
streaming or short video streaming. Mainstream media formats such as MP4 and FLV are
supported.
Dynamic Route for CDN (DCDN) is an independent Alibaba Cloud service and can accelerate the
delivery of dynamic content. You can also use DCDN to accelerate the delivery of static and
dynamic content separately.
Secure acceleration: If your website is vulnerable to attacks and requires delivery
acceleration, you can use HTTPS to reinforce the security of your workloads.

Metering methods
Alibaba Cloud CDN supports the following metering methods: pay-by-data-transfer and pay-by-
bandwidth. Value-added services are billed based on the actual usage, such as the number of
HTTPS requests to static resources. Related topics:

Pay by traffic
Pay by bandwidth
Billing of value-added services

Both the subscription and pay-as-you-go billing methods charge fees based on the actual
resource usage. Alibaba Cloud CDN provides cost-effective subscription resource plans. For more
information, see CDN/DCDN resource plans.

Both the subscription and pay-as-you-go billing methods charge fees based on the actual
resource usage. Alibaba Cloud CDN provides cost-effective subscription resource plans. For more
information, see CDN/DCDN resource plans.

For more information about the pricing of Alibaba Cloud CDN, see Pricing of CDN.

Acceleration methods
After you create an Alibaba Cloud account and pass real-name verification, you can use Alibaba
Cloud CDN in the CDN console or through API operations to accelerate content delivery in
regions outside mainland China, including China (Hong Kong), China (Macao), and China
(Taiwan). For more information, see:

Configure CDN acceleration in accelerated regions outside mainland China in the CDN console
Make API calls to accelerate content delivery outside mainland China

Notice Whether you need to file for an ICP number for the domain name to be
accelerated depends on the accelerated region. If you select Global or Mainland China Only,
you must file for an ICP number for the domain name. We recommend that you apply for an
ICP number through Alibaba Cloud ICP Filing System.

Related services

6 > Document Version:20200923


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Overview

This section describes the related services of Alibaba Cloud CDN to help you understand the
position and use of Alibaba Cloud CDN among other Alibaba Cloud services.

Related service Benefit

You can integrate Alibaba Cloud CDN with OSS to accelerate access to websites.
Object Storage
T his way, you can retrieve content directly from CDN nodes to reduce the costs
Service (OSS)
of Internet data transfer.

You can integrate Alibaba Cloud CDN with ApsaraVideo Live to achieve media
ApsaraVideo Live feed storage, video segmentation and transcoding, access authentication, and
content delivery acceleration.

Alibaba Cloud You can use Alibaba Cloud DNS that is highly available and scalable to ensure
DNS smooth access to resources.

Elastic Compute You can use Alibaba Cloud CDN with ECS to improve website availability, protect
Service (ECS) origin information, and minimize bandwidth usage costs.

Server Load You can specify the IP address of an SLB instance as the origin address to
Balancer (SLB) balance the bandwidth required for retrieving resources from the origin server.

> Document Version:20200923 7


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China · CDN
CDN
nodes in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China

2.CDN nodes in Hong Kong (China),


Macao (China), Taiwan (China), and
regions outside China
This topic describes the distribution of Alibaba Cloud CDN nodes in Hong Kong (China), Macao
(China), Taiwan (China), and regions outside China.

Node performance
Alibaba Cloud CDN hosts more than 2800 nodes worldwide, covering more than 70 countries and
regions.
Alibaba Cloud CDN supports an aggregate bandwidth of 130 Tbit/s. Each CDN node supports 40
TB to 1.5 PB of storage, and 40 Gbit/s to 200 Gbit/s of bandwidth. With these global high-
performance nodes, Alibaba Cloud CDN can significantly speed up content and service delivery.

Note Alibaba Cloud will update the deployment of CDN nodes that are put in use. We
recommend that you focus your attention on the information of the official website.

Nodes distribution
Alibaba Cloud CDN nodes in Hong Kong (China), Macao (China), Taiwan (China), and regions
outside China are distributed as follows:

Asia Pacific: Japan (Tokyo), Japan (Osaka), South Korea (Seoul), Hong Kong (China), Taiwan
(China), Macao (China).
India: Kolkata, New Delhi, Mumbai, Hyderabad, Bangalore, and Chennai.
Indonesia: Jakarta and Surabaya.
Southeast Asia: Singapore, Thailand (Bangkok), Philippines (Manila), Vietnam (Ho Chi Minh),
Vietnam (Hanoi), and Malaysia (Kuala Lumpur).
Oceania: Australia (Sydney), Australia (Melbourne), and New Zealand (Hamilton).
Middle East: Dubai, Kuwait, and Oman in the United Arab Emirates.
Europe: Russia (Moscow and St. Petersburg), Ukraine, United Kingdom, France, Netherlands,
Spain, Italy, Sweden, and Germany.
North America: Canada (Vancouver), United States (Los Angeles), United States (California),
United States (Miami), United States (New York), United States (Seattle), United States (San
Jose), United States (Denver), United States (Dallas), United States (Chicago), and United
States (Santa Clara).
South America: Sao Paulo, Brazil.
Africa: Johannesburg, South Africa.

Video centers on the cloud


Nodes for video centers on the cloud are distributed as follows:

Live centers: Singapore, India (Mumbai), (Germany) Frankfurt, Japan (Tokyo), and Jakarta
(Indonesia).
VOD centers: Singapore, India (Mumbai), (Germany) Frankfurt, Japan (Tokyo), and Jakarta

8 > Document Version:20200923


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China · CDN
CDN
nodes in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China

(Indonesia).
Transcoding centers: Singapore, India (Mumbai), (Germany) Frankfurt, Japan (Tokyo), Jakarta
(Indonesia), Hong Kong (China), United Kingdom (London), United States (Silicon Valley).

> Document Version:20200923 9


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Configure CDN accelerat ion

3.Configure CDN acceleration


3.1. Configure CDN acceleration in
accelerated regions outside mainland
China in the CDN console
This topic describes how to configure Alibaba Cloud Content Delivery Network (CDN)
acceleration in accelerated regions outside mainland China in the Alibaba Cloud CDN console. To
accelerate content delivery in Hong Kong, Macau, Taiwan, and other regions outside mainland
China, follow the procedure described in this topic to activate and configure Alibaba Cloud CDN.

Prerequisites
Before you begin, make sure that you have registered an Alibaba Cloud account and completed
real-name verification. For more information, see Register an Alibaba Cloud account and Real-
name verification.

Context
Alibaba Cloud CDN can be applied in a wide array of scenarios, including but not limited to:
Small image files: Your websites or applications primarily host images and small files in
formats such as HTML, CSS, and JavaScript.
Downloads of large files: Your websites or applications primarily host files larger than 20 MB,
such as gaming applications, client applications, or app stores.
On-demand audio and video streaming: Your websites or applications primarily host on-
demand video streams or short video streams. Mainstream formats such as MP4 and FLV are
supported.

If your workloads encounter the preceding scenarios, and the origin server is deployed in a
region outside mainland China, see the following section describing how to configure Alibaba
Cloud CDN to accelerate content delivery for the origin server.

Step 1: Activate Alibaba Cloud CDN


1. Log on to the Alibaba Cloud CDN console to activate Alibaba Cloud CDN.
2. On the Enable Service page, select a Billing Method.
3. Select the I agree with Alibaba Cloud CDN Agreement of Service check box and click Enable
Now.

Step 2: Add a domain name to be accelerated


1. In the left-side navigation pane, click Domain Names.
2. On the Domain Names page, click Add Domain Name.
3. Set the following parameters: Domain Name to Accelerate, Resource Groups, Business
Type, Port, and Region.

10 > Document Version:20200923


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Configure CDN accelerat ion

Note To accelerate content delivery in Hong Kong, Macau, Taiwan, and other
regions outside mainland China, select Global or Global (Excluding Mainland China). If
you select Global as the accelerated region, the accelerated domain name must obtain
an ICP filing. We recommend that you apply for an ICP filing through Alibaba Cloud ICP
Filing System.

Parameter Supported value Description

Enter a domain name, for example, ch.aliyun.com. Pay


attention to the following considerations:

You can use a subdomain name or a wildcard domain


name as the accelerated domain name, for example, cd

ntest.example.com .
Domain
Name to You cannot add a duplicate domain name. If a
-
Accelerat DomainAlreadyExist error occurs, submit a ticket.
e You can add a maximum of 50 domains to Alibaba Cloud
CDN under each account. T o request a quota increase,
submit a ticket.
Content that is delivered from your domain name must
comply with the limits of Alibaba Cloud CDN and the
relevant regulations. For more information, see Limits.

If you want to accelerate the delivery of small-sized static


content on your website, such as small files, images, and
Image and Small File
style sheets, we recommend that you select Image and
Small File from the Business T ype drop-down list.

If you want to accelerate the delivery of static files larger


than 20 MB, such as game installation packages,
Business
Large file application updates, mobile read-only memory (ROM)
Type
downloading upgrades, and application package downloads, we
recommend that you select Large File Download from the
Business T ype drop-down list.

If you want to accelerate the delivery of on-demand video


VOD or audio content, we recommend that you select VOD from
the Business T ype drop-down list.

You can specify the public IP addresses of one or more


IP servers. IP addresses of Alibaba Cloud Elastic Compute
Service (ECS) instances are exempt from manual review.

> Document Version:20200923 11


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Configure CDN accelerat ion

Parameter Supported value Description

You can specify the domain names of one or more origin


servers.

Origin Info
Note T he origin domain you specified cannot be
the same as the accelerated domain name. Otherwise,
Site Domain a DNS resolution loop occurs, and the requests cannot
be forwarded to the origin correctly. For example, if
the domain name of your origin server is
img.yourdomain.com, you can set the accelerated
domain name to cdn.yourdomain.com.

You can manually enter the Internet domain name of an


Alibaba Cloud Object Storage Service (OSS) bucket, for
example, xxx.oss-cn-hangzhou.aliyuncs.com. T o view the
OSS Domain
Internet domain name of an OSS bucket, go to the OSS
console. You can also directly select an OSS bucket under
the current account.

Function Compute You must set the Region and Domain Name parameters for
Domain a Function Compute domain.

Select a port as needed.

Port 80

Port - Supports resource access over HT T P.

Port 443

Supports resource access over HT T PS.

Global (Excluding If you select Global (Excluding Mainland China), you do not
Mainland China) need to apply for an ICP filing.

If you select Global, you must apply for an ICP filing from
Ministry of Industry and Information T echnology of the
Global
Region People's republic of China (MIIT ). For more information, see
Domain filing.

If you select Mainland China Only, you must apply for an


Mainland China Only ICP filing from MIIT . For more information, see Domain
filing.

4. Click Next.

Step 3: Configure a CNAME record

12 > Document Version:20200923


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Configure CDN accelerat ion

After you add a domain name to be accelerated, Alibaba Cloud previews the domain name. After
the domain name passes the preview, Alibaba Cloud CDN assigns a Canonical Name (CNAME)
address to the domain name. To enable CDN acceleration, you must add a CNAME record to map
the accelerated domain name to the CNAME address. In this way, requests sent to the
accelerated domain can be redirected to the CDN nodes that are nearest to the clients that
make the requests. This topic describes how to add a CNAME record for your accelerated domain
in Alibaba Cloud Domain Name System (DNS) (previously known as HiChina).

1. Obtain the CNAME address of the accelerated domain.


i. In the left-side navigation pane, click Domain Names.
ii. On the Domain Names page, copy the CNAME address of the accelerated domain.
2. Add a CNAME record.
i. Log on to the Alibaba Cloud DNS console.
ii. On the Manage DNS page, click the Domains tab, select the target domain, and then
click Configure in the Actions column.
iii. Click Add Record and add a CNAME record.
iv. Click OK.

The CNAME record is added. After you add the CNAME record, CDN acceleration
immediately starts. A newly added CNAME record takes effect immediately. A modified
CNAME record takes effect within 72 hours.

3. Check whether the CNAME record is effective.


i. Open the Command Prompt in Windows.
ii. Enter ping or dig and the accelerated domain name.
If the output includes *.*kunlun*.com , both the CNAME record and CDN acceleration
have taken effect.

3.2. Make API calls to accelerate content


delivery outside mainland China
This topic describes how to call the AddCdnDomain operation to add a domain to accelerate its
content delivery when the accelerated region is set to global or global (excluding mainland
China).

Prerequisites
Before you call this operation, complete the following steps or read the following topics.

Register an Alibaba Cloud account


Complete real-name verification
Activate Alibaba Cloud Content Delivery Network (CDN)

> Document Version:20200923 13


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Configure CDN accelerat ion

Use SDK for Java

Context
CDN can be applied in a wide array of scenarios, including but not limited to:
Small image files: Your websites or applications primarily host images and small files in
formats such as HTML, CSS, and JavaScript.
Downloads of large files: Your websites or applications primarily host files larger than 20 MB,
such as gaming applications, client applications, or app stores.
On-demand audio and video streaming: Your websites or applications primarily host on-
demand video streams or short video streams. Mainstream formats such as MP4 and FLV are
supported.

If your workloads encounter the preceding scenarios, and the origin server is deployed in a
region outside mainland China, see the following section describing how to accelerate content
delivery by using SDK for Java.

Procedure
1. Add Maven dependencies.

Note The version of the SDK in this example may be different from that of your
actual SDK. For more information about the latest version, visit Alibaba Cloud Open
Platform.

<dependency>
<groupId>com.aliyun</groupId>

<artifactId>aliyun-java-sdk-ads</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>

<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.4.6</version>
</dependency>

2. Call the AddCdnDomain operation.

This example adds an Object Storage Service (OSS) domain to CDN. The accelerated region is
set to global. The OSS domain primarily processes downloads of images and small files. For
more information about the API operation, see AddCdnDomain.

Note If your CDN is deployed outside mainland China, select global or global
(excluding mainland China) as the accelerated region. When you select global as the
accelerated region, the accelerated domain must obtain an ICP filing. We recommend
that you apply for an ICP filing through Alibaba Cloud ICP Filing System.

14 > Document Version:20200923


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Configure CDN accelerat ion

import com.aliyuncs.DefaultAcsClient;

import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile;
import java.util.*;

import com.aliyuncs.cms.model.v20190101.*;

public class AddCdnDomain {


public static void main(String[] args) {

// Specify your AccessKey ID and AccessKey secret.


DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "<accessKeyId>", "<accessSe
cret>");
IAcsClient client = new DefaultAcsClient(profile);

AddImageRequest request = new AddImageRequest();


request.setRegionId("cn-hangzhou");
request.setCdnT ype("web");
request.setDomainName("****.aliyun.com");

request.setSources("[{\"content\":\"test.oss-cn-hangzhou.aliyuncs.com\",\"type\":\"oss\",\"
priority\":\"20\",\"port\":80,\"weight\":\"15\"}]");
//Select the accelerated region. If the accelerated region is outside mainland China, enter glo
bal or overseas.

request.setScope("global");
try {
AddImageResponse response = client.getAcsResponse(request)
System.out.println(new Gson().toJson(response));
} catch (ServerException e) {

e.printStackT race();
} catch (ClientException e) {
System.out.println("ErrCode:" + e.getErrCode());
System.out.println("ErrMsg:" + e.getErrMsg());

System.out.println("RequestId:" + e.getRequestId());
}

}
}

Result
If the API call is successful, the system returns a request ID to you.

> Document Version:20200923 15


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Configure CDN accelerat ion

{
"RequestId": "0AEDAF20-4DDF-4165-8750-47FF9C1929C9"

What's next
You can log on to the Alibaba Cloud CDN console to view the accelerated domain and configure
CNAME records. For more information about what to do next, see Configure a CNAME record.

16 > Document Version:20200923


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Billing rules

4.Billing rules
4.1. Overview
Alibaba Cloud Content Delivery Network (CDN) supports pay by traffic and pay by bandwidth in
accelerated regions outside mainland China. This topic describes these two billing methods.

Purchase guide
When you activate Alibaba Cloud CDN, you can select pay by traffic or pay by bandwidth. For
more information about pricing, see CDN Pricing.

Billing methods

Billing method Description Scenario

Large fluctuations and


T he basic services of Alibaba
bandwidth spikes exist in the
Cloud CDN are billed based on
Pay by traffic CDN traffic curve. T he daily
the amount of daily outbound
bandwidth usage is less than
data from CDN nodes.
30%.

T he basic services of Alibaba


Cloud CDN are billed based on
the daily peak bandwidth. A
T he CDN traffic curve is
bandwidth value is calculated
Pay by bandwidth relatively flat, and the daily
at an interval of 5 minutes. 288
bandwidth usage exceeds 30%.
values are recorded every day.
T he maximum value is used as
the daily peak bandwidth.

Note
Bandwidth usage = Data usage (GB)/(Peak bandwidth (Mbit/s) × 10.54). If the
bandwidth is 1 Mbit/s and the daily bandwidth usage is 100%, the data usage is 10.54
GB.
Only the outbound data from CDN nodes is billed.
Alibaba Cloud CDN retains log data of the last three months. If you have any question
about the logs or bills, submit an application to check the accounting details with
Alibaba Cloud before the log data expires. Log data older than three months is
released and cannot be restored.

Considerations

> Document Version:20200923 17


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Billing rules

The amount of data that is actually charged is higher than the amount of data recorded in logs.
The amount of data recorded in CDN logs equals the amount of data captured at the application
layer. However, an extra amount of data is consumed to transmit the additional bytes inserted
to TCP/IP packet headers and to retransmit TCP packets. Therefore, the actual amount of data
is higher than the amount of data captured at the application layer. For more information, see
Why is the actual billed network traffic different from the network traffic reported by the logging
feature?

4.2. Pay by traffic


Alibaba Cloud Content Delivery Network (CDN) supports the pay by traffic billing method. This
billing method calculates fees based on the amount of outbound traffic from CDN nodes. Use
Alibaba Cloud CDN based on your actual workload requirements.

Alibaba Cloud CDN provides resource plans


Alibaba Cloud CDN provides resource plans. For more information, see CDN Resource Plan.

Subscription
Alibaba Cloud CDN provides cost-effective resource plans to pay for outbound traffic. For more
information about resource plans, see CDN pricing

Pay-as-you-go
The pay-as-you-go billing method has the following rules:

Billing item: traffic


Billing method: pay-as-you-go.
Billing rule: You are billed based on the amount of generated network traffic in each region
(inside and outside mainland China). Billing is based on different pricing tiers. The amount that
exceeds the current pricing tier is billed based on the next pricing tier. The calculation cycle is
one calendar month.
Billing cycle: Billed on an hourly basis and the fees are deducted in real time.
Conversion Formula: 1 GB = 1,024 MB.
Release schedule of bills: A bill is issued at the end of the current billing cycle. The bill is
typically issued within three hours after the end of the current billing cycle, which is subject to
the actual system billing time. The amount due is then automatically deducted from your
account balance.

For more information about pay by traffic, see CDN pricing.

Note The upper bandwidth limit of pay by traffic is set to 10 Gbit/s by default. If the
actual peak bandwidth of your workloads is higher than 10 Gbit/s, choose the pay by
bandwidth billing method, or submit a ticket.

Considerations

18 > Document Version:20200923


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Billing rules

The amount of data that is actually charged is higher than the amount of data recorded in logs.
The amount of data recorded in CDN logs equals the amount of data captured at the application
layer. However, an extra amount of data is consumed to transmit the additional bytes inserted
to TCP/IP packet headers and to retransmit TCP packets. Therefore, the actual amount of data
is higher than the amount of data captured at the application layer. For more information, see
Differences between billed data transfer and data transfer recorded in logs .

4.3. Pay by bandwidth


Alibaba Cloud Content Delivery Network (CDN) supports the pay by bandwidth billing method.
This topic provides details of the pay by bandwidth billing method.

Pay-as-you-go
The pay-as-you-go billing method has the following rules:

Billing item: peak bandwidth


Billing method: pay-as-you-go.
Billing rule: You are billed based on the peak bandwidth in each region. Billing is based on
different tiers.
Billing cycle: Billed on a daily basis and the fees are deducted in real time. The bill of the
current day is issued and the fees are deducted after 00:00 the following day. The actual time
when the bill is issued is determined by the system.
Release schedule of bills: A bill is issued at the end of the current billing cycle (calendar days).
The bill is typically issued within three hours after the end of the current billing cycle, which is
subject to the actual system billing time. The amount due is then automatically deducted from
your account balance. Note that bills of June 17 will be issued after 00:00 June 18.

For more information about pay by bandwidth, see CDN pricing.

Note The pay by peak bandwidth billing method indicates that you are billed based on
the maximum bandwidth (Mbit/s) reached by CDN nodes in each region (inside and outside
mainland China) on a daily basis.

4.4. Billing of value-added services


Alibaba Cloud Content Delivery Network (CDN) provides a wide array of value-added services.
This topic describes the billing details of value-added services.

Static HTTPS requests


After you enable HTTPS, static HTTPS requests incur fees. For more information about the
pricing, see CDN pricing.

DCDN
DCDN is now an independent Alibaba Cloud service. If you set the business type to DCDN in the
Alibaba Cloud CDN console when you added an accelerated domain name, you can go to the
DCDN console to view and manage the domain name. Domain names that are accelerated by
DCDN and retained in the CDN console are billed based on the pricing of the DCDN service. If you
have purchased CDN or DCDN resource plans, CDN and DCDN can share resource plans of
outbound traffic or static HTTPS requests.

> Document Version:20200923 19


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Billing rules

4.5. Overdue payments


This topic describes the reasons that may cause Alibaba Cloud Content Delivery Network (CDN)
service suspension and how to configure low balance alerts.

Service suspension Overdue payments Low balance alerts CDN service

Service suspension
When your CDN payment is overdue, the system will send notifications to you through SMS
messages or emails.

If you settle the payment within 24 hours after the payment becomes overdue, your CDN
service will not be suspended.
If you do not settle the payment within 24 hours after the payment becomes overdue, your
CDN service will be suspended. The cache resources that you are using will be released.
However, your CDN configuration information will be retained for 12 months.

Low balance alerts


How a low balance alert is generated depends on the billing method.

Pay by traffic: The system determines whether you have a sufficient balance in your account
to pay for the next three billing cycles based on the average payable amount during the last
seven hours. If you do not have a sufficient balance, the system will send an SMS message or
email to you as a reminder.
Pay by bandwidth: The system determines whether you have a sufficient balance in your
account to pay for the next billing cycle (day) based on the payable amount during the most
recent billing cycle (day). If you do not have a sufficient balance, the system will send an SMS
message or email to you as a reminder.

4.6. FAQ
This topic answers the frequently asked questions about the billing of Alibaba Cloud Content
Delivery Network (CDN).

Why is the actual billed network traffic different from the network traffic reported by the
logging feature?
Why are fees still incurred after I have stopped the CDN service?
What are the billing rules for CDN nodes in Mainland China to accelerate the delivery of
content from an origin server outside Mainland China?
How is the network traffic billed when a CDN node retrieves an OSS resource in a back-to-
origin operation?
How is the network traffic billed when I integrate Alibaba Cloud CDN with other Alibaba Cloud
services?
How can I view the CDN resource plan I have purchased?
Why do I pay extra fees for network traffic even after I have purchased an Alibaba Cloud CDN
data transfer plan?

20 > Document Version:20200923


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Query t he bandwidt h or dat a usage

5.Query the bandwidth or data usage


The Alibaba Cloud Content Delivery Network (CDN) console allows you to query bandwidth and
data usage information. You can use this information to monitor the billing statements under
your account. You can query bandwidth and data usage information on the Resource Monitoring
and Usage pages in the Alibaba Cloud CDN console. You can filter data usage information by
area, based on which Alibaba Cloud CDN calculates fees. You can filter bandwidth information
by region.

Data usage
You can use the following filter conditions to query bandwidth and data usage information.

Accelerated domain names under the current account.


Tags of accelerated domain names.
Accelerated regions. For more information about accelerated regions outside mainland China,
see CDN nodes in Hong Kong (China), Macao (China), Taiwan (China), and regions outside
China.
Time range. You can select today, yesterday, last 7 days, last 30 days, or specify a custom
time range.

Alibaba Cloud CDN allows you to query bandwidth and data usage information by accelerated
region. The procedure is as follows.

1. Log on to the Alibaba Cloud CDN console.


2. In the left-side navigation pane, choose Monitoring & Usage Analytics > Usage.
3. On the Usage page, you can query data usage by different filter conditions, such as
bandwidth, accelerated domain, time range, and accelerated region.

To query the data usage of accelerated regions outside mainland China, you can select Asia
Pacific 1, Asia Pacific 2, Asia Pacific 3, North America, South America, Europe, or Middle
East/Africa.

4. Click Search to query data.

Resource monitoring data


You can use the following filter conditions to query bandwidth and data usage information.

> Document Version:20200923 21


Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China ·
CDN
Query t he bandwidt h or dat a usage

Accelerated domain names under the current account.


Tags of accelerated domain names.
Accelerated regions. For more information about accelerated regions outside mainland China,
see CDN nodes in Hong Kong (China), Macao (China), Taiwan (China), and regions outside
China.
Time range. You can select today, yesterday, last 7 days, last 30 days, or specify a custom
time range.
Time granularity. You can select five minutes or one hour.
ISPs.

You can query bandwidth and data usage information by country (China excluded). The
procedure is as follows.

1. Log on to the Alibaba Cloud CDN console.


2. In the left-side navigation pane, choose Monitoring & Usage Analytics > Resource
Monitoring.
3. On the Traffic/Bandwidth page, you can query data by different filter conditions, such as
accelerated domain, time range, accelerated region, time granularity, and ISP.

To query bandwidth or data usage information about accelerated regions outside mainland
China, select a location from the Range > All Regions drop-down list.

4. Click Search to query data.

22 > Document Version:20200923


CDN Accelerat ion in Hong Kong (China), Macao (China), T aiwan (China), and regions out side China · FAQ

6.FAQ
This topic answers the frequently asked questions about CDN acceleration in regions outside
mainland China.

What can I do if node resources in a region are insufficient?


If you are an Alibaba Cloud user, submit a ticket to request a quota increase.

If you are a customer business manager, submit a ticket or contact after-sales service to request
a quota increase.

What is content preview?


The content of the origin site accelerated by Alibaba Cloud Content Delivery Network (CDN)
must be in compliance with the local laws and regulations. If any violation is discovered, Alibaba
Cloud immediately blocks the domain or suspends services.
If the CDN nodes used to accelerate your domain are not deployed in mainland China, you do not
need to apply for an ICP filing.

Alibaba Cloud CDN does not accelerate content that involves pornography or gambling.

> Document Version:20200923 23

You might also like