Jon,

Thanks for that explanation, but if it's authoritative (not meaning to sound 
rude, but I hope .. I take it you're on the AppEngine team rather than a 
user explaining your understanding of how pricing applies) then it perhaps 
illustrates what many of us may be worried about, and maybe a more detailed 
explanation of the scheduler and 15-minute rule may put some minds at rest 
and reduce some of the hostility to the new billing scheme.

It's the sort of thing that can be easily explained in person, but can be 
hard to get across on paper, so let me explain how I may have previously got 
the wrong impression and been more alarmed than you may consider seems 
appropriate.

Everything I've read about the "15 minute minimum instance" would imply in 
the above scenario described that the billing would be 

Time Period: [0:5] - 4 active instances
Time Period [5:20] - 4 active instances running for their 15 minute minimum 
idle time since last query
Time Period [20:inf] - 0 active instances (ie some of the above may still be 
idling awaiting being killed, but wouldn't be billed)

This would give a charge of 80 minutes, as opposed to 35 as explained by 
yourself - I might have set min-idle-instances to 1, but I understood that 
once an instance was started it would be charged for instance time until 15 
minutes after it's last activity.

Now I'm willing to take it that you're right, but the pricing as explained 
so far has led me to believe that the rule is

[explanation #1]
 - ANY instance, once started, will not be eligible to be killed until at 
least 15 minutes after last activity, and thus will lead to at least 15 
minutes billing each
 - Instances will be started up according to traffic demands
 - Instances will be killed off when the number of "instances that have each 
gone BEYOND their 15 minutes since their last activity" exceeds 
"max-idle-instances"

And the thing that worried me about the above understanding was that if, in 
the period [5:20], there were a few queries (say 1 query a minute) then the 
scheduler might hand these round-robin style to the 4 idling instances, 
thereby keeping 4 instances active for much longer, rather than giving them 
repeatedly to the same single instance and thereby killing instances 2,3 and 
4 at the 20 minute mark.

This is what was alarming me - the impression that, given the odd short 
burst of traffic (say a busy minute once every couple of hours) that started 
up a handful of extra instances, then the scheduler might keep all these 
instances hanging around for ages, each running mostly idle but sharing the 
"normal load", and thus leading to a massive bill following each burst no 
matter how short.

Now you seem to be saying that this reading is incorrect (to which I and 
many others may understandably say "phew!") and the rules are more like

[explanation #2]
 - Instances, once started, are kept in a list ordered by start time
 - Any activity causes the list to be checked in order (ie first started 
checked first) for a free active instance, and assigned to the first one 
that is idle
 - If none are idle, the query will be queued up to "max-pending" time to 
see if any instance becomes free before a new instance is started
 - Each time an instance in the list finishes serving a query, the scheduler 
checks how many instances are actually busy, and if the number exceeds 
max-idle-instances, then it chooses instances from the END of the list (most 
recently started) to kill (or logically killed as in stopped being billed 
and removed from the list)
 - 15 minutes after any instance last serviced a query, it is killed (or 
logically...) regardless of max-idle-instances unless that would breach 
min-idle-instances

Now I'd understand if the above has approximations (eg extra pauses in the 
above), or has got some details wrong, or you don;t want to commit to 
PRECISELY how it works so you can change it in future and in fact what 
happens is you don't do all these checks in realtime (other than choosing 
what instance to assign etc) but then apply the logic afterwards for billing 
purposes (ie you tend to err on keeping things active in case they're 
needed, but bill as if they'd been killed off according to the rule above).

But if scheduling (of queries to instances), and billing (of instance time) 
is closer to explanation #2 than #1, then I could probably live with the "15 
minute" rule, but I'd hope you could also see that if the scheduler works 
more like #1 than #2 then that would be why so many of us are worried about 
"15 minutes" and would like to see that interval dropped to more like "2 
minutes" !

An authoritative explanation of the intent (there's that word again Greg) of 
the scheduler / billing logic would be more than welcome and may reduce the 
gap between why you guys think the pricing is reasonable and many of us in 
here think it's not.

Cheers

--
Tim

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/bDbsEmTyuFgJ.
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.

Reply via email to