firebase / firebase/firebase-functions

Support runtime API to update minInstances for Firebase Functions v2

Open
#1,710 3 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
TypeScript
Stars
1.1k
Forks
232
Avg merge
20h 46m
Merged PRs (30d)
15

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.