Prasad Kothavale
Prasad Kothavale

Reputation: 444

Please suggest Google Cloud App Engine's smallest configuration

I have a node.js web application / website hosted in Google Cloud App Engine. The website will have no more than 10 users per day and does not have any complex resource consuming feature.

I used app.yaml file given in tutorial

# [START app_yaml]
runtime: nodejs
env: flex
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10
# [END app_yaml]

But this is costing around 40 USD per month which is too high for basic application. Can you please suggest minimum possible lowest cost resource configuration? It would be helpful if you can provide app.yaml sample for it.

Upvotes: 4

Views: 3270

Answers (6)

Milan Menezes
Milan Menezes

Reputation: 1

App Engine Standard environment would be the best route for your use case. The standard environment runs directly on Google's Infrastructure, scales quickly and scales down to zero when there's no traffic. The free quota might be sufficient enough for this uses case as well.

App Engine Flexible environment runs as a container in a GCE VM (1 VM per instance/container). This makes it slower to scale compared to the standard environment as scaling up would require new VMs to boot up before the instance containers can be pulled and started. Flex also has the requirement of having minimum 1 instance running all the time (where as standard scales down to 0).

Flex is useful when your requirements of runtime/resources go beyond the limitations of standard environment.

You can understand more about the differences between the standard and flex environments at https://cloud.google.com/appengine/docs/the-appengine-environments

Upvotes: 0

Grapehand
Grapehand

Reputation: 19

Use the Basic, not Flexible. It is a better fit and far cheaper for you.

Upvotes: -1

Akash Saggar
Akash Saggar

Reputation: 31

The cheapest way to host a Node JS application is through Google Compute Engine, not Google App Engine. This is because you can host it for 100% free on Compute Engine! I have many Node apps that have been running for the last 2 years, and I have been charged a maximum of a few cents per month, if any at all. As long as you are fine with a low spec machine (shared vCPU) and no scaling, look into the Compute Engine Always Free options. https://cloud.google.com/free/docs/always-free-usage-limits#compute_name

The only downside is that you have to set up the server (installing Node, setting up firewalls etc). But it is a one time job, and easily repeatable after you have done it once.

Upvotes: 1

Prasad Kothavale
Prasad Kothavale

Reputation: 444

After reading articles on the internet I have created 1 f1-micro (1 vCPU, 0.6 GB memory) VM instance of bitnami MEAN stack which costs ~$5.5/month. I was able to host 1 Mongo DB instance and 2 Node.JS web applications in it. Both the applications have different domain names.

I have implemented reverse proxy using Apache HTTP server to route traffic to appropriate Node.JS application by it domain-name/hostname. I have documented the steps I followed here: https://medium.com/@prasadkothavale/host-multiple-web-applications-on-single-google-compute-engine-instance-using-apache-reverse-proxy-c8d4fbaf5fe0

Feel free to suggest if you have any other ways to implement this scenario.

Upvotes: 1

Salem Ouerdani
Salem Ouerdani

Reputation: 7886

After few searches, that seems to be the lowest possible configurations. See related answer here:

Can you use fractional vCPUs with GAE Flexible Environment?

At least for now, there is no shared CPUs so you'll pay for one even if your app is using an average 2% of it. Maybe adding few star here will help changing that in a near future:

https://issuetracker.google.com/issues/62011060

Upvotes: 1

Mihail Russu
Mihail Russu

Reputation: 2536

Google Cloud Platform's Pricing Calculator shows that the specs in your app.yaml turn out to be Total Estimated Cost: $41.91 per 1 month so your costs seem right.

AppEngine Flexible instances are charged for their resources by hour. With manual_scaling option set your instance is up all the time, even when there is no traffic and it is not doing any work. So, not turning your instance down during the idle time is the reason for the $40 bill. You might want to look into using Automatic or Basic scaling to minimize the time your instance is running, which will likely reduce your bill considering you don't have traffic 24/7 (you will find examples of proper app.yaml settings via the link).

Note that with automatic/basic scaling you get to select instance classes with less than 1 dedicated core (i.e. 0.2 & 0.5 CPUs). Not sure if setting CPU to be > 0 and < 1 with manual_scaling here would also work, you might give want to give it a try as well.

Also, don't forget to have a detailed look at your bills to see what else you are potentially being charged for.

Upvotes: 4

Related Questions