-3

I am thinking of using vultr as VPS. When I do a ping to binance api.binance.com which have their servers in Japan on the site https://hnd-jp-ping.vultr.com I get much worse ping from Japan than if I choose to ping from New Jersey. Why do I get better ping from New Jersey to binance api than from Japan when binance is located in japan?

Tokyo

$ping -c 4 -w15 api.binance.com
PING d3h36i1mno13q3.cloudfront.net (108.138.105.100) 56(84) bytes of data.
64 bytes from server-108-138-105-100.jfk50.r.cloudfront.net (108.138.105.100): icmp_seq=1 ttl=245 time=176 ms
64 bytes from server-108-138-105-100.jfk50.r.cloudfront.net (108.138.105.100): icmp_seq=2 ttl=245 time=176 ms
64 bytes from server-108-138-105-100.jfk50.r.cloudfront.net (108.138.105.100): icmp_seq=3 ttl=245 time=176 ms
64 bytes from server-108-138-105-100.jfk50.r.cloudfront.net (108.138.105.100): icmp_seq=4 ttl=245 time=176 ms

--- d3h36i1mno13q3.cloudfront.net ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 176.356/176.418/176.450/0.037 ms

New Jersey

$ping -c 4 -w15 api.binance.com
PING d3h36i1mno13q3.cloudfront.net (18.165.100.49) 56(84) bytes of data.
64 bytes from server-18-165-100-49.iad55.r.cloudfront.net (18.165.100.49): icmp_seq=1 ttl=247 time=8.10 ms
64 bytes from server-18-165-100-49.iad55.r.cloudfront.net (18.165.100.49): icmp_seq=2 ttl=247 time=8.13 ms
64 bytes from server-18-165-100-49.iad55.r.cloudfront.net (18.165.100.49): icmp_seq=3 ttl=247 time=8.13 ms
64 bytes from server-18-165-100-49.iad55.r.cloudfront.net (18.165.100.49): icmp_seq=4 ttl=247 time=8.16 ms

--- d3h36i1mno13q3.cloudfront.net ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 8.096/8.127/8.155/0.021 ms
Xtreme
  • 95

1 Answers1

1

Why do I get better ping from New Jersey to binance api than from Japan when binance is located in japan

What makes you think so?

It's pretty evident from the returns you see that you're reaching a CDN (cloudfront.net). The CDN's job is to ensure that things are cached and/or hosted close to the clients. It's also evident from the IP's listed that you're talking to two different CDN nodes.

In short: you can't infer where their services are located, and you can't infer the latency of an API using ping.

vidarlo
  • 6,654
  • 2
  • 18
  • 31
  • 1
    In general you can't be certain, but in this case it appears CF is using IATA codes in their RDNS names: 'jfk' is New York City (very far from Tokyo) and 'iad' is Washington DC (just a hop, skip, and jump from New Jersey). – dave_thompson_085 Apr 11 '23 at 05:54
  • @dave_thompson_085 Agree, resolves to OSL for me, which matches your theory. – vidarlo Apr 11 '23 at 06:01
  • ok, so "in the real world" (you can't infer the latency of an API using ping) is it better to choose the server located in Tokyo anyway? – Xtreme Apr 11 '23 at 16:51
  • I don't think you have enough information to conclude. – vidarlo Apr 11 '23 at 17:17