2

I'm migrating some simple web apps (Node based static pages with some questionnaires and a very small amount of back end processing) to App Engine. I have them working well. Impressed with how easy it was!

However, I have a couple of questions that baffle me.

1) Why does GCE always deploy 2 machines? Is there a way of specifying to only run 1? I really don't need loads of redundancy, and our traffic is expected to be light.

2) I have tried to specify the machine type in app.yaml to be 'micro'. Call me cheap, but we really don't need much capacity. I have tried various perameters e.g.

resources:
  cpu: .5
  memory_gb: .2
  disk_size_gb: 10

but it always seems to deploy 'small' machines. Is there a log somewhere that would tell me that the commmand was valid, but it chose to ingore it?

Thanks in advance.

Justin Beckwith
  • 7,686
  • 1
  • 33
  • 55
Peter Coghill
  • 381
  • 2
  • 13

2 Answers2

3

Ah ha! Sorry, with a bit more googling around I found an answer to Q2

Setting f1-micro resource limits in app.yaml for google cloud compute node.js app without vm_settings

As Jeff and Greg both replied, "Google adds a little overhead on the VM before picking a machine type. This is around 400mb of ram. So they told me if you want an f1-micro try requesting .2 or lower as Greg mentioned."

I had to drop to .18 to get it to deploy as f1-micro, but the general idea that google is adding overhead is solid.

Dropping down the memory_gb to 0.18 did the trick.

Simply adding

resources:
  cpu: .5
  memory_gb: .18
  disk_size_gb: 10

and deploying with the command

gcloud preview app deploy --stop-previous-version --force --promote

to make damn sure it was made #1 seemed to work - no loss in performance so far.

Community
  • 1
  • 1
Peter Coghill
  • 381
  • 2
  • 13
3

You can also specify machine type, not just required resources. By adding into app.yaml:

beta_settings:
  machine_type: f1-micro

Also, if you want to always use 1 instance add this:

manual_scaling:
  instances: 1
Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113