Well, after several rounds of tinkering, the website is now very fast and stable for domestic access. Next, let’s look into overseas users and how to enable them to access the site at high speed as well~~~
Alibaba Cloud’s CDN originally had overseas nodes, but recently they have all been unavailable. The official team only listed a few nodes in the help documentation without opening them up for application. So, I had to find an overseas CDN on my own~~~
Geo-based DNS Resolution
To ensure that overseas users access overseas servers and domestic users access domestic servers, we need to split traffic via DNS resolution based on location. Originally, DNSPod provided this feature for free, but later stopped offering it. Now, free users of DNSPod can only differentiate between China Unicom, China Mobile, CERNET, etc. Fortunately, Alibaba Cloud DNS still offers this service. Within Wanwang, you can configure resolution specifically for overseas routes. Simply set the domestic server to the default route and the overseas server to the overseas route. The process is very simple, so I won’t go into further detail.
Using AWS
AWS can be considered the pioneer of cloud computing. Alibaba Cloud is essentially building a domestic version of AWS, with increasingly comprehensive features. Like Amazon, both companies developed massive server demands, user bases, and traffic volumes through e-commerce before gradually opening their infrastructure to the public.
Let’s take a look at what services AWS offers:
The main services include:
EC2 is equivalent to Alibaba Cloud’s Elastic Compute Service (ECS)
S3 is equivalent to Alibaba Cloud’s Object Storage Service (OSS)
Glacier is equivalent to Alibaba Cloud’s Open Archive Service (OAS)
CloudFront is equivalent to Alibaba Cloud’s CDN
RDS is equivalent to Alibaba Cloud’s Relational Database Service (RDS)
DynamoDB is equivalent to Alibaba Cloud’s Table Store (OTS)
ElastiCache is equivalent to Alibaba Cloud’s Open Cache Service (OCS)
VPC is equivalent to Alibaba Cloud’s Virtual Private Cloud (VPC)
Route 53 is equivalent to Alibaba Cloud’s DNS
CloudWatch is equivalent to Alibaba Cloud’s CloudMonitor
Elastic Beanstalk is equivalent to Alibaba Cloud’s Auto Scaling (ESS)
SQS is equivalent to Alibaba Cloud’s Message Queue Service (MQS)…
Additionally, AWS offers services such as email sending, cloud desktops, and enterprise internal secure storage. Generally speaking, AWS services are much more mature than those of Alibaba Cloud, and naturally have a far larger user base. Identity & Access Management is done much better than on Alibaba Cloud… However, given the issues with China’s international network gateways, it is obviously not feasible to use AWS as a server for domestic users. Moreover, AWS localization only covers introductory pages; the backend console remains entirely in English~~
Currently, AWS generously offers a full year of free tier access. The EC2 instance included is a t2.micro level instance (1 vCPU/1 GB RAM) with 750 hours of usage per month. The advantage is that there is no limit on the number of instances; as long as the total running time across all instances does not exceed 750 hours, no extra fees will be charged. If you only run one instance, it is impossible to exceed 750 hours, since 31 days only amount to 744 hours~
You can freely configure 30 GB of storage, and generously, you can choose SSD storage. I allocated 10 GB for the system disk and 20 GB for data.
Its SSH authentication method requires downloading a key pair file, which must be included whenever connecting; no password is needed. The advantage is significantly enhanced security, while the downside is that you do not log in as root, meaning almost every operation requires sudo. Additionally, its default security group settings do not allow inbound traffic publicly; you must modify these settings to establish a connection. I have to say, connecting to an overseas server from within China is truly laggy…
Once connected, it is just like an Alibaba Cloud server: you need to format the data disk, mount it, and then install and configure Apache/PHP/FTP… Adjusting user permissions and so forth is identical to the process on Alibaba Cloud, so I won’t elaborate. After setting up vhosts and DNS resolution, the site becomes accessible~~~
AWS billing is extremely complex, with charges applied to various operations, similar to Alibaba Cloud’s pay-as-you-go model. Therefore, once you exceed the free tier limits, you may incur charges, so be sure to review the details carefully and prepare yourself mentally. Also, RDS is extremely expensive, with base prices far exceeding those of EC2.
Using S3 and CloudFront
With prior experience using OSS, getting started with S3 is quite easy, although its interface is actually even worse than Alibaba Cloud’s… Another point concerns permissions: you must specify public access during upload; otherwise, others cannot access the files. Of course, you can also set a specific directory to public after uploading. S3 provides 5 GB of storage space for free-tier users, which is sufficient.
Setting up CloudFront from S3 is very convenient—just select the option. CloudFront provides 50 GB of data transfer for free-tier users~~~
Activating CloudFront requires providing a Business URL. AWS will send you an email, and you simply need to reply directly. This has nothing to do with whether your usage is commercial; in other words, you just need to use an email address under your own domain to send back your domain name~~this is used to verify that the domain belongs to you… It typically takes about half an hour before the service becomes available.
As for cnsjw.cn, migrating it to AWS isn’t feasible because updates would become too cumbersome, so using CloudFront solely for CDN acceleration overseas is sufficient.
Next, let’s configure full-site CDN for cnsjw.cn as well as CDN for OSS. Setting up full-site CDN is relatively straightforward: simply set the origin to www.cnsjw.cn, leave everything else at default, and then bind a CNAME record…
Regarding images hosted on Alibaba Cloud OSS, after binding them to img.cnsjw.cn and accelerating via Alibaba Cloud CDN, configuration becomes slightly more complicated. Because the origin address matches the distribution domain, if I set the origin as img.cnsjw.cn and redirect its overseas DNS resolution to CloudFront, the origin tragically points back to itself… Therefore, I need to bind another subdomain on Alibaba Cloud OSS to serve as the origin for CloudFront.
Here’s a comparison of ping latency from various regions:
Using only Alibaba Cloud CDN: Latency remains somewhat high for overseas users.
After adding CloudFront: Overseas latency has decreased significantly.
Summary
AWS can be seen as a predecessor to Alibaba Cloud, and observing how the veteran operates is actually quite beneficial. The learning curve is relatively steep, and many people online complain about their customer service, such as unanswered support tickets. Better support requires purchasing premium plans, which is understandable for free-tier users.
Another important note is that all AWS services are paid, including security and monitoring features. Unlike Alibaba Cloud, where services suspend once your balance reaches zero, AWS links directly to a credit card, creating a potential money pit… Once the free trial period ends, these costs will start accruing, so be sure to carefully review pricing tables and cautiously select which services to enable.
Afterusing Alibaba Cloud’s CDN and RDS services,optimizing website access speed,using Alibaba Cloud OSS and Super Cache with WordPressand this article, we’ve pretty much covered everything regarding website optimization and deployment~~~ Fellow webmasters, when encountering issues, make sure to identify the root cause; restarting won’t solve problems~~~ My Alibaba Cloud server has been running stably for over 200 days now~~~
For now, I’ve placed pages for eitsh.com and reco.so on EC2, static files on S3, and together with all static files from cnsjw.cn, they utilize CloudFront CDN acceleration. Traffic is routed via geo-based DNS~~~ This means initial visits might actually be slower than before, but once someone accesses a file and caching kicks in, speeds should improve significantly compared to previously. Friends overseas are welcome to test out the speed~~~







