-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
tc and tsproxy shaping differ significantly #271
Comments
Hey @worenga this is tracked in #229, there's a problem running the TSProxy with Selenium. You should use TC (that is default if you use Docker) for now. The strange thing is that if I run Chrome/Firefox standalone with TSProxy it works fine (=the connectivity numbers are more or less realistic) but doing the same through Selenium makes the proxy super slow, so the numbers are not realistic at all. Best |
Thanks for the advice. I cannot seem to get Browsertime to connect to the proxy, when i start it outside manually, neither Furthermore, i was woundering regarding tc, how the uplink bandwith limitation is realized. It seems that it isnt. |
Got it to work using Anyhow, regardless of whether i start the proxy inside browsertime or outside of browsertime the timings do still differ: Baseline (since i changed locations since last time):
3g:
then
with tc:
cable:
then
and for tc:
baseline DOMContentLoaded event: 476ms (±18.97ms) 3g DOMContentLoaded event (tsproxy): 16.s (±424.95ms) cable DOMContentLoaded event (tsproxy): 3.01s (±88.48ms) |
Yep, that's the same I got before, but if I start the browser standalone (not using Browsertime and Selenium) the TSProxy numbers are better and more inline with TC both for FF and Chrome. Check catchpoint/WebPageTest.tsproxy#10. If you test a site with more requests, the TSProxy number will be more off. My feeling is that something goes wrong running with Selenium but I wasn't able to understand what, if you have any input that would be great! |
I see. I saw t hat we are setting the socks proxy manually through an argument/preference, i tried to use this interface here: https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/proxy.html |
I think it could be that NodeJS version of Selenium doesn't support SOCKS proxy yet but according to this it should: https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md#v300-beta-3 When we set it up in Browsertime we use the CLI flags. |
I think (from a quick read) that it should be fixed in the upcoming Firefox 52: mozilla/geckodriver#97 |
I also noticed that in the current version for tc the values are exchanged. Limiting the ingress traffic is a little more complicated, as one would need to setup an bridge interface using the ifb module as follows:
|
hmm yes that looks strange. There was a lot of issues with getting tc to work but you are right this seems wrong. I think you need to run modprope outside the container so we need to check if there's another way 2do it. There's a lot of different versions if you check the history in https://github.com/sitespeedio/sltc/blob/master/lib/sltc.js I think previous version worked in Docker on Mac but not Ubuntu or if it was the other way around. |
Apart from modprobe, we could also use a virtual network namespace as in |
Network namespaces sounds cool, not sure exactly how to integrate it, a PR would be super :) |
Yes, the problem i see is that we somehow need to execute the SeleniumRunner inside a network namespace now ( |
Been thinking and I think the easiest way first to get better connectivity is to use modprobe ifb0 outside the container. It will not work on Mac but Linux if I remember correctly but we could catch the error and add a warning. We could rollback to https://github.com/sitespeedio/sltc/blob/d6ebbf5de5345057da63b213838a4111d516b93e/lib/sltc.js , clean it up and then when running docker on Linux make sure that mode´probe run before the container starts? ping @beenanner |
Yea not ideal, but the goal is to have something that works. ;-) |
I tried it but https://github.com/sitespeedio/sltc/blob/d6ebbf5de5345057da63b213838a4111d516b93e/lib/sltc.js didn't work for me in the container. Modified according to sitespeedio/sltc#3 (comment) and then all commands goes through but speedtest doesn't work for me. |
The only thing I could get to kind of work (in Docker) is https://gist.github.com/jterrace/1895081 but locally I see some diffs in the download speed, but it could be that I don't configure it right. @worenga do you have any input? I can push a branch today so it's easier to try out. |
or hmm maybe it doesn't work, I need to test more tonight. |
@soulgalore if you have a test branch i can look into it on the weekend. |
@beenanner has tested a lot different solutions (and I've tried some too) and it seems like a bridge network for Docker can do the work but we still need more testing and find a solution to the problem of uploads if set the network to the full Docker container. |
Here is my steps with the bridge setup to test. Pull latest master of sitespeedio/sltc from github and docker build it.
Create the 3g test network
This creates a bridge where download is limited to 1 mbps and has a 100ms latency.
now test with the normal bridge to verify
|
Keep track of the TS problems in #229 and I've updated the docs for how to setup Docker networks. |
When comparing the load times of between tc and tsproxy i've noticed that they differ quite a lot
First some baseline measurement for
https://google.de
Now use tc shaping with cable and 3g profile
and now tsproxy:
So, recap: lets use DOMContentLoaded as an example metric here:
Baseline: 725ms (±20.83ms)
tc (cable): 959ms (±8.02ms)
tsproxy(cable): 4.15s (±152.73ms)
Difference: > 4x
tc(3g): 3.84s (±44.82ms)
tsproxy(cable): 24.23s (±1.s)
Difference: > 6x
Surely, this is only a spot check with little significance, but this results alone are alarming.
The following questions arise:
a) Which is the more realistic backend to use?
b) Why is tsproxy generally slower?
The text was updated successfully, but these errors were encountered: