最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

GCP Cloud Run setting different max concurrency than in our repo - Stack Overflow

programmeradmin1浏览0评论

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

Share Improve this question asked Feb 6 at 11:37 CJSCJS 111 silver badge1 bronze badge New contributor CJS is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Add a comment  | 

1 Answer 1

Reset to default 1

Managed 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:
发布评论

评论列表(0)

  1. 暂无评论