Configure nginx for return of popular files from SSD


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
8 views
Friends, are scratching their heads over some non-trivial problem.
The point: there is file sharing. Storage servers are equipped with SSD disks. There is a plan to put on the SSD frequently accessed files and give them to them. Counting the popularity of the file, copying and deletion are no longer popular (the size of the SSD, alas, limited) would be handled by the script in automatic mode.

Problem — if the script worked and deleted the file in the moment when someone downloads, the connection terminates with an error.

Hover over the idea how to implement any number of locks active files to delete, or maybe there is some magic way to make nginx to look for the file in another location (with HDD) after its disappearance from its current location? The latter, of course, sounds more like a fairy tale, but you never know...
by | 8 views

5 Answers

0 like 0 dislike
>The problem is if the script worked and deleted the file in the moment when someone downloads, the connection terminates with an error.
\r
Will not break because in Linux the file will be accessed through an open file handle. Easy to check, if you put listen to the file and then delete it (talking about ext system), so player will be easy to play on the track, and only when re-treatment will produce an error indicating that the file is not found.
by
0 like 0 dislike
Not quite beautiful option, but it will be fast and Autonomous.
The point is that you need two nginx.
nginx1 does proxy_cache and puts the files on the ssd as needed
nginx2 gives files first from the hdd
\r
After filling the cache, you have the most current file in the cache, the less relevant will be out of it sometimes to fly.
\r
For your option, you can do to try and rewrite files at that location which transfers with the hdd
by
0 like 0 dislike
I recommend to set up nginx to apply directly to the official mailing list. There is a maximum concentration is highly competent in this question of people, including the author himself often responsible. Get the most accurate option.
by
0 like 0 dislike
You are sure that the connection terminates with the error? If Linux, it open files (e.g., video) after removal continue to work (play, until you closed the file, apparently), as I remember. So maybe the problem just yet.
by
0 like 0 dislike
nginc.conf
Include the cache
"proxy_cache_path" in /mnt/tmp/cash levels=1:2 keys_zone=cache:1m max_size=200M;
proxy_temp_path /mnt/tmp 1 2;
respectively prescribe, in what location and how to cache
by

Related questions

0 like 0 dislike
7 answers
0 like 0 dislike
7 answers
0 like 0 dislike
4 answers
110,608 questions
257,186 answers
0 comments
27,944 users