High Latency Issue When Routing Through Cloudflare to flyio (NRT Region)

I am experiencing an issue with high latency when routing my requests through Cloudflare to my origin server at flyio (Tokyo; NRT region). The latency is significantly higher compared to a direct connection to flyio.

To illustrate the issue, here are the results of my latency tests:

(Ref. “How do I measure request and response times at once using cURL?” on stackoverflow)

As shown above, curl latency is more significant if I proxied through Cloudflare.

But ping results show no differences between my home ↔ fly, my home ↔ Cloudflare Edge round trip time. So the routing between my homeCloudflare Edge is not the cause.

  • Same test from AWS EC2 ap-northeast-1 network:
% curl -w "@curl-format.txt" -o /dev/null -s # redacted
     time_namelookup:  0.005855s
        time_connect:  0.008350s
     time_appconnect:  0.111815s
    time_pretransfer:  0.111976s
       time_redirect:  0.000000s
  time_starttransfer:  0.177654s
                     ----------
          time_total:  0.177750s

% curl -w "@curl-format.txt" -o /dev/null -s # redacted 
     time_namelookup:  0.014546s
        time_connect:  0.016420s
     time_appconnect:  0.135378s
    time_pretransfer:  0.135519s
       time_redirect:  0.000000s
  time_starttransfer:  0.674060s
                     ----------
          time_total:  0.674163s
% mtr -r # redacted # Direct to flyio
Start: 2023-12-24T15:55:29+0900
HOST: ip-10-61-136-62             Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- ip-10-61-9-17.ap-northeas  0.0%    10    0.2   0.3   0.2   0.3   0.1
  2.|-- ec2-54-150-***-***.ap-nor  0.0%    10    3.8   6.8   2.8  13.4   3.0
  3.|-- 240.3.112.0               10.0%    10    0.6   0.4   0.4   0.6   0.1
  4.|-- 242.8.187.17              10.0%    10    0.5   0.8   0.4   1.4   0.3
  5.|-- 240.0.188.13              10.0%    10    2.1   2.1   2.0   2.2   0.1
  6.|-- 242.4.213.5                0.0%    10    2.8   2.8   0.4   6.5   1.5
        241.0.8.7                        
  7.|-- 52.93.66.75                0.0%    10    1.5   1.4   0.9   2.2   0.4
        242.3.88.211                     
  8.|-- 240.0.188.13              90.0%    10    2.1   2.1   2.1   2.1   0.0
  9.|-- 242.4.213.5               90.0%    10    2.1   2.1   2.1   2.1   0.0
 10.|-- 66.241.125.243             0.0%    10    2.5   2.4   1.2   2.6   0.4
        52.93.66.75   

% mtr -r # redacted # Cloudflare Edge
Start: 2023-12-24T15:56:11+0900
HOST: ip-10-61-136-62             Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- ip-10-61-9-17.ap-northeas  0.0%    10    0.2   0.2   0.2   0.3   0.0
  2.|-- ec2-54-150-***-***.ap-nort  0.0%    10   84.9  17.6   1.1  84.9  29.7
  3.|-- 240.3.112.1                0.0%    10    0.4   0.4   0.4   0.7   0.1
        240.3.112.2                      
  4.|-- 240.0.188.12               0.0%    10    2.0   2.2   2.0   3.6   0.5
  5.|-- 150.222.77.144             0.0%    10    2.8   3.7   2.1  11.2   2.7
  6.|-- 99.83.91.103               0.0%    10    1.8   3.5   1.7  14.1   4.0
  7.|-- 103.22.201.38              0.0%    10    2.1   4.2   2.1  13.1   4.2
  8.|-- 172.66.43.150              0.0%    10    2.0   2.1   2.0   2.3   0.1

It shows that proxied results through Cloudflare are slower than direct.

But it also shows no differences between EC2 ↔ fly and EC2 ↔ Cloudflare Edge round trip time. So the routing between EC2Cloudflare Edge is not the cause.

This is similar to the results at home.

So I suspect there might be a routing issue between Cloudflare Edgeflyio. Could you please provide any insights or assistance in resolving this problem?

P.S. I’ve enabled Argo Smart Routing, but significant latency remains. (The above tests are done with argo enabled)

Thank you for your help.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.