In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What this article shares to you is about how to carry on the quantitative CDN acceleration effect analysis, the editor thinks is quite practical, therefore shares with you to study, hoped everybody after reading this article can have the harvest, does not say much, follows the editor to have a look together.
Road sign
CDN
Website static resource acceleration
Quantitative display of CDN acceleration effect
CDN is configured but has no acceleration effect?
Applicable scenario
Improved user experience of "first contact"
The website has a large number of static resources such as pictures, css, js, etc.
ECS buys fixed bandwidth, which becomes the bottleneck of performance.
Environment
A domain name that has completed "filing"
After the purchase of a domain name, you need real name verification + filing, which will take about "14-20 days".
Background
I have been exposed to two projects, one is a web-based AR project, and the other is an illustrative project using a large image. Both projects have one thing in common: the loading speed is slow. How slow is it? The time it takes for a page to be fully loaded is in double digits (about 10s), or even 20s or more in extreme cases.
Such opening speed is a disaster for the experience of an application, because no user will have the patience to wait such a long time, and the web front end has many technical solutions for slow loading: such as using a low-pixel, small image to "comfort" the user, or using batch loading.
But neither of the above solutions can solve the problem I encountered in the scenario, because the js file of the AR project is as large as the AR file, and neither of the above solutions can completely save the disaster experience of two-digit loading time.
Fortunately, both projects are booth in nature, and you only need to use the browser's own cache mechanism to open the page a few times in advance to easily reduce the loading time to near the 50ms, so that the audience will not feel the loading time at all.
But when it rains like this, the interaction of the display will become very limited, because users will not be able to use their own devices to open the experience application in person, but can only use the device in the hands of the commentator to cache the data in advance.
The original purpose of my research on CDN is also to try to solve the above problem: to enable devices that have no cache users to open the application quickly and improve their interaction when they "touch" the application for the first time.
Principle & idea
To solve existing problems, you need to analyze exactly what the performance bottleneck is. The root cause of the slow loading speed of the web page is of course that the file is too large, but after monitoring the server resource occupation and other parameters, I locked the parameters in two: geographical location and bandwidth.
Next, let's see if CDN can achieve acceleration and how far it can be accelerated.
Steps
In order to determine the above two problems, I selected some files in the project as use cases, did a series of tests, and got three sets of comparative data as follows:
I. comparison of ECS at home and abroad
"Line" takes time to load the file in ms, s
Time is read from the Chrome console
Browser cache is disabled to avoid errors and manually delete cached pictures and records again before each test.
Each file is tested 3 times in an ECS, so each file has 2 sets and 6 data.
The bandwidth of ECS of AWS is much higher than that of ECS of Ali, and the bandwidth of ECS of Ali is fixed bandwidth 5Mbps (that is, 0.625MB/s).
Phenomenon
The server in Orlando is comparable to the appearance in Zhangjiakou.
When the file size reaches 4MB or so, it will begin to approach 10s.
Conclusion:
Due to the spatial location, it is time-consuming to obtain the loading of the file in Orlando, so it is not rigorous to draw a conclusion: AWS makes up the gap of physical distance in bandwidth, and there is little difference in speed between them.
Second, in AliCloud's ECS, using CDN acceleration is compared with not using CDN acceleration
C, D and E are listed as previous test data.
F, G, H, I list the test data after using CDN acceleration
G is a colleague's computer on the same local area network.
H and I are the time performance of using mobile phone hotspot 4G network on another device Mac.
Phenomenon
F is listed as my PC, which has a very obvious acceleration effect
The three columns G, H and I do not show any change in speed, or even slower.
Conclusion:
Is Ali's CDN accelerating for a single IP to deceive consumers?
This conclusion is of course wrong, but the data show the above characteristics, what is the cause? Keep looking down.
Third, in the ECS of AliCloud, use CDN to accelerate and compare the data after "data preheating"
C, D, E are the first set of test data, and the performance without CDN
F is the second set of test data, performance performance on a new device with CDN acceleration but no data preheating
H, I and J are the performance of opening a website on colleague G and two other devices that have not opened a website at all after using CDN acceleration.
Phenomenon
Before there is no data preheating, CDN acceleration has almost no acceleration effect.
After heating the data, the file loading data is obviously improved a lot.
Conclusion
CDN achieves the acceleration effect of the website after data preheating. Compared with the performance of colleague G devices before and after data preheating, the acceleration effect is about 5 to 15 times.
From the final effect, reducing the file opening speed from 10s to nearly ms really greatly optimizes the user experience of "first contact", allows users to speak patiently about applications to use, and also allows visitors to use their own devices to open services in the booth, which is of great benefit to the improvement of interaction and audience.
Postscript
Think it's over? There is also content to quantify that the acceleration effect of CDN is not the main purpose of this article.
The term "data preheating" is rarely mentioned in the principle articles of CDN. When I got the second set of test data, I submitted a work order very confusedly, and only then did I know the link of "data preheating". Further inquire with the engineer that the CND of AliCloud is preemptive by default, just like the mapping between hard disk and memory. The more frequently used, the more time it takes to store accelerated content in redundant sites and to obtain resources.
Therefore, the acceleration site connected to my PC has a good acceleration effect.
The low frequency or newly added resources are not transferred to redundant sites by default, and "data warm-up" needs to be carried out manually in the console. And even if it is not used for a long time after preheating, it will be erased from the redundant site and replaced. Of course, in terms of the fees paid, this preemption mechanism is very reasonable, after all, I only spent the cost of 0.26RMB to complete all the tests.
In the third set of data, we should be able to find that even after the data is preheated, the acceleration effect is different among different devices. For example, on the colleague C device, the loaded data is at the ms level, while on the colleague G and colleague L devices, it is a single digit s level. Careful readers may find that I have marked a geographic information on my CDN device. My personal PC is Hubei, my colleague G is Shanxi, and my colleague L and colleague C are Gansu. (because the concept was not clear in the second set of data, it was not recorded at that time)
These geographical locations are the information of the geographical location of AliCloud redundant acceleration sites. A very interesting phenomenon here is that all the above four devices are four independent devices under the same local area network, three Win,1 Mac, through the same gateway to access the Internet, but each device accesses a different CDN acceleration site!
The IP of two servers belonging to Gansu are different.
The redundant sites accessed by the same device are always the same
Also because of the above reasons, there is a difference in their acceleration effect, which I do not understand very much. Why is there such a big difference in the location of devices in the same local area network accessing the acceleration site? What are the rules for accessing redundant acceleration sites? This is a question that I have not understood. After asking about the project on the work order, I did not get a clear reply, so I can only shelve it for the time being.
The above is how to carry on the quantitative CDN acceleration effect analysis, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.