Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dash.js client keeps closing current TCP connection and opening new ones #1268

Closed
ChangSurrey opened this issue Mar 21, 2016 · 6 comments
Closed

Comments

@ChangSurrey
Copy link

When I use dash.js v2.0.0 to play a video with 5sec segments, I noticed (using Wireshark) that each TCP connection only lasts about 10 or 15 seconds before it is closed by dash.js client and a new one is opened. This causes the client's download data rate to be severely affected by TCP slow start.

If I want to modify dash.js to let it use a persistent TCP connection, which part of the code should I modify? Any pointer would be greatly appreciated, thanks!

@wilaw
Copy link
Member

wilaw commented Mar 21, 2016

@ChangSurrey - dash.js does not manage manage or control the TCP connections. Like any other MSE player, it makes XHR requests and the underlying TCP sessions are managed by the browser. These is no javascript API to manage the sessions themselves.

For workarounds you could look at joining this thread of interested people looking at parallel requests for each segment https://groups.google.com/forum/#!searchin/dashjs/1676/dashjs/P-KfzJPmueQ/wa80-j5PCAAJ which may help address the problem.

Cheers

Will

@ChangSurrey
Copy link
Author

@wilaw Thank you for the quick reply. I didn't know that the TCP sessions are managed by the browser.

Does this mean the TCP behaviour of a DASH session could be different if I use Chrome or Safari?

I have looked at the thread in your link. It's an interesting post, but it's different from what I want to do. I just want to keep using one single TCP connection throughout a DASH session (hence the term "persistent"), hence eliminating the need to do TCP slow start every dozens of seconds.

@ChangSurrey
Copy link
Author

@wilaw I just found that this issue has been reported at
https://groups.google.com/forum/#!topic/dashjs/JLQTGObYiFo
in February 5th. I will investigate why the browser decides to do this. Thanks.

@edwardcrichton
Copy link

@wilaw - I see it is using
https://xhr.spec.whatwg.org/#the-timeout-attribute
in one place though? In: TimeSyncController.httpHandler()

@ChangSurrey - There are two places where keep alive is configured: the web server and in the browser. The browsers seem to use defaults that are 1-2 minutes, whereas the servers seem to use defaults as low as 5-15 seconds.

https://blog.fastmail.com/2011/06/28/http-keep-alive-connection-timeouts/
https://httpd.apache.org/docs/2.4/mod/core.html#keepalivetimeout

@ChangSurrey
Copy link
Author

@wilaw @edwardcrichton After configuring my apache 2.4.17 server's keepalive timeout to 30s, all my DASH sessions now use 1 TCP connection for the entire session.

@edwardcrichton
Copy link

@wilaw @ChangSurrey That's worth knowing; might be worth adding to the documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants