-
Notifications
You must be signed in to change notification settings - Fork 217
Description
Firebase Functions v2 allows us to set minInstances via runWith() or firebase.json at deploy time. However, there is currently no way to update this value programmatically at runtime (e.g. via REST API or Admin SDK).
Use case:
We want to scale a function up or down (e.g. from 0 to 5 min instances) based on time or usage pattern.
For example:
• Increase minInstances at 8:00am before peak hours
• Reduce minInstances back to 0 at 8:00pm to save costs
This kind of time-based or traffic-driven scaling works great in Cloud Run (via Admin API PATCH), but fails on Firebase Functions v2 because the underlying Cloud Run service is not modifiable via API (returns 404).
Proposal:
Expose a way (via Firebase Admin SDK or REST API) to update minInstances on deployed Functions v2 services without requiring a full firebase deploy.
Why it matters:
• It avoids unnecessary redeploys
• Allows dynamic cost-saving patterns
• Fits the modern serverless scaling expectations