r/programming • • Apr 16 '12

Google App Engine: CPU hours very expensive according to RSA benchmark

http://programmersbraindump.blogspot.com/2012/04/quick-google-app-engine-rsa-benchmark.html
0 Upvotes

31 comments sorted by

39

u/brianolson Apr 16 '12

Nothing to see here, the linked post completely neglects the known 15-minute-minimum-charge for AppEngine instances and then does math that is all wrong. I was hoping for more because I'm bitter about AppEngine pricing too and how the app I was working on got 5x more expensive at some point last year.

12

u/haldean Apr 16 '12

This benchmark is completely wrong. The 20 minutes of frontend time is because App Engine started a frontend instance to handle the request, and then kept it alive until it became clear he wasn't going to get any more requests. As he says, the actual calculation only took 10 seconds. He could hit his frontend instance once every 10 seconds for an hour for a price of $0.08 an hour as well, which would correspond to around 12 CPU-minutes on his computer, so around 2/3rds of a cent per minute.

1

u/quotemycode Apr 16 '12

It may be $0.08 an hour, but if he uses it for only a full hour, app engine will still keep it running for 15 minutes after the last request, which means it would be $0.08 (for the hour) and $0.02 (for the 15 minutes it waited after the last request). So, $0.10. So, the more he uses it, the more he comes close to $0.08 per hour, but it's always going to be $/hr + (($/hr)/4)

1

u/haldean Apr 16 '12

Same argument as above; let x = $/hr. If he uses it for one hour every time, it will be x + 0.25 * x. If he uses it for n hours, though, it's nx + 0.25x. For largish n, the 0.25x term is negligible. I would think that, for most web services, continuous processing is a more realistic model than very rare one-off computations.

18

u/[deleted] Apr 16 '12

"RSA benchmark" makes it sound like testing carried out by the RSA, or using a test suite designed by them, when in fact it's just some guy generating a single RSA key. This post is almost fractally wrong, for the reasons given by the first commenter.

5

u/radrik Apr 16 '12

And prefacing it with "Google App Engine:" makes it sound like Google is saying it.

20

u/JoachimSchipper Apr 16 '12

Note that GAE may or may not have start-up and tear-down costs; the benchmark does not seem to handle those.

8

u/wadcann Apr 16 '12

If it's possible that short tasks are representative of what are used by an end user and the end user is indeed charged for those resources, though, the numbers would still seem to be valid; if GAE imposes overhead and charges the user for that overhead, the overhead costs do still matter.

2

u/quotemycode Apr 16 '12

It does have start-up and tear-down costs. It's about half a second on my apps, but those are python.

8

u/Gotebe Apr 16 '12

Expensive compared to what? (Not my intention to imply anything, it's just a question on pricing between various cloud offerings, e.g. Google/Amazon/MS)...

16

u/[deleted] Apr 16 '12

Prior to the last price change GAE was a pretty good deal, but the price bump made it ridiculously more expensive for a lot of use-cases. At a prior employer we had an app running on app engine that was costing about 6$ a month and post-price change it shot up to over $300 a month. We ended up moving it over to a Linode that cost $20 a month and getting about the same performance. Even if you want to stick with cloud-style scalabilty, Amazon tends to be a lot cheaper and perhaps more importantly easier to predict (the way google calculates instance hours is still, afaict, somewhat black magic and difficult to plan for until you actually deploy your app).

Of course, YMMV greatly depending upon exactly what it is you're doing, but GAE's pricing model is generally not very attractive if you're a bit too big to fit into the free quotas but your app is too non-business-critical to warrant multihundreds/thousands of dollars per month in fees.

Having said all of that, other than the pricing I really loved GAE. The APIs were great and the seamless push-to-cloud functionality it had built into Eclipse was fantastic.

1

u/[deleted] Apr 16 '12

We ended up moving it over to a Linode that cost $20 a month and getting about the same performance

If you only needed a single machine, why did you even go with Google App Engine then?

6

u/ObligatoryResponse Apr 16 '12

It used to cost them $3/mo. I suspect price was a factor in their original decision.

1

u/[deleted] Apr 16 '12 edited Apr 16 '12

Functionally, how is Amazon Web Services compared to Google App Engine? Or Linode?

I'm having a hard time imagining anything that could beat AWS in terms of function.

2

u/Kyrra Apr 16 '12

They are all different beasts.

Linode is a standard VPS (virtual private server) host. You have to fully maintain the linux installs on the boxes, but you have total control. You pay a set monthly fee for a set amount of hardware.

With AWS you can easily create and teardown various services, and may only be charged for the usage time on those systems. But your code only runs on the AWS systems you create.

GAE auto-scales the hardware you run on. You just upload your AppEngine compatible code and it runs it on however many machines are required to handle the number of incoming requests. You get charged by usage.

2

u/Shaper_pmp Apr 16 '12

Expensive compared to what?

From TFA, he's comparing it to the (negligible) cost of local machine cycles.

Obviously it'll always cost more to run things in the cloud than your local machine (even amortizing the cost of the machine over all the CPU-hours you ever get out of it), but if your local machine cost anything like $8 per CPU-hour to run code on you'd certainly know about it (eg, because almost no-one would be able to afford a home computer). ;-)

12

u/schettino72 Apr 16 '12

I guess the way the benchmark was done completely wrong.

Tip: try create to run your code more than a few seconds if you are looking at cost per hour.

4

u/gilgoomesh Apr 16 '12

You are correct in the context of the analysis in the article but if the author had intended to test overheads to transactions, it would have been valid for the test to be 1 calculation, wait for cool-off, measure cost of transaction, and only then repeat. This style of test would be particularly valuable if you expect all usage to be short, isolated transactions.

I guess what the article should have concluded is that Google App Engine works badly for short, isolated transactions.

2

u/schettino72 Apr 16 '12

I am pretty sure the overheads will be very very far away from the free quota.

by the way: appengine include some headers in the HTTP with an estimate of the cost:

X-AppEngine-Estimated-CPM-US-Dollars: $0.000762
X-AppEngine-Resource-Usage: ms=42 cpu_ms=28 api_cpu_ms=0

if you trust them of course :)

2

u/Bhima Apr 16 '12

I'm no expert but I think if you're going to make a broad claim like "CPU hours are very expensive" you should have broad metrics to support it... Not just one quick & dirty example.

2

u/willvarfar Apr 16 '12

Am I the only one who shuddered to see someone generating keys for anything on a cloud instance?

I guess its not a big deal, but it feels really wrong.

8

u/lethalman Apr 16 '12

That's not the point of the post.

3

u/willvarfar Apr 16 '12

First, it was just an observation; I didn't write it in a particularly accusing way.

Secondly, if we give the author the benefit of the doubt, the author was just using RSA benchmark in lieu of their real app load?

If so, extrapolating that result to be applicable to their actual not-discussed use-case is just crazy.

11

u/Cryocore Apr 16 '12

key generation is a CPU bound process, where the only bottleneck would be the CPU and not network, input etc

Since we are talking about GAE CPU Hours, it makes sense

6

u/cballowe Apr 16 '12

But if nothing has been done to tune the app engine instance, you'll have startup and teardown overhead. There's quite a few things that could be done. http://point7.wordpress.com/2011/09/03/the-amazing-story-of-appengine-and-the-two-orders-of-magnitude/ and the articles that follow it cover a decent chunk of the tuning things. That article in particular covers a few key points, and covers some of the tuning of instance startup/tear down up front before getting into anything related to the datastore.

0

u/[deleted] Apr 16 '12

[deleted]

0

u/Cryocore Apr 16 '12

I'm not sure how reliable/accurate his benchmark is (never used gae), He claims to execute the call 6 times (each taking 10 seconds in GAE), so a total of 60 seconds on the GAE servers. Then he claims that google charged 0.3 hours front end usage hours for that 60 seconds of usage time.

Since he is trying in a fresh instance, could be startup / tuning issues like others mentioned

0

u/evereal Apr 16 '12

If so, extrapolating that result to be applicable to their actual not-discussed use-case is just crazy.

I'm not sure what you mean, generating RSA keys is an entirely valid requirement for a web-app or web service. I assumed that is his actual use case, which he then did some benchmarks on.

-2

u/willvarfar Apr 16 '12

A web server that generates a key is seeing the private key. What use-cases is this a good idea?

5

u/evereal Apr 16 '12

Perhaps the web server is the one to use the private keys directly? I.e. it then sends the pub key to another service, and keeps the private key to use itself.

I can think up a number of conceptual webapps, which might provide a managed web front-end to other services which are based on public key cryptography, without the user having to deal with keys or key generation.

1

u/askvictor Apr 16 '12

Infrastructure and maintenance costs?

0

u/[deleted] Apr 16 '12

[deleted]

1

u/Tafkas Apr 16 '12

What do you mean by you hosted your Android game there? Was the Android a client to a server running on GAE?