Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Content Delivery Network/ Best Practices/ Accelerating Access to Websites Built on ECSs

Accelerating Access to Websites Built on ECSs

Updated on 2024-11-14 GMT+08:00

Background

An ECS is a basic computing component that consists of CPUs, memory, OS, and Elastic Volume Service (EVS) disks. Flexible ECS configuration helps save a large amount of hardware costs. Assume that a customer deployed a forum website accessible through a domain name on Huawei Cloud ECS. The initial service volume was small, and user access was smooth. As the services grew, the access traffic increased sharply. Users complained about problems such as slow access. To improve the access speed and user experience, the customer decided to use Huawei Cloud CDN.

Solution Overview

Using Huawei Cloud CDN to accelerate content delivery for websites built on ECSs can reduce costs and improve user experience.

Service process: When a user initiates an access request, CDN checks whether the content requested by the user is cached on the CDN PoP with the fastest response speed. If a CDN PoP has cached the content, it directly returns the content to the user. If the CDN PoP does not cache the content, it pulls the content from the origin server, returns the content to the user, and caches the content.

Solution Advantages

  • Users access website content through CDN, reducing the pressure on the origin server.
  • The unit price of CDN traffic is lower than that of the traffic generated when ECSs directly access the Internet, saving 50% to 57% of the bandwidth cost.
  • Users can obtain content from the nearest CDN PoP, which shortens the network transmission distance and ensures the quality of static content.

Procedure

  1. Set up a forum website on an ECS. For details, see Setting Up a Discuz Forum.
    • The IP address of the server is 192.168.1.1.
    • The domain name of the website is discuztest.com.
  2. Enable CDN.
    1. Log in to Huawei Cloud console. Choose Service List > Content Delivery & Edge Computing > Content Delivery Network.

      The CDN console is displayed.

    2. Click Enable Now.
    3. Select a billing option, read and agree to the service agreement, and click Enable Now.
  3. Add a domain name on CDN.
    1. In the navigation pane of the CDN console, choose Domains.
    2. On the Domains page, click Add Domain Names and configure the acceleration domain name and origin server information.
      • Domain Names: Enter discuztest.com.
      • Service Area: Select Chinese mainland.
      • Service Type: Select Website.
      • Origin Server Settings
        • Origin Protocol: Select HTTP.
        • Type: Select IP address.
        • Address: Enter 192.168.1.1.
        • Priority: Select Primary origin server.
        • Host Header: By default, the acceleration domain name is used.

    3. Click OK and use recommended configurations as required.
      NOTE:

      The configuration takes 5 to 10 minutes to take effect. When Status of the domain name becomes Enabled, the domain name has been added.

  4. Test your domain name before adding a CNAME record to the domain's DNS records to ensure that your domain configurations are correct. For details, see (Optional) Testing the Domain Name.
  5. Configure CNAME resolution. CDN automatically generates a CNAME after you add a domain name. The CNAME cannot be accessed directly. You must add it to your domain's DNS records. Then requests for your domain name will be redirected to CDN PoPs for acceleration.
    In this practice, the generated CNAME is discuztest.com.c.cdnhwc1.com.
    1. In the upper left corner of Huawei Cloud console, choose Service List > Networking > Domain Name Service.

      The DNS console is displayed.

    2. In the navigation pane, choose Public Zones.

      The public zone list is displayed.

    3. Click the domain name you want to add a record set to. In this practice, the domain name is discuztest.com.
    4. Click discuztest.com. On the displayed page, click Add Record Set in the upper right corner. The Add Record Set dialog box is displayed.
    5. Set the parameters as prompted. Use the default values for the parameters that are not listed in the following table.

      Parameter

      Description

      Example

      Name

      Domain name prefix.

      www

      Type

      Type of the record set.

      CNAME – Map one domain to another

      Line

      Resolution line. The DNS server will return the IP address of the specified line based on the source of visitors.

      You must add a Default line to ensure that the website is accessible to users of all carriers.

      Default

      TTL (s)

      Cache duration of the record set on a local DNS server. If your service address changes frequently, set TTL to a smaller value.

      5 min

      Value

      Domain name to be pointed to.

      If CDN acceleration is not enabled, the value is the ECS domain name. If CDN acceleration is enabled, the value is the CNAME generated by CDN.

      discuztest.com.c.cdnhwc1.com

    6. Click OK.
  6. Check whether the CNAME record has taken effect.

    Open the Windows command line interface and run the following command:

    nslookup -qt=cname Acceleration domain name

    In this practice, the acceleration domain name is discuztest.com. If the CNAME generated by CDN is displayed, the CNAME configuration has taken effect.

  7. Check whether the configuration is successful.

    Log in to the forum website and browse web pages. If the website can be visited, the acceleration configuration is successful.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback