Unexpected 429/503 errors with max_instances set to 0 in Cloud Functions
0 reputation · 13 Feb 2023, 11:45 UTC
Scaling limits in Cloud Functions (2nd gen)
When configuring a Cloud Function, setting max_instances to 0 is intended to remove the explicit upper bound on the number of concurrent instances the platform can spin up to handle incoming traffic.
However, there is uncertainty regarding whether an internal platform hard cap exists that overrides this "unlimited" setting. It is unclear if the platform enforces a hidden ceiling on instance counts for resource management, which could lead to request queuing or failures despite the configuration.
Additionally, the interaction between this setting and the per-instance concurrency limit is not fully documented. If a function is configured for high concurrency but max_instances is 0, it remains uncertain which mechanism triggers a throttle when the platform's implicit capacity is reached.
- Does Google Cloud enforce a hidden maximum instance limit when
max_instancesis set to 0? - How does the platform signal that this implicit limit has been reached (e.g., specific HTTP error codes or increased latency)?
- Does the per-function concurrency setting influence the threshold at which the platform stops scaling new instances?