-
Notifications
You must be signed in to change notification settings - Fork 389
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
Execution is very slow to fallback to ipv4 when using ipv6 #287
Comments
Another example – timing version output: $ time trans --version &> /dev/null
real 0m0.293s
user 0m0.129s
sys 0m0.167s |
It is a known issue that
|
$ time trans -e bing -b en:pt test
Teste
real 4m5.786s
user 0m0.151s
sys 0m0.205s $ time trans -e yandex -b en:pt test
teste
real 1m24.952s
user 0m0.211s
sys 0m0.219s
$ time ./translate -b en:pt test
teste
real 1m21.834s
user 0m0.415s
sys 0m0.049s
|
I have no idea how it could happen. The initialization of gawk seems very fast (as your I suggest sniffing the traffic to find out where the bottleneck is:
Run the Normally a |
Here's a video showing the tcpdump and the actual output. It seemed to get stuck the longest on this line: 12:45:12.839627 IP6 (flowlabel 0x15a11, hlim 64, next-header TCP (6) payload length: 44) 2002:1776:5c77:0:155a:a4e2:c258:3754.64920 > 2607:f8b0:4008:80d::200a.80: Flags [S], cksum 0xfd11 (correct), seq 935145119, win 65535, options [mss 1440,nop,wscale 6,nop,nop,TS val 1081263766 ecr 0,sackOK,eol], length 0 |
Simply put, your system default has been set to use IPv6, but your network environment doesn't really support that. It took 11 attempts via IPv6 but only to no avail. Once it started to fallback into our good old IPv4 (appeared at Disabling IPv6 on your system will resolve the slowness, most likely. You can read more about the IPv6 slowness problem here: https://en.wikipedia.org/wiki/IPv6_brokenness_and_DNS_whitelisting The reason why Since translate-shell implements networking through a virtual I/O, and gawk handles its TCP/IP directly through sockets, no such trick was ever implemented. |
For translate-shell, there are two possible solutions I can think of:
|
I disabled ipv6 with $ time trans -b en:pt test
teste
real 0m1.072s
user 0m0.470s
sys 0m0.179s Good catch! Thanks!! |
I'll leave this issue open for the long-term ipv6 versus ipv4 solution, as we can't rightly ask all users to disable ipv6 in their environments. |
Options |
Same issue here. Search takes ages, but if I do |
I'm trying the simplest of translations (single words) and it takes minutes at a time... What? Why is it taking so long?
I'm on a Mac, default terminal (bash), and installed
translate-shell
fromhomebrew
Example of slowness:
Example through curl showing quick execution:
Version:
The text was updated successfully, but these errors were encountered: