Troubleshooting common networking issues

Troubleshoot network latency issues

For information about the ways you can improve connection latency between processes within Google Cloud and decrease the latency of TCP connections, see TCP optimization for network performance in Google Cloud and hybrid scenarios.

Network latency variance across zones or machine series

Zones within a region, as well as different machine series or clusters within the same zone, can be hosted across separate physical data center facilities in a metropolitan area. When communicating Compute Engine instances or Google Kubernetes Engine (GKE) nodes reside in different facilities, network traffic traverses metro fiber between facilities rather than staying within a single facility.

This physical distance typically adds approximately 0.5 ms to 1.5 ms of round-trip time (RTT) compared to intra-facility communication, with zero packet loss. This variance is normal behavior within intra-region network performance expectations, and Google Cloud doesn't guarantee single-facility placement within a zone or publish a fixed inter-zone RTT SLA.

If your application or distributed database experiences elevated tail latency or uneven load distribution across zones or machine series, we recommend that you do the following:

  • Confirm baseline transit latency versus packet loss. Use the Google Cloud latency dashboard and check guest OS metrics to verify whether RTT is steady with zero packet drops. Steady differences of approximately 0.5 ms to 1.5 ms across zones or machine series indicate physical distance between facilities rather than congestion or a network fault, and can't be reduced through TCP tuning.
  • Review compact placement policy limits. A compact placement policy colocates VMs only within a single zone and a single project. This policy can't colocate VMs across different zones or separate projects, such as a client project and a database project. Compact placement policies are best-effort unless you specify a maximum distance value, and they're available only for supported machine series.
  • Colocate communicating tiers when possible. Place latency-sensitive client and backend VMs in the same zone and project, and apply a compact placement policy if you use a supported machine series. If capacity for a particular machine series in one zone resides primarily in a separate facility from your other tiers, evaluate running all communicating tiers in another zone within the region.
  • Tune latency-aware routing thresholds. Distributed databases and RPC clients with latency-aware routing or dynamic node exclusion can shift disproportionate traffic away from healthy nodes that differ by only about 1 ms in RTT. Adjust your client driver's latency-exclusion thresholds or routing sensitivity so normal intra-region RTT variance doesn't cause zonal load imbalance.

Troubleshooting dropped network traffic

Compute Engine only allows network traffic that is explicitly permitted by your project's Firewall rules to reach your instance. By default, all projects automatically come with a default network that allows certain kinds of connections. If you deny all traffic, by default, that also denies SSH connections and all internal traffic. For more information, see the Firewall rules page.

In addition, you may need to adjust TCP keep-alive settings to work around the default idle connection timeout of 10 minutes. For more information, see Communicating between your instances and the internet.

Troubleshooting firewall rules or routes on an instance

The Google Cloud console provides network details for each network interface of an instance. You can view all of the firewall rules or routes that apply to an interface, or you can view just the rules and routes that the interface uses. Either view can help you troubleshoot which firewall rules and routes apply to the instance and which ones are actually being used (where priority and processing order override other rules or routes).

For more information, see the troubleshooting information in the Virtual Private Cloud documentation:

Troubleshooting protocol forwarding for private forwarding rules

Use the following sections to resolve common issue related to protocol forwarding for private forwarding rules.

Regional restriction

Protocol forwarding for private forwarding rules is a regional product. All clients and target instance VMs must be in the same region.

Error message: "An internal target instance can only be the target of one forwarding rule"

If you see the error message An internal target instance can only be the target of one forwarding rule, you might be trying to configure two forwarding rules pointing to the same target instance. You cannot point multiple forwarding rules to the same target instance.

Troubleshooting latency on Compute Engine instances when processing high packet rates

If your VM experiences latency, dropped packets, or packet retransmissions when processing high packet rates, your VM might not have enough receive queues (RX) or transmit queues (TX) on the network interface (NIC) processing those packets.

To resolve these issues, see Receive and transmit queues for information about how Compute Engine allocates RX and TX queues.

Troubleshooting custom NIC queue oversubscription

With queue oversubscription, the maximum queue count for the VM is:

[maximum queue count per VM] * [number of NICs]

However, you must satisfy the conditions specified in Custom queue allocation. For example, if you didn't specify a custom queue count for one of the NICs configured for the VM, you get an error similar to the following:

ERROR: (gcloud.compute.instances.create) Could not fetch resource:
 - Invalid value for field 'resource.networkInterfaces': ''. The total
 networking queue number is more than the number of vCPUs. Please specify
 the queue count for all of the interfaces.

Projects migrated to zonal DNS but VMs in new project are using global DNS

If you completed the migration of your existing projects from using global DNS to using zonal DNS, but discover that VMs in a newly created project have global DNS names, you didn't enforce the boolean organization policy constraints/compute.setNewProjectDefaultToZonalDNSOnly at an organization or folder level. This policy overrides the default DNS setting, so that newly created projects use internal zonal DNS by default.

For instructions on enforcing this policy, see Enforce zonal DNS only by default for new projects.

If you aren't using an organization policy, but instead use the metadata entry VmDnsSetting=ZonalOnly for projects or VMs, check the metadata value for the VM. If the VM has VmDnsSetting=GlobalDefault configured in its metadata, this value overrides the metadata value set at the project level.

For information about how to set project metadata or VM metadata values, see Setting custom metadata.

Hide the zonal DNS migration banner in the Google Cloud console

The zonal DNS migration notification banner provides assistance in migrating your projects to zonal DNS. If you dismiss the banner, but want it to appear again, you must contact Cloud Customer Care for assistance.

To hide the zonal DNS migration notification banner, click the Dismiss button in the banner that appears on the VM instances page of the Google Cloud console. If you click the button, the banner no longer appears for the project.