firebase-functions
firebase-functions copied to clipboard
Max number of instances.
Deployed the v1 event-driven cloud function with the following configuration:
"dependencies": {
"firebase-admin": "^11.3.0",
"firebase-functions": "^4.1.0"
},
"engines": {
"node": "16"
}
The function is without runWith configuration.
After deploying, the firebase console automatically shows the max instance limit of 3000.

Is 3000, the default max limit?
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
EDIT Turns out I was stuck on an old version of firebase-tools, due to having multiple Node installations (NVM). After fixing the problem, my error went away.
ORIGINAL POST
Getting a probably related error:
Error: Failed to parse build specification:
- FirebaseError Expected endpoints[createNewBillingMonth].minInstances to be a number; was object
This happens when deploying using firebase deploy --only functions.
This is in a function that has a runWith that looks like this:
export const createNewBillingMonth = region('europe-west1')
.runWith({
timeoutSeconds: 540,
memory: '1GB',
})
If I fill out minInstances, it starts complaining about maxInstances
@taeold Can you please look into it?
Picking up this for investigation, the endpoint that generates the YAML contract that configures the function on GCP/Firebase sets the maxInstaces to null. According to the contract as far as I know, the default maxInstances is supposed to be 1000
Hi @deepak786
This is the default max instances. You can change the maximum number of instances, like the following:
export const helloWorld_v1 = v1.runWith({
maxInstances: 10,
}).https.onRequest((request, response) => {
response.send("Hello from Firebase Functions!");
});
export const helloWorld_v2 = v2.https.onRequest({
maxInstances: 10,
}, (request, response) => {
response.send("Hello from Firebase Functions!");
});
Thank you for opening this issue. I'm going to close this here. If you have further questions or problems, feel free to reply (and I'll reopen) or open a new issue.