dehamzah
dehamzah

Reputation: 1393

How can i access cloud run instance on the same region without going over to internet?

I have 2 cloud run instance A and B on the same region. How can i call the B instance from A instance, without going to the internet?

Currently i call them using the instance url (mapped to my domain), and the response is slow.

Cloud run automatically gives me the instance url like this for example:

and i am mapping that instance to my own domain to:

I call https://my-cloud-run-b.mydomain.com from my cloud run A. Is this matters?

Upvotes: 1

Views: 258

Answers (1)

John Hanley
John Hanley

Reputation: 81336

Google Cloud does not publish specific details on network traffic routing for Google Cloud Run.

For Google Cloud services in the same region, traffic typically stays within Google's backbone. There is no reason for traffic to leave Google's network to re-enter at the same location (region).

I have 2 cloud run instance A and B on the same region. How can i call the B instance from A instance, without going to the internet?

At this time, you have no control over how traffic is routed. Google Cloud Run is a managed service.

Currently i call them using the instance url, and the response is slow.

What is slow? It is highly unlikely that the response time is affected by Google Cloud networking. Most likely the delay is caused by cold starts. Check your Stackdriver logs for messages about your Cloud Run service. Also, check how long your container takes to become ready and respond to requests (test in a local Docker container).

Upvotes: 4

Related Questions