Hi Tammo, Let me summarize the case you describe, to make sure I get it right. First, the app has a period of five minutes, wherein there are four instances that are active the entire five minutes. Then, the app gets no more traffic all day. Also, you have max-idle-instances set to 1.
It helps here to refer to the billing formula to understand this. Below, total-instances refers to the blue line on the graph, and is computed according to the +15-minutes-since-last-request formula, whereas active-instances refers to the orange line on the graph, and is based solely on active requests (and no 15-minute logic). billable-instances-rate = min(active-instances-rate + max-idle-instances, total-instances-rate) So, for time period [0:5], this expression evaluates to min(4+1,4)=4, for the time period [5:20] the expression evaluates to min(0+1,4)=1, and then for the time period [20:inf] the expression is min(0+1,0)=0. As such, what will actually happen is a different outcome altogether from the ones listed above: "Phew": Charged for 5 minutes of 4 instances, followed by 15 minutes of 1 instance, followed by nothing, for a total of 35 instance-minutes. On Mon, Sep 5, 2011 at 3:24 PM, Tammo Freese <[email protected]> wrote: > Hi Greg, > > On Sep 5, 9:21 pm, "Gregory D'alesandre" <[email protected]> wrote: >> If you serve 1 >> request, you'll likely get 1 instance spun up to serve the request, then >> after you have served the request the instance will go away after 15 >> minutes. This is the behavior you should be seeing today. > > Let's say I have an app that gets a traffic spike at the start of the > billing day, lasting for 5 minutes, and leading to 4 instances being > fired up. There is no other traffic the whole day. Max idle instances > is set to 1. > > Is it possible to predict how many minutes of the quota that consume? > Of course I would love the answer to be simply 20 minutes (5x4 > minutes), but I'm sure that's wrong. Here are 4 scenarios I could come > up with ranging from 80 minutes up to 1,560 minutes: > > "Die Instance Die!" > The scheduler notices the drop to zero traffic and kills off all > instances immediately. For each instance 5 minutes + 15 minutes > startup fee (see FAQ) = 20 minutes. 80 minutes overall. > > "15 Minutes Of Paid Idling" > The scheduler lets all instances run 15 minutes after the last request > and kills them off then. The 15 minutes count as idle time, however. > Because max idle instances is set to 1, we get 5 minutes + 15 minutes > startup fee + 15 minutes idle time for one instance, and for the other > three 5 minutes + 15 minutes startup fee. 95 minutes overall. > > "60 Minutes Of Paid Idling" > Same as before, but the 15 minutes the instances are kept running do > not count as idle time (idle time only being time after the 15 minutes > without traffic). 35 minutes per instance, 140 minutes overall. > > "Evil Laugh" > Same as before, but the scheduler keeps 1 instance running as long as > it wants to. Max Idle instances is 1 (and currently cannot be set to > 0), so that would be perfectly "legal". One instance up to 1,440 > minutes (one day) + 15 minute startup fee, the other three 35 minutes > per instance. Up to 1,560 minutes overall. > > I included the last scenario to show how unpredictable the new billing > feels to me. > > > So, which one is it? > > Tammo > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
