H3/IPv4 from CloudFlare is slower than H3/IPv6 and H2
[Cloned from bug 1741094]
I occasionally suffer from slow transfers (~200-300 KB/s) from CloudFlare, which seem to disappear once I disable http3.
Firefox Nightly, Linux, WiFi, ISP: Deutsche Telekom
I've been able to reproduce this with the bare neqo-client, using the patches from https://github.com/mozilla/neqo/pull/1262.
Slow (H3/IPv4, 23.15 seconds):
/usr/bin/time target/debug/neqo-client --output-dir foo https://derpicdn.net/img/view/2018/11/20/1886618.jpg -4
3.45user 0.34system 0:23.15elapsed 16%CPU (0avgtext+0avgdata 13348maxresident)k 0inputs+12752outputs (0major+728minor)pagefaults 0swaps
Fast (H3/IPv6, 2.4 seconds):
/usr/bin/time target/debug/neqo-client --output-dir foo https://derpicdn.net/img/view/2018/11/20/1886618.jpg -6
1.26user 0.11system 0:02.40elapsed 57%CPU (0avgtext+0avgdata 13412maxresident)k 0inputs+12792outputs (0major+777minor)pagefaults 0swaps
Faster (Curl H2, 0.7 seconds):
/usr/bin/time curl -s -4 --http2 https://derpicdn.net/img/view/2018/11/20/1886618.jpg >/dev/null 0.02user 0.01system 0:00.75elapsed 5%CPU (0avgtext+0avgdata 10084maxresident)k 0inputs+0outputs (0major+734minor)pagefaults 0swaps
/usr/bin/time curl -s -6 --http2 https://derpicdn.net/img/view/2018/11/20/1886618.jpg >/dev/null 0.02user 0.01system 0:00.68elapsed 4%CPU (0avgtext+0avgdata 10180maxresident)k 0inputs+0outputs (0major+733minor)pagefaults 0swaps
When I retried this late at night (IIRC, ~02:00) yesterday, the extreme slowdown of neqo on IPv4 disappeared and both protocols were at about 2 seconds. However, right now (~21:00) the situation is again bad:
- neqo (IPv4): ~30 s
- neqo (IPv6): ~1.3 s
- curl (Either): ~0.7 s
So it seems this might be some bad traffic shaping by the ISP? Maybe CloudFlare can help.
Just tried quiche, which behaves the same, so this is specific to H3 but not Neqo.
# started on Tue Nov 23 17:57:45 2021
Performance counter stats for 'target/release/neqo-client -4 --output-dir foo https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
18.41 (+2.56) ###
14.63 (-1.22) ##
20.35 (+4.50) #####
17.35 (+1.51) ##
8.50 (-7.35) ##################
# Final result:
15.85 +- 2.06 seconds time elapsed ( +- 12.97% )
# started on Tue Nov 23 17:59:05 2021
Performance counter stats for 'target/release/neqo-client -6 --output-dir foo https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
1.736 (+0.840) ##########
0.771 (-0.126) ####
0.643 (-0.253) ########
0.635 (-0.262) #########
0.698 (-0.199) ######
# Final result:
0.897 +- 0.211 seconds time elapsed ( +- 23.56% )
# started on Tue Nov 23 17:59:09 2021
Performance counter stats for '../quiche/tools/apps/target/release/quiche-client --connect-to 104.26.14.212:443 https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
20.27 (-4.45) #####
26.26 (+1.54) ##
27.00 (+2.29) ##
25.69 (+0.98) #
24.35 (-0.36) #
# Final result:
24.71 +- 1.19 seconds time elapsed ( +- 4.83% )
# started on Tue Nov 23 18:01:13 2021
Performance counter stats for '../quiche/tools/apps/target/release/quiche-client --connect-to [2606:4700:20::681a:ed4]:443 https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
1.4689 (+0.2761) ####
1.2727 (+0.0800) ##
0.9141 (-0.2786) #######
1.2420 (+0.0493) #
1.0660 (-0.1268) ###
# Final result:
1.1927 +- 0.0945 seconds time elapsed ( +- 7.93% )
# started on Tue Nov 23 18:01:19 2021
Performance counter stats for 'curl -s -4 --http2 https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
0.725 (-0.540) ###############
1.805 (+0.541) ######
1.476 (+0.212) ###
1.678 (+0.414) #####
0.637 (-0.627) ####################
# Final result:
1.264 +- 0.244 seconds time elapsed ( +- 19.32% )
# started on Tue Nov 23 18:01:25 2021
Performance counter stats for 'curl -s -6 --http2 https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
0.5792 (-0.0516) ##
0.6295 (-0.0014) #
0.5995 (-0.0314) ##
0.6893 (+0.0585) ##
0.6568 (+0.0260) #
# Final result:
0.6309 +- 0.0197 seconds time elapsed ( +- 3.12% )
I just checked this again (using the current neqo e71e860489447fed25b64bd8ec31a804dccb0dad compared to curl 7.85.0), and the performance of H3 is still extremely poor, though this time H3/IPv6 is much slower than H3/IPv4.
Performance counter stats for 'target/release/neqo-client -4 --output-dir foo https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
4.24 (-3.76) ##################
3.28 (-4.73) #############################
10.15 (+2.15) #####
11.23 (+3.22) ######
11.12 (+3.12) ######
# Final result:
8.00 +- 1.75 seconds time elapsed ( +- 21.86% )
Performance counter stats for 'target/release/neqo-client -6 --output-dir foo https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
28.35 (-0.52) #
29.50 (+0.63) #
31.97 (+3.09) ##
30.98 (+2.11) ##
23.56 (-5.31) #####
# Final result:
28.87 +- 1.46 seconds time elapsed ( +- 5.07% )
Performance counter stats for 'curl -O -4 --http2 https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
0.7389 (-0.0115) #
0.6733 (-0.0771) ###
0.7886 (+0.0382) #
0.7251 (-0.0253) #
0.8261 (+0.0757) ##
# Final result:
0.7504 +- 0.0264 seconds time elapsed ( +- 3.51% )
Performance counter stats for 'curl -O -6 --http2 https://derpicdn.net/img/view/2018/11/20/1886618.jpg' (5 runs):
# Table of individual measurements:
0.682 (-0.411) #############
1.705 (+0.612) ########
0.684 (-0.408) ############
1.709 (+0.616) ########
0.684 (-0.409) ############
# Final result:
1.093 +- 0.251 seconds time elapsed ( +- 22.94% )