K
K
Konstantin Khairov2019-09-01 17:15:34
JavaScript
Konstantin Khairov, 2019-09-01 17:15:34

Why is the speed low when uploading through a caching server (proxy_cache)?

Hello everyone, I put a new server as a cache. The caching server must cache video from a file server located in the same DC. Here is the cache config:

Config on the caching server

proxy_cache_path /var/www/cache levels=1:2 keys_zona=ssd_cache:100m max_size=150G use_temp_path=off;
proxy_cache_key "$uri";

server {
 
       listen 80 default;
       root /var/www/;

   location ~* \.mp4 {
      proxy_cache ssd_cache;
      proxy_cache_valie 200 3h;
      proxy_cache_methods GET;
     proxy_pass https://backen (Скрыл адрес сайта)
     }
}


There are no speed limits on the file server. The caching one has a Kingston SSD installed. I took several SSDs, but for now I stuck one - I hung up Ubuntu and set it up only on it for now, and I’ll connect the rest later. Could this be the reason for all the trouble?
So the trouble is that the download speed does not exceed 400-450 KB
And one more thing I noticed, I downloaded the file completely even at this speed, started the download again, but the download comes again from the file server, but not from the cache server (View by iftop appeared download from the file server to the cache server IP) although the file appeared in the cache folder and the disk occupancy increased by the file size

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny Kalibrov, 2018-03-02
@rework

1. var - sets the scope of the variable, if you tempScrollTop = currentScrollTop;specify var before the line , then the next time the function is called, the previous value is not saved in the variable.
2. Because tempScrollTop needs to be remembered at the end, so that the next time the function is called on an event, it will be compared with the previous value, and not with the current one.
3. In the second option, the variable is initialized with a value equal to 0

0
0xD34F, 2018-03-02
@0xD34F

You now have a choice - between what is easy and what is right.
It's easy to keep making random modifications to the code, then trying to understand their meaning, and failing to do this (which is not surprising) to run for help.
That's right - this is to forget about the existence of jQuery for the next couple of months and start learning the language. From zero - because your knowledge of javascript can be safely rounded up to this value.

V
Viktor Taran, 2019-09-02
@shambler81

\.mp4 Excuse me, but what is this interesting file? Are you sure what exactly you wanted to cache?
one single file .mp4- ???
And this is how the mask for all files ending in mp4 would look
like
~* ^.+\.(mp4|mp3)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question