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

In auto-reroute.sh, add -w (--max-time) option to curl when downloading test files. #18

Open
higden opened this issue Jun 27, 2017 · 3 comments

Comments

@higden
Copy link

higden commented Jun 27, 2017

Sometimes the script can take an hour to complete because the network is painfully slow and the test files are over 200MB.

Adding a --max-time option to the curl command on line 28 would greatly decrease the chances of the script hanging.

According to the curl manual:

-m, --max-time <seconds>
Maximum time in seconds that you allow the whole operation to take. This is useful for preventing your batch jobs from hanging for hours due to slow networks or links going down.

Currently, the line in the script is:

messyspeed=$(echo -n "scale=2; " && curl -4 -s -L ${test_files[$count]} -w "%{speed_download}" -o /dev/null | sed "s/\,/\./g")

The changed line would read like this:

messyspeed=$(echo -n "scale=2; " && curl -4 -s -m 180 -L ${test_files[$count]} -w "%{speed_download}" -o /dev/null | sed "s/\,/\./g")

The option -m 180 specifies a timeout of 180 seconds, or 3 minutes.

@proudcanadianeh
Copy link

I would very much like to see this, am currently facing a problem where the test seems to just be hanging on one of the routes.

@vicelversa
Copy link

I second (or third) this change as well. I use a localized version of the script to include such changes. I have mine set to spend no more than 30 seconds per route test. At least for my connection, 30 seconds is enough time to observe a slow connection.

@proudcanadianeh
Copy link

I think 30 seconds is too aggressive for general distribution to be honest. Some poor connections need several minutes to actually average out a real speed. I would say 2-3 minutes minimum would be safe

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

3 participants