Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud Run - "Send traffic directly to a VPC" makes traffics to a different cloud run extremely slow

I have two cloud run instances A and B.
A and B make calls to each other.

Here is the network setup for A

thisisfine_1-1723244527516.png

And here is a network setup for B

thisisfine_2-1723244595229.png

The problem starts when I control the outbound of B
When I make B to "send traffic directly to a VPC" + "route only requests to private IPs to the VPC"
All the calls to A now takes about 2 minutes. I'm very confused because A calling B via VPC traffic works fine. Please let me know if I'm missing anything.

0 2 796
2 REPLIES 2

Hi @thisisfine,

Welcome to Google Cloud Community!

Based on your provided configuration, traffic routes to the internet during the call from B to A which caused the delay(possibly from the overall health/congestion of the internet network and hops(devices or servers the traffic passes through). It is recommended that you set Ingress Control on Cloud Run instance A to Internal, and then allow traffic from external Application Load Balancers:

diannemcm_0-1723816007294.png

This will require you to create Serverless NEGS and external load balancer which will provide a single address to point your serverless app to. Traffic to be distributed effectively and the service to run smoothly. See Set up a global external Application Load Balancer with Cloud Run

Note: Serverless NEGs allow you to use Google Cloud serverless apps with external Application Load Balancers. After you configure a load balancer with the serverless NEG backend, requests are routed to the serverless app backend.

For Cloud Run instance B, you can attach a VPC with the same configuration on Cloud Run Instance A. Traffic routing: route only requests to private IPs to the VPC. Directing network traffic to its intended destination.

diannemcm_1-1723816075224.png

I hope the above information is helpful.

Thank you very much for the suggestion. I will try this and let you know the outcome.