Auto scaling with Google App Engine Part 1

This post provides a quick run through of using Google App Engine to host a simple REST application developed with Jersey ( I read the tutorial ( to get going but decided to use Google App Engine for hosting as I’m interested in cloud auto scaling features.

My test application allows me to either request a method waits by using Thread.sleep() or consumes CPU by looping through the creation of a String. The length of time the application will wait and the number of thousand times a String will be created in the highCpu scenario is specified by the amount. The application exposes a REST interface which takes two parameters as below:
// This method is called if the request is HTML
       public String doProcess(
                     @QueryParam("processType") String processType,
                     @QueryParam("amount") int amount

              ) {

The process type can either be called slowProcess or highCpu and gets used as below.

       public void consumeCpu(int amount){
              for (int i = 0; i < amount * 1000; i++){
                     String s = new String("");
       public void timedMethod(int delay){
              log.debug("about to sleep thread for " + delay + "ms");
              try {
              } catch (InterruptedException e) {
                     log.error( e);



Enough of the code how do you get it running on Google’s servers? First you must use Google’s SDK which is available as an Eclipse plugin as described in That article refers to using up to Eclipse 3.6 Helios however a bit more searching takes you to which provides the download details for the 3.7 Indigo release I’m using. In Eclipse using Help -> Install New Software… You add the to the Work With field as below.