In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to achieve nginx proxy_store file management, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
one. Source code download address:
Https://github.com/cxwshawn/ngx_proxy_store_file_mgr
two. Introduction:
1) nginx-conf directory: the main implementation is based on the code of operating redis database in nginx.conf and based on lua; general process:
Obtain whether the cache lock is locked-> if it is locked, the file management process is doing lru policy, directly proxy to the upstream, and does not operate local files.
-> non-locked, then set the sorted set file access time in redis (i.e. score)
The redis structure is sorted by hash+sorted set; hash as md5 (uri)-> filepath and sortedset as: md5 (uri) + ngx.now () (score).
2). Src directory: the file management of nginx proxy_store, which is mainly realized by golang, the main idea:
At present, only when the remaining disk is less than 20%, the percentage of the sorted set sorting result in redis will be deleted in turn.
3), configuration items:
{
"MaxFileLimit": 100000, the maximum number of files. If this number is exceeded, do LRU (not implemented)
"CheckInterval": 20, check the interval between doing LRU
"ExpireDays": 7. Files whose expiration time exceeds 7day will be deleted.
"ErrorLog": true, whether to output error log
"AccessLog": false, whether to enter debug log
"SortedSetName": "defset". The name of sortedset in redis is the same as the name of sorte set in access_file.lua file.
"HashName": "defhash". The hash name in redis is the same as the hash name in access_file.lua file.
"RedisAddr": "127.0.0.1 6379", address of the redis database
"RoutineCount": the concurrency of 32 go lru
}
4), if you have any questions, mail to cxwshawn@yeah.net
After reading the above, have you mastered the method of how to manage nginx proxy_store files? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.