1

Is it possible to run app engine for free? Whatever I have tried, it seems to be not possible, I am also confused how they calculate the CPU hours.

For example, I am using Flex environment with maximum number of instances; 1, and CPU; 1.

I understand that appengine flex offers 28 hours free/a day. I have very simple nodejs admin panel, it is used few times a day, and I pay 30£ for it which is nonsense. How do they calculate the hours? How can I consume more than 24 hours/a day anyway? By using multiple vCPU's? Why is my code using multiple vCPU's when nobody is using it.

I've tired loads of different configurations but haven't gotten anywhere. I've checked that only one instance is every running. FOr reference here is my app yaml:

# Used to configure Google App Engine
# See https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
# .gitignore contains the entry server/app.yaml so when this file is copied it isn't comitted to source control
runtime: nodejs
env: flex

skip_files:
  - ^(.*/)?.*/node_modules/.*$

automatic_scaling:
  max_num_instances: 1

resources:
  cpu: 1

instance_class: F1
threadsafe: false

the pricing (around 8£ for 8 days)

enter image description here

Erti-Chris Eelmaa
  • 25,338
  • 6
  • 61
  • 78
  • 1
    Might consider running on App Engine Standard - which now supports Node.js apps and has a quickstart guide for running on the free quota. https://cloud.google.com/appengine/docs/standard/nodejs/quickstart – Jeff Deskins Feb 08 '19 at 22:05
  • thanks, I will try that, their app.yaml is basically just "runtime: node10" and that's it, nothing else. – Erti-Chris Eelmaa Feb 09 '19 at 10:14
  • 1
    You're mixing [standard](https://cloud.google.com/appengine/docs/standard/nodejs/config/appref) (`instance_class`) and [flex](https://cloud.google.com/appengine/docs/flexible/nodejs/reference/app-yaml) (`env: flex`, `cpu`) environment `app.yaml` configs, see https://stackoverflow.com/questions/45842772/how-to-tell-if-a-google-app-engine-documentation-page-applies-to-the-standard-or. And `threadsafe` isn't applicable to nodejs. Pricing also differs (28h free are for standard env) – Dan Cornilescu Feb 09 '19 at 15:50

2 Answers2

2

App Engine flexible environment does not offer a free tier. App Engine standard environment does offer a free tier. See if the Node.js standard environment works for your application. If not, consider switching to Compute Engine, which has an f1-micro instance in its free tier.

BrettJ
  • 6,801
  • 1
  • 23
  • 26
0

I managed to stitch together the correct config from all the given answers to get free appengine instance.

Here it is:

# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gae_quickstart_yaml]
runtime: nodejs10
# [END gae_quickstart_yaml]

automatic_scaling:
  min_instances: 0
  max_instances: 1
Erti-Chris Eelmaa
  • 25,338
  • 6
  • 61
  • 78
  • This isn't quite accurate. You can have scaling beyond 1 instance and still stay in the free tier. You get 28 instances hours per day, which is examined in 15 minute intervals. If you run a cron job and create a few tasks that fire up four instances that finish up their jobs within 15 minutes, you'd only be using 1 instance hour even though 4 instances were used. – BrettJ Feb 16 '19 at 08:50