We serve big video files with nginx. Our users use VLC video player, mostly for it's ability to open a network location as a video. When they pause the video, normally Nginx drops the connection after 60s (default value for send_timeout config directive) since there is no activity from client (VLC here). When the user resume the video, the player stops and does not resume from that point. User must stop the video and start again to watch it.
To solve this pause/resume issue, I have changed the send_timeout value to "1d" (one day). Since idle connections are not dropped anymore, they hold some resources on system. You can see the increasing memory usage from this graph:
I don't think all of the connections are used because of paused video streams, maybe FIN packet from the client is not arrived to server and OS thinks that TCP stream is still active.
My questions are:
What can I do for decreasing this memory consumption other than decreasing send_timeout value?
Can nginx "ping" to those idle connections and see if there is someone at the other end and drop connections which are really idle.
Is there any easy/reliable way of serving big video files over HTTP other than Nginx?