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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With