In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
Today, I'll show you how ATS uses caching strategies to increase dynamic service throughput. The editor thinks that the content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.
First, take a look at the traffic diagram immediately after the policy adjustment:
In order to improve the user experience, increase the cache ratio, and at the same time avoid customer obstacles, it is painstaking to do cache: large files are separated from small files, and dynamic content is separated from static content in small files, and basically everything that can be stored is stored. Only dynamic content has not been started. According to the previous strategy, dynamic content is directly represented, and 1:1 goes in and out, but some bureaus just do not stop. If you want to reach a certain magnification ratio, it is not folded, so use a knife in the dynamic content.
Before using the knife, do some analysis, do a lot of tests on the dynamic content that can be saved and the caching strategy of ATS, and benefit a lot. The current caching strategy of ATS is completely in accordance with the http protocol, and adopts the most conservative caching method, that is, only the information with a clear lifecycle cache header is stored, dynamic, cookie, authorization and no-cache are not stored, and the corresponding configuration parameters in ats are not written. In order to ensure quality, the dynamic content with cookie, and authorization is skipped because the risk is too high, and the rest can be tried in these categories:
1. There are dynamic url images with clear life cycle headers, etc. (we assume that the header information of the website is credible)
2. There are no static url pictures and dynamic url pictures with clear head of life cycle, including pictures with no information or only last-modified head.
For category 1, it is easy to handle. Ats has the corresponding parameters, and you can open it:
Proxy.config.http.cache.cache_urls_that_look_dynamic INT 1
For category 2, it is a technical job to deal with. First of all, the necessary conditions for header information online are:
Proxy.config.http.cache.required_headersINT 2
Only by loosening the restrictions on this can category 2 be included, so setting it to 0 is the first necessity. How to ensure its normal service after setting it up? for example, the CAPTCHA code does not have the header information when it is set. The conservative strategy must be a normal service, but such an opening will definitely report obstacles. After analysis, ats takes the maximum and minimum cache time to ensure the cache time without header information content. The two time parameters are as follows:
Proxy.config.http.cache.heuristic_min_lifetime INT 3600
Proxy.config.http.cache.heuristic_max_lifetime INT 864000
For only the last-modified header, the information is calculated by the aging factor, and the aging factor parameters are as follows:
Proxy.config.http.cache.heuristic_lm_factor-v 0.1
So I came up with an idea to save the content, but before each vomiting, ask ATS to send an IMS header message to the origin server to ask whether there is any change. Because this header message is just an inquiry, it will not take up much traffic. If there is no change, TCP_REFRESH_HIT will spit it out to the user. Although it is back to the origin, the content will still be spit out from the cache. If there is a change, then TCP_REFRESH_MISS will spit it out to the user, and the user will also get the latest content. This will virtually increase part of the spitting flow.
But how to set the parameters? It suddenly occurred to me that I could set all the above parameters to 0, which theoretically achieved my goal. I saved it for the first time, asked IMS for origin from the second time, and immediately found the test environment for testing. As expected, I immediately updated the strategy online and monitored it through the traffic graph tool for an hour. But strange things also happened. Using tsar to see some moments of origin-pull is almost the same as vomiting, and after using traffic_logstats-s analysis, it is found that there are a lot of ERR_CLIENT_ABORT, which is really fatal. This log is that the client has disconnected actively before the data has been received. Less is normal, but more will be a problem. I found a 1m picture with max-age to test, first purge, and then curl connection is immediately disconnected to create this error log. The second visit turned out to be TCP_HIT, which was downloaded to the local image and opened normally. It turns out that ATS will continue to download to cache when dealing with this problem. Because the quality of these domain names is poor, the back-to-origin traffic is sometimes still very high. Continue to find information on google and find this parameter:
Proxy.config.http.background_fill_completed_thresholdFLOAT 0.5
The default is set to 0. This parameter means that the client is suddenly disconnected and will continue to download when the download reaches what percentage. Otherwise, it will be disconnected, without much consideration, set to 0.5, tested, and then updated immediately. The traffic has stabilized and the throughput has also increased.
Finally, it is a small satisfaction, the online parameters are not so stable, and then you still need to adjust the test according to the business situation, but this is also the fun.
All the adjustments are a balance, the current adjustment: 1, increased disk read and write IO;2, increased the load of cpu.
This is all about how ATS caches strategy to increase dynamic service throughput. For more information about how ATS cache strategy to increase dynamic service throughput, you can search the previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support it!
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.