Minimize VM latency to near CloudFlare service

In my scenario I need to minimize the latency between my VM in us-central-1 to the closest CloudFlare datacenter. The problem is, currently pinging the CloudFlare IP gives about 10ms latency, which is not ideal.

Running a traceroute gives me this information:

traceroute to 104.18.0.20 (104.18.0.20), 30 hops max, 60 byte packets
1 74.125.251.241 (74.125.251.241) 10.525 ms 10.500 ms 10.489 ms
2 141.101.73.2 (141.101.73.2) 12.113 ms 12.795 ms 12.088 ms
3 141.101.73.18 (141.101.73.18) 12.134 ms 172.69.56.3 (172.69.56.3) 11.799 ms 172.70.124.2 (172.70.124.2) 18.920 ms
4 104.18.0.20 (104.18.0.20) 10.491 ms 11.364 ms 11.270 ms

Now I see the main latency comes from the first hop to 74.125.251.241 . Looking up the IP it belongs to Google, so I assume it's an internal router.

I wonder if there's some setup that I can do to minimize latency from my VM to the router, so that I can reduce latency by 10ms?

1 1 252
1 REPLY 1

Hi @ouromroos ,

To reduce the latency you're experiencing with your VM, I suggest you to consider the following : 

1. Premium Tier Network - When creating VM instances and configuring the router, use GCP's Premium Tier network. This network tier provides lower latency and higher throughput compared to the Standard Tier.
2. Internal IP address - If your VM and router are located within the same Virtual Private Cloud (VPC) network, use internal IP addresses to communicate between them. Internal traffic within a VPC incurs lower latency compared to external traffic.
3. VM Size and Type Choose VM instance types with adequate CPU and memory resources to handle your application's workload efficiently. Insufficient resources can lead to higher latencies due to processing delays.

You can also take a look at this article to improve the performance and latency of your VM.