In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
HIT/502 failures often occur in the ats of a certain bureau. Once the customer gets mad, this is a confusing problem. If it is MISS/502, it can be said that it is the origin server error, but HIT/502 has something to do with the ats business system.
After manual testing, the same url is accessed continuously from origin to origin, and occasionally there are 502. the problem is obvious that the origin server is unstable. After analysis, it is found that the distribution made by the origin server using the CDN of a certain manufacturer results in the instability of the origin server. What we get is the content of CDN, and there is a clear max-age,ats in the returned information that stores the fault information according to the information of max-age, which really kills people.
Ats has configuration parameters for fault information. We have set it not to cache fault information without max-age headers. Fault information with max-age headers should be cached depending on the situation, because problems such as origin server revision may occur, that is, some fault information needs to be cached.
After research, it is found that header header rewriting can solve this problem. The idea is to hijack the response header header of 399 to 599 status codes, forcibly delete the cache-control tag, and add Cache-Control no-cache at the same time, so that the fault information will not be stored. We tested it online and found that the configuration is only valid for new requests, but not for old information. Upon checking the cache, 5.7T storage has been written full. Dare not operate easily, then find a way to configure cache rules, use a conservative way to refresh 5.7T information through 7 days, 502/HIT completely solve, the header operation is shared for everyone to study together.
Header_rewrite.so is a module that comes with ats when compiling, but it is not opened by default, so you need to register and add it in ats, and then write rules. The registration method for header module is as follows:
Add header_rewrite.so header.config to plugin.config and specify that the configuration file of header is header.config
Then add a rule to header.config and add the following (during the test, it is found that the fault information with max-age is not easy to forge, and you have taken some detours to test the normal information to see if the function is feasible.)
Cond% {STATUS} > 399 [AND]
Cond% {STATUS}
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
Vlan batch is used to create VLAN in batch
© 2024 shulou.com SLNews company. All rights reserved.