Hynek Blaha
Hynek Blaha

Reputation: 131

AppEngine Standard + cloud tasks - max concurrent requests

CloudTask queue never runs more than 10 tasks in parallel on a single instance of GAE Standard(B2). What is a reason of this limit?

Additional info:

I need to process hundreds of long running tasks (which are I/O bound - using 3rd service API).

These tasks are served from CloudTask queue.

queue.yaml

- name: slow-queue
  max_concurrent_requests: 40
  target: slow-instance

Currently, I am running a single app engine flex instance with gevent worker. It works fine, but I don't like the long deployment times ~10min.

I would like to switch from flex to standard backend instance. Because of:

The default deadline depends on the scaling type of the service: 10 minutes for standard apps with automatic scaling, 24 hours for standard apps with manual and basic scaling, and 60 minutes for flex apps.

app.yaml

service: slow-instance
runtime: python37
instance_class: B2

entrypoint: gunicorn main:app --workers 2 --threads 15

manual_scaling:
  instances: 1

No matter how many threads I define in gunicorn, the cloud task queue never runs more than 10 tasks in parallel. I cannot find why is it so.

My guess

Upvotes: 0

Views: 597

Answers (1)

Samuel Romero
Samuel Romero

Reputation: 1263

The reason why you are getting only 10 requests is because you are using manual scaling. Currently, max_concurrent_requests is only available using automatic_scaling.

If you need the 24 hours time for HTTP requests, maybe if you open a Support Case with GCP you could change the max_concurrent_requests.

Upvotes: 0

Related Questions