Skip to content

Conversation

@efiShtain
Copy link
Contributor

@efiShtain efiShtain commented Feb 27, 2020

Description

This is a matching change on firebase-tools to allow passing maxInstances parameter when creating or editing a function
firebase/firebase-tools#1998

Code sample

import * as functions from 'firebase-functions' functions .runWith({ maxInstances: 1 }) .pubsub.schedule('every 1 minutes')
@samtstern
Copy link
Contributor

@joehan can you either take a look at this or assign to someone else? It would need to go through API review but first we need to know if we want to do this.

There is a paired PR on firebase-tools to make it actually work.

@efiShtain
Copy link
Contributor Author

@samtstern
just a friendly ping. anything I can do to speed up the process?

Copy link
Member

@joehan joehan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, we'll just need to get this API reviewed.

@joehan
Copy link
Member

joehan commented Mar 16, 2020

Hey @efiShtain, we just added this proposal to our 3/19 API review meeting. Thanks so much for working on this - I'll update here again after the meeting.

@joehan
Copy link
Member

joehan commented Mar 19, 2020

This was approved! Thanks again for working on this!

@joehan joehan changed the title add supprt for maxInstances in RuntimeOptions add support for maxInstances in RuntimeOptions Mar 19, 2020
@joehan joehan merged commit bf52fa3 into firebase:master Mar 19, 2020
@bolds07
Copy link

bolds07 commented Apr 24, 2020

How does google server take in consideration the maxInstances value?
imho this is just a placebo parameter... there isnt any side effects of changing it...

I've a function with maxInstances set to 1... this function does simple return the currentTimeMillis so takes maximum 0.3 seconds to run (worst case).

AND STILL GCF HAS 200 INSTANCES OF IT

Clipboard01

so what is the point of that?
Documentation says that infrastructure will "try the best" to reach the maxInstances set but with no garantee and SOMETIMES the current instances value will exced it...

well as my graph shows THERE WASNT ANY TIME wihtout exceeding the maxInstances set... and most of the time it was 15.000% over the desired value...
15.000% in what plannet this is an acceptable deviation?

im sorry if i'm being rude but it is clear that this whole parameter is just a waste of time for either you engineer team as for any developer trying to use your infrastructure

@mbleigh
Copy link
Contributor

mbleigh commented Apr 24, 2020

@bolds07 I'd recommend writing in to Firebase support with details of how you configured your function and what you tested to try out maxInstances. This repo is for dealing with issues with the firebase-functions SDK, and since I see "Maximum function instances" seems to be set correctly I don't think there's any action to take on the SDK side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6 participants