Setting Concurrency

Cloud Run locations

Cloud Run is regional, which means the infrastructure that runs your Cloud Run services is located in a specific region and is managed by Google to be redundantly available across all the zones within that region.

Meeting your latency, availability, or durability requirements are primary factors for selecting the region where your Cloud Run services are run. You can generally select the region nearest to your users but you should consider the location of the other GCP products that are used by your Cloud Run service. Using GCP products together across multiple locations can affect your service's latency as well as cost.

Cloud Run is available in the following regions:
  • us-central1 (Iowa)
If you already created a Cloud Run service, you can view the region in the Cloud Run dashboard in the GCP Console.

To understand the concurrency setting, read the Concurrency concept document.

Like any configuration change, setting the concurrency of a service leads to the creation of a new revision. Subsequent revisions will also automatically get the same concurrency setting unless you explicitly update it.

Console

Using the console, you can set concurrency at service creation or deployment time:

If you are creating a new service:

  1. Create the service using the console as described in Deploying Services.

  2. After you specify the container image URL, the service name, and the location, click SHOW OPTIONAL SETTINGS.

  3. Set the desired concurrency value in the text box Maximum requests per container:

    Set concurrency

If you are deploying a new revision of an existing service:

  1. Open the service revision deploy form using the console as described in Deploying a new revision of an existing service.

  2. Click SHOW OPTIONAL SETTINGS.

  3. Set the concurrency value in the text box Maximum requests per container.

Command line

To set concurrency, use the following command:

gcloud beta run services update [SERVICE] --concurrency=[NUMBER]

Replace [NUMBER] with the maximum number of concurrent requests per container instance. For example the following sets a maximum of 40 concurrent requests:

gcloud beta run services update [SERVICE] --concurrency=40

Changing the concurrency of a given service will capture this setting in a new revision.

To revert to the default concurrency (80), use the command

gcloud beta run services update [SERVICE] --concurrency default

Replace [SERVICE] with the name of the service you are configuring.

Was this page helpful? Let us know how we did:

Send feedback about...