Hosting servers

Dedicated Hosting servers – servers optimized for virtualization, multi-site hosting and consolidated infrastructures.

Friday, April 27, 2018

What is CDN and when should CDN be used?

The term CDN can be found in many articles on thachpham.com, or when you need someone who has experience consulting solutions to save server bandwidth and speed up the website will be heard advice is to use. use CDN. What is CDN exactly, how many CDNs, and whether your website is suitable for CDN use then this article will provide you with that information.


What is CDN? CDN is the acronym for Content Delivery Network and it is best not to try to translate it into English but avoid using it in the English sense, or if you understand it, you should translate it into "content distribution network". than. This means that it is a global server system (number depending on the service provider) that stores the copy of the static content within the website and then distributes it to other servers. This is called PoP - Points of Presence and from the PoP it will send to the user when they visit the website.
First, let's look at the different patterns between a non-CDN website and a website that uses CDN.
Do not use CDN
When a user views a file without a CDN, they send a request directly to the server hosting the website to access the file. This example of thachpham.com is direct access to the server of thachpham.com. Before using CDN
Use CDN
When a file is distributed by the CDN, the user accesses it and the PoP allocates the closest one to the user who will pay the content to the viewer. For example if you visit this link is to see a content of thachpham.com on the CDN, for example you in Vietnam, PoP CDN in Vietnam will distribute content for you. After using CDN
Some forms of CDN When using some CDN services (not including CloudFlare or similar CDN proxy services), you will find that they support some types of CDN usage including:
Pull HTTP / Static
This type means that you declare the domain name of the website to use the CDN or IP of the server. Then the CDN PoP will automatically access the website under that domain name and save the copy of all static content inside the website (images, CSS files, Javascript files, Flash, Video, ...). . And then you can access a file on the website with the CDN path they provide or use a separate domain for the CDN. For example:
POST / PUSH / PUT / Storage CDN ...
This can be called with different names. But it has one thing in common: instead of the PoP CDN will crawl the site itself, you will download the content directly distributed through the CDN to their server through popular protocols such as FTP or HTTP. Often they now support FTP as the most.
And with this method of distribution, you will be able to save space on the server because there is nothing saved there.
Streaming CDN
Although the above CDN formats support video files, it does not support streaming live video. So this method will help CDN distribute streaming content from the server and then redistribute it to the viewer to save bandwidth from the original streaming server. Or you can choose how to stream content directly to CDN server like Push CDN.
Advantages of using CDN
So after you understand how CDN works, you will realize that it has the following advantages:
Save bandwidth for the original server
Bandwidth from the root server takes only one processing time, accepting the request from the CDN PoP, then the user visits will only access the content on the CDN, so the root server will not cost extra. . Only if you proceed to delete the content on the CDN will the CDN PoP will proceed to retrieve content again to spend more.
Accelerate hits
Due to the nature of the CDN PoP spread across the continent, it will help your website faster access to users far from the server of the website. For example, thachpham.com located in the US where direct access to a 300KB image in Vietnam will take about 0.5 seconds (500ms). But if thachpham.com uses CDN for static content that supports PoP in Vietnam, then users only take 0.01 seconds (10ms) to view a file, even faster.
Similar to users in other countries, the more PoP of a country you have in your country, the more beneficial it will be in accelerating your global website.
Saves space
If you use the Push CDN method, it will save the server space as everything is uploaded directly to the CDN server. However, for safety reasons, you should save some content somewhere in case the CDN service has problems.
Cost savings
The cost savings here is the cost of bandwidth. Assuming your host or host package only supports a certain bandwidth per month, you'll need to purchase or upgrade bandwidth at the end. Bandwidth is not cheap, the average bandwidth on some host providers is about 20,000 dong per GB, equivalent to $ 0.88. But the heterosexual

CDN services will most likely cost around $ 0.05 or less, in some Asian PoPs that are more expensive than $ 0.1 per GB bandwidth. So instead of buying more bandwidth at the host, using CDN will save a lot.
When should CDN be used?
CDN has many benefits to use and it is one of the requirements that many websites have to use. But not every website is necessary to use, but CDN is only really useful when:
When is it not necessary to use CDN?
As you said above, in many cases you do not need to use CDN because not only does it not help the website faster but also slower. And one of the most common reasons is that the website server is located near the user. For example, if you own a server in Vietnam and use it in Vietnam, but you use CDN, if the CDN does not have PoP in Vietnam then your website will be slower because your users will visit it. The other PoPs are far farther from the current root server, so they are slower.
Similar to the CDN proxy service such as CloudFlare, the website is hosted in Vietnam that uses it, users in Vietnam will be slower than normal. Notes when selecting the CDN service
As you proceed to find a good CDN service that is suitable for long-term use, take note of their PoP system. It is best to choose PoP-enabled CDN services in the country in which you have the most users. For example, if you choose CDN for Vietnamese website, you should prioritize CDN PoN services in Vietnam such as CDNSun, CDN.Net, etc. Each vendor has Network item for you to view their PoP system. Take a look carefully before use.
In addition, the second important is price and form of payment. CDN services currently support two types of pay as you pay (as-you-go) or fixed monthly charges for use under the package. If your website costs a lot of bandwidth then pay-as-you-go will save you money because you will not be able to use it when you buy it.
The last note is speed, which you can verify by trial service and ping to CDN address using CA App Synthetic Monitor service to see if it really is speed optimization. Or you can refer to the CDN reviews on the net. Some free CDN resources This is a free proxy service that supports free CDN. If your website is hosted in the US or Europe, this service will help you optimize the speed of the website a lot for visitors in Vietnam.
It is not the same as the CDN service that you presented above, you can not use a separate domain for the CDN and can not download content to their CDN server but it will work using a secondary proxy layer. space for the domain. When users visit your website, they will go through a proxy layer and there it is available CDN to distribute the content in the site, the site path does not change. Photon
This is a special service for WordPress users who have installed the JetPack plugin. It will automatically place the image files on the Photon CDN server website and distribute it to users to save bandwidth and page load time. This is a CDN service for Javascript libraries. For example, instead of manually hosting the jQuery.js file of the jQuery library, you can use jsDelivr's CDN link. Currently it supports over 1650 different libraries, almost every popular Javascript library is there. The simplest way is to embed Javascript files in their links instead of manually hosting them.
If you are a WordPress user, you can install this plugin so that it automatically changes the Javascript library used in the website to the CDN link. Google Hosted Library
Just like jsDelivr, you can use Javascript library links on Google's CDN servers to save bandwidth.
Some popular CDN services
 Amazon CloudFront  MaxCDN  CDN77  Akamai CDN  CacheFly  CDN.Net  CDNSun (with support for PoP in Vietnam)  KeyCDN  CDN.Com.Vn (only PoP in Vietnam)  EdgeCast  CDNlion  SoftLayer  WPPronto Epilogue
In this article, I may have just described the CDN so much, so I just thought it was enough for you to understand CDN. Actually, website owners in Vietnam rarely select host services in Vietnam for various reasons, so the demand for CDN is quite high. Hopefully after learning more about CDN, you will know whether you should use CDN or not and understand it the best way.

No comments:

Post a Comment