GAE "CPU time" pricing

253 views
Skip to first unread message

sampablokuper

unread,
Nov 20, 2010, 8:41:07 AM11/20/10
to Google App Engine
Judging by a conversation I had on #appengine at irc.freenode.net, I'm
clearly not the only person baffled by GAE pricing, so I figured I'd
throw this up here and ask for clarity. Essentially: given an app with
the figures below, what should its "CPU time" bill be per year?

Suppose:
h = Google App Engine's charge per hour for CPU time. Currently, h =
$0.10
f = Google App Engine's daily free quota of CPU hours. Currently, I
think* f = 2853.5
t = total registered users
s = simultaneous users. Assume = t * 0.2
e = (requests/second)/simultaneous user. Assume = 0.5
r = requests/sec = s * e
R = requests/day = r * 3600 * 24
p = CPU hours/request. Assume 150ms/request. I.e. assume p = 0.15/3600
c = CPU hours/sec = r * p
C = CPU hours/day = c * 3600 * 24
y = average number of days in a year = 365.25 B = CPU time bill per
year = (C - f) * h * y

Therefore, C = t * 0.2 * 0.5 * (0.15/3600) * 3600 * 24
So suppose I get 10000 registered users, that means C = 3600.

In that case:
B = (3600 - f) * h * y = 9146.5 * $0.10 * 365.25 = $40415 to the
nearest dollar

Is that right, or have I misunderstood what CPU time is, how it is
priced, or how the quotas work?

*The free daily quota[1] is not clearly expressed, but I think it's
6.5 hours for general use plus 2,487 hours for datastore manipulation:
2853.5 hours/day in total, assuming that my app mostly spends its time
handling requests by using a controller to generate views on the
models in the datastore, and allowing CRUD operations on those models.

[1]http://code.google.com/appengine/docs/quotas.html

Nick Johnson (Google)

unread,
Nov 21, 2010, 8:12:24 PM11/21/10
to google-a...@googlegroups.com
On Sun, Nov 21, 2010 at 12:41 AM, sampablokuper <sampab...@googlemail.com> wrote:
Judging by a conversation I had on #appengine at irc.freenode.net, I'm
clearly not the only person baffled by GAE pricing, so I figured I'd
throw this up here and ask for clarity. Essentially: given an app with
the figures below, what should its "CPU time" bill be per year?

Suppose:
h = Google App Engine's charge per hour for CPU time. Currently, h =
$0.10
f = Google App Engine's daily free quota of CPU hours. Currently, I
think* f = 2853.5

Per the page you link to, "Datastore CPU cycles also count toward the CPU Time quota.". You get 6.5 hours of free CPU time per day.
 
 
t = total registered users
s = simultaneous users. Assume = t * 0.2

20% of your users online at any time would be extremely high for any webapp.
 
e = (requests/second)/simultaneous user. Assume = 0.5

1 request per 2 seconds per user is also extremely high. I think you would be hard pressed to find any webapp that averages anything close to this.

With these two figures, you're assuming every single user of your webapp averages over 8,000 (dynamic) requests per day.
 
r = requests/sec = s * e
R = requests/day = r * 3600 * 24
p = CPU hours/request. Assume 150ms/request. I.e. assume p = 0.15/3600
c = CPU hours/sec = r * p
C = CPU hours/day = c * 3600 * 24
y = average number of days in a year = 365.25 B = CPU time bill per
year = (C - f) * h * y

Therefore, C = t * 0.2 * 0.5 * (0.15/3600) * 3600 * 24
So suppose I get 10000 registered users, that means C = 3600.

In that case:
B = (3600 - f) * h * y = 9146.5 * $0.10 * 365.25 = $40415 to the
nearest dollar

Is that right, or have I misunderstood what CPU time is, how it is
priced, or how the quotas work?

Given your assumptions, this figure would be correct, but you will find that actual costs and usage will be orders of magnitude less than this. Note that your math works out to a sustained rate of 1000QPS, which would require a small cluster of computers to sustain it on any architecture. I don't think you'll find any webapps with only 10,000 users that do even a tenth of that QPS.

-Nick Johnson

*The free daily quota[1] is not clearly expressed, but I think it's
6.5 hours for general use plus 2,487 hours for datastore manipulation:
2853.5 hours/day in total, assuming that my app mostly spends its time
handling requests by using a controller to generate views on the
models in the datastore, and allowing CRUD operations on those models.

[1]http://code.google.com/appengine/docs/quotas.html

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.




--
Nick Johnson, Developer Programs Engineer, App Engine
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047

sampablokuper

unread,
Nov 22, 2010, 3:19:28 PM11/22/10
to Google App Engine
On Nov 22, 1:12 am, "Nick Johnson (Google)" <nick.john...@google.com>
wrote:
> Given your assumptions, this figure would be correct,

Thanks, Nick :)
Reply all
Reply to author
Forward
0 new messages