Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Without utilizing the deprecated vm_settings -> machine_type setting, my Google Managed VM deploys as g1-small. Using Node.js app.yaml as a template, what do I need to change besides memory_gb to deploy as an f1-micro machine type? Presently, I have

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

and deploy using

gcloud preview app deploy app.yaml --set-default

doing

vm_settings:
  machine_type: f1-micro

...works, but I'm warned that this setting will soon disappear.

like image 606
tlupfer Avatar asked Jul 07 '15 16:07

tlupfer


People also ask

What is the purpose of the app yaml file?

The app. yaml file defines your configuration settings for your runtime as well as general app, network, and other resource settings. Do not add app.

What is the difference between APP engine standard and flexible?

The standard environment can scale from zero instances up to thousands very quickly. In contrast, the flexible environment must have at least one instance running for each active version and can take longer to scale up in response to traffic. Standard environment uses a custom-designed autoscaling algorithm.

How do I deploy dispatch yaml?

Deploying the dispatch fileyaml file should reside in the root directory or in the directory that defines the default service. For more information about the deployment commands, see Deploying a Python 2 App.


2 Answers

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 memory 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.

like image 132
tlupfer Avatar answered Sep 27 '22 22:09

tlupfer


Just want to update this post. It is now not possible to set the memory to 0.18 as Google has documented how these settings are calculated.

CPU

For cpu, you can now only set 1 or an even number from 2 to 32 (i.e. 2, 4, 6, 8 .. 32)

Memory

For memory_gb, Google states that the minimum memory is 0.9GB per core, which includes ~0.4GB overhead Google processes require. So you can request for 0.5GB and above of memory to meet that requirement. 0.18 would not be applicable anymore, an error would be thrown during deployment.

So my app.yaml looks like this currently:

# [START app_yaml]
runtime: nodejs
env: flex

resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

I know the question was to set up f1-micro resource limits but based on the current documentation, it seems that it's not possible.

Please refer to Resource settings for more details on the calculation. There's even a formula you can follow.

like image 38
ngobw Avatar answered Sep 27 '22 22:09

ngobw