gcloud preview app deploy process takes ~8 minutes, is this normal?

Ward Bekker picture Ward Bekker · Jun 7, 2016 · Viewed 15.4k times · Source

Trying out new flexible app engine runtime. In this case a custom Ruby on Rails runtime based on the google provided ruby runtime.

When firing of gcloud preview app deploy the whole process takes ~8 minutes, most of which is "updating service". Is this normal? And more importantly, how can I speed it up?

Regards,

Ward

Answer

Vikram Tiwari picture Vikram Tiwari · Jun 8, 2016

Yes, that is totally normal. Most of the deployment steps happen away from your computer and are independent of your codebase size, so there's not a lot you can do to speed up the process.

Various steps that are involved in deploying an app on App Engine can be categorized as follows:

  1. Gather info from app.yaml to understand overall deployment
  2. Collect code and use the docker image specified in app.yaml to build a docker image with your code
  3. Provision Compute Instances, networking/firewall rules, install docker related tools on instance, push docker image to instance and start it
  4. Make sure all deployments were successful, start health-checks and if required, transfer/balance out the load.

The only process which takes most of time is the last part where it does all the necessary checks to make sure deployment was successful and start ingesting traffic. Depending upon your code size (uploading code to create container) and requirements for resources (provisioning custom resources), step 2 and 3 might take a bit more time.

If you do an analysis you will find that about 70% of time is consumed in last step, where we have least visibility into, yet the essential process which gives app-engine the ability to do all the heavy lifting.