ATS skillfully play cache policy to increase dynamic service throughput

Source: Internet
Author: User

In order to improve the user experience, increase the cache magnification ratio, but also to avoid customers to report the fault, in doing the cache is a painstaking, large files, small file separation, in the small file and the dynamic content and static content, can be stored basically all saved, only dynamic content has not been, according to the previous strategy, Dynamic Content Direct agent, 1:1 of the in and out, but some of the office is not quiet, to achieve a certain magnification ratio, did not fold, in the dynamic content inside move the knife bar.

Before moving the knife, do the analysis, the dynamic content can be stored and the ATS cache strategy to do a lot of testing, benefit. The current ATS cache policy in full accordance with the HTTP protocol, the most conservative cache mode, that is, only the information with a clear life cycle cache header storage, dynamic, cookie, authorization, no-cache all do not exist, ATS in the corresponding configuration parameters are not written. In order to ensure the quality, directly with the cookie, and authorized dynamic content skipped, because the risk is too large, the remaining categories can be tried:

1, have a clear life cycle header dynamic URL images, etc. (we assume that the site's header information is trustworthy)

2, no clear head life cycle header static URL picture, dynamic URL image, including no information or only last-modified head of the picture and other information.

For the 1th class, very good processing, ATS has the corresponding parameters, open can:

Proxy.config.http.cache.cache_urls_that_look_dynamic INT 1

For the 2nd class, it is a technique to work, first of all the prerequisites for the header information on the line are:

Proxy.config.http.cache.required_headersINT 2

Only to release the restrictions on this, in order to put the 2nd class to include, so set it to 0 is the first necessary, set up how to ensure its normal service, such as the verification code, he is not in the setting of the head information, conservative strategy is certainly normal service, but such a release certainly reported the barrier. After analysis, ATS for no header information content cache time to go is the maximum minimum cache time to ensure that 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 information that only last-modified headers are calculated from the aging factor, the aging factor parameters are as follows:

Proxy.config.http.cache.heuristic_lm_factor-v 0.1

So want to advise, content to survive, but each spit before let ATS send an IMS header information to the source station asked if there is a change, because this header information is only asked, will not occupy how much traffic, if there is no change on Tcp_refresh_hit spit to the user, although back to the source, But the content is still spit out from the cache, if there is a change that Tcp_refresh_miss spit to the user, the user gets the same is the latest content, so that will add a part of the Spit stream.

But how to set the parameters? Suddenly thought I can put the above parameters are set to 0, theoretically reached my goal, the first to save, from the second start on the IMS head back to inquire, immediately look for test environment test, as expected, as expected, excited to immediately update the strategy to the line, through the flow chart tool monitoring for an hour, Back to the source of the overall is somewhat reduced, but also took place strange things, with Tsar to see the source of some moments or spit the same, and with traffic_logstats-s analysis found a lot of err_client_abort, really deadly, This log is the client connection after the data has not received the active disconnection of the connection, less is normal, many words there is a problem, I found a 1M with max-age pictures do test, first purge, and then curl connected immediately disconnect, manufacturing this error log, the second visit, unexpectedly is Tcp_ Hit, download to the local picture normal open, deadly Ah, the original ATS in dealing with this problem will continue to download to the cache inside, because the quality of this batch of domain name is poor, so the return source traffic is still very high, continue to find information on Google, found this parameter:

Proxy.config.http.background_fill_completed_threshold FLOAT 0.5

The default is set to 0, this parameter means that the client suddenly disconnects, download to the percentage of how much will continue to download, otherwise it will be disconnected, no more considerations, set to 0.5, did a test, and then immediately updated up, flow stability, throughput has risen.

Finally is a small complete, not the parameters on the line is so stable, follow-up according to business situation still need to slowly pondering, but this is to do this fun.

ATS skillfully play cache policy to increase dynamic service throughput

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.