Answer the question
In order to leave comments, you need to log in
Why did traffic through round-robin begin to be distributed unevenly?
Good day!
For distributing media files, there is the following configuration:
1) Main server - stores all media files of the project, distributes them
2) Several proxy cache servers distribute the most popular media files from the main server recently through nginx.
Proxy cache server config:
proxy_cache_path /web/media levels=1:2 keys_zone=my_cache:10m max_size=20g inactive=1440m;
location / {
proxy_cache my_cache;
proxy_pass http://my-site.com/media/;
}
Answer the question
In order to leave comments, you need to log in
Thanks for the advice! It turned out that the matter was completely different, I screwed up with the nginx configs. Simultaneously with the move to a new server, the project completely switched to the https protocol, and the link to the http://... version of the site remained in the cache server configs.
As a result, when a request came to the cache server - the cache server requested a file from the main server via http - on the main server it was given a redirect to https - the cache server gave this redirect to the user and that's it.
Sorry for the trouble, I just registered it: proxy_pass https://my-site.com/media/;
and everything worked as it should)
dig into the DNS, obviously also
into the location of the new server, if suddenly the DC or the country has changed
If RR is honest and randomly or cyclically gives records, then most likely it is some third-party caching servers that ignore TTL, which once remembered the answer for your server and, keeping this record in the cache, sent all subsequent ones to it. Well, or just some bot parsed your files in one go.
Look at the traffic statistics if there are spikes within several IP ranges, most likely the reason is somewhere there, and not you.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question