In our repo we have a cloudrun.yaml
with the metadata as follow
metadata:
annotations:
run.googleapis/network-interfaces: '[{"network":"${GCP_VPC}","subnetwork":"${GCP_SUBNET}","tags":["${NETWORK_TAG}"]}]'
run.googleapis/vpc-access-egress: all-traffic
run.googleapis/startup-cpu-boost: 'true'
autoscaling.knative.dev/minScale: ${MIN_SCALE}
autoscaling.knative.dev/maxScale: ${MAX_SCALE}
run.googleapis/execution-environment: gen2
run.googleapis/cpu-throttling: 'false'
run.googleapis/concurrency: '4'
The problem is that after deploying via cloudbuild the Max Concurrent Requests changes to 80 and this is causing problems because our app isn't designed to handle more than 4 concurrent requests per instance each minute, so we rely on the scaling of additional instances.
What I'd like to know is, why is the 4
value being ignored or overwritten by 80
? Is it because we have cpu-throttling set to false
or something else? When we change it to 4
in the GCP Console and deploy the new revision it works fine.
We don't have this set in the build and deploy steps, it's only set in our cloudrun.yaml
We expected the set concurrency
to match once deployed but it doesn't
In our repo we have a cloudrun.yaml
with the metadata as follow
metadata:
annotations:
run.googleapis.com/network-interfaces: '[{"network":"${GCP_VPC}","subnetwork":"${GCP_SUBNET}","tags":["${NETWORK_TAG}"]}]'
run.googleapis.com/vpc-access-egress: all-traffic
run.googleapis.com/startup-cpu-boost: 'true'
autoscaling.knative.dev/minScale: ${MIN_SCALE}
autoscaling.knative.dev/maxScale: ${MAX_SCALE}
run.googleapis.com/execution-environment: gen2
run.googleapis.com/cpu-throttling: 'false'
run.googleapis.com/concurrency: '4'
The problem is that after deploying via cloudbuild the Max Concurrent Requests changes to 80 and this is causing problems because our app isn't designed to handle more than 4 concurrent requests per instance each minute, so we rely on the scaling of additional instances.
What I'd like to know is, why is the 4
value being ignored or overwritten by 80
? Is it because we have cpu-throttling set to false
or something else? When we change it to 4
in the GCP Console and deploy the new revision it works fine.
We don't have this set in the build and deploy steps, it's only set in our cloudrun.yaml
We expected the set concurrency
to match once deployed but it doesn't
1 Answer
Reset to default 1Managed to work it out, I had to change the above to the below
spec:
template:
metadata:
annotations:
run.googleapis.com/network-interfaces: '[{"network":"${GCP_VPC}","subnetwork":"${GCP_SUBNET}","tags":["${NETWORK_TAG}"]}]'
run.googleapis.com/vpc-access-egress: all-traffic
run.googleapis.com/startup-cpu-boost: 'true'
autoscaling.knative.dev/minScale: ${MIN_SCALE}
autoscaling.knative.dev/maxScale: ${MAX_SCALE}
run.googleapis.com/execution-environment: gen2
run.googleapis.com/cpu-throttling: 'false'
run.googleapis.com/container-dependencies: '{app: [otel]}'
spec:
serviceAccountName: ${GCP_SERVICE_ACCOUNT}
containerConcurrency: 4
containers: