Sunday, April 15, 2012

Quick Google App Engine RSA Benchmark

Update: Please read Strom's comment. He explains everything. I wasn't aware of the 15 minutes rule.

Generating a 2048-Bit RSA key with the Google APP Engine takes about 10 seconds at average. On my PC, it takes 2 seconds. I called the service six times on a clean app engine account. This resulted in 0.30 frontend machine hours being consumed. So even though I used the CPU for one minute in total, Google charges about 20 minutes (0.3 hours).

At a price of 0.08$ per hour, generating a 2048-Bit RSA key costs about half a cent. Or in other words: my cpu (intel i7, 2.8 GHz) can do about one app engine machine hour in 40 seconds. This means, doing one hour of heavy-duty calculations on my CPU would cost me about 8$ of frontend machine hours at Google.

My conclusion: Google app engine is too expensive for my intended application, unless backend machine hours differ significantly from frontend machine hours.

For reference, the core code of my servlet:

KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(2048);
KeyPair kp = kpg.genKeyPair();