I am trying to simultaneously serve one high definition video for 30+ clients. This leads to the fact that the bottle neck causes some clients to time out, and some experience a significant lag.
Right now - it’s clear that each individual request is processed separately, so the server sends a lot of concerts / sec. Someone mentioned that it might be possible to configure Nginx to find out that all requests are for the same asset, serve it once, and then allow the router (we run this server locally) to send the file to all devices.
Is this possible and / or is there another way to increase my bandwidth?
Here is my code for the request. It is very simple so far ...
upstream unicorn {
server unix:/tmp/unicorn.todo.sock fail_timeout=0;
}
server {
listen 80 default;
root /usr/local/var/rails/todo-after/public;
try_files $uri/index.html $uri $uri/video @unicorn;
location @unicorn {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://unicorn;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}