Cheapest possible config for app engine flexible instance

4,584 views
Skip to first unread message

Kush Goyal

unread,
Jul 6, 2017, 4:12:06 AM7/6/17
to Google App Engine
Hi,

I am using app engine flexible environment for my python 3 app. I read the documentation for app.yaml [1] to configure my instance. This is my app.yaml config for my instance:


runtime: python
env
: flex
entrypoint
: gunicorn -b :$PORT myproject.wsgi

manual_scaling
:
 instances
: 1

resources
:
 cpu
: 0.2
 memory_gb
: 0.6
 disk_size_gb
: 10

health_check
:
 enable_health_check
: False

runtime_config
:
 python_version
: 3


I am facing these problem with this config:

1. enable health check false is not working. I still see health check requests in the log.

2. I am not able to figure out the cheapest config for my instance. Currently with the above config I am getting monthly USD 50 bill. Is it possible to make it cheaper?

Regards,

Kush

[1] https://cloud.google.com/appengine/pricing#flexible-environment-instances

Jordan (Cloud Platform Support)

unread,
Jul 6, 2017, 11:28:20 AM7/6/17
to Google App Engine
1. You can follow the public issue report where engineering is working on reducing the health checks. The reason you still see some after disabling is because there are multiple sources performing health checks on your instances, and disabling only stops one of the sources. 

2. App Engine Flexible instances are charged for their resources by the hour. Therefore, setting a Manual instance will cause your instance to run constantly, even when there is no traffic and it is doing no work. Not turning your instance down during idle time is the reason for your higher bill. Consider using Automatic or Basic scaling to minimize the time your instances are running, in turn reducing your bill. 

- Note that there are other resources that can cause your bill to be higher, it is recommended to view your bill to better understand the breakdown of charges.   

Kush Goyal

unread,
Jul 7, 2017, 1:38:32 PM7/7/17
to Google App Engine
Hi Jordan,

Thanks for the automatic scaling tip. I have changed my app.yaml [1] now. I will report the reductions in cost I get.

1. The link you gave for app.yaml docs is for standard environment. Does the same settings apply to flexible environment as well? Or should I use the docs at this url [2].

2. I checked my billing details. It shows USD 38 for App Engine Flex Instance Core Hours: 724.083 Hours and USD 5.14 for App Engine Flex Instance RAM: 724.083

3. Does these health check requests affect performance and costs?

4. What is the lowest possible config for resources options in app.yaml settings.

Regards,

Kush



[1]

runtime: python
env
: flex
entrypoint
: gunicorn -b :$PORT myproject.
wsgi


automatic_scaling
:
  min_num_instances
: 1
  max_num_instances
: 2


resources
:
  cpu
: 1

  memory_gb
: 0.6
  disk_size_gb
: 10


health_check
:
  enable_health_check
: False


runtime_config
:
  python_version
: 3

Miguel Vitorino

unread,
Jul 8, 2017, 6:15:46 AM7/8/17
to Google App Engine
Hi Jordan,

Are you saying that appengine flex can now scale to zero instances? Because I recall that during beta and before it wasn't possible, so has this changed when it hit GA?

Jordan (Cloud Platform Support)

unread,
Jul 10, 2017, 3:16:25 PM7/10/17
to Google App Engine
Thank you Miguel for the clarification. 

Currently the App Engine Flexible environment requires at least one instance to be active in a version in order for requests to be routed to it. Our engineering team is working very hard on a good "scale to zero" solution for the Flex environment. There is currently no ETA for its implementation. 

In the meantime, there is a great article on Reducing Costs for App Engine Flex that I recommend you read. The idea is the same, reduce instances, but for every deployed version and service. When you deploy a new version on your app, App Engine will keep the instances of older versions running. This will in turn increase costs for every deployed version and service. You should therefore ensure to delete all instances in all unused versions. 

---------------------------------------

Concerning health checks. Health check requests to your application will not affect performance or cost. A health check will not ask your application to do any work, and instead simply pings the instance and container running your application to ensure they are alive and well. 

Miguel Vitorino

unread,
Jul 11, 2017, 5:13:19 AM7/11/17
to google-a...@googlegroups.com
Hi Jordan,

Thanks, it seems I'm up to date on the current status of flex environment after all. We do already employ the techniques you mentioned to keep costs down.

Miguel Vitorino

Technical Director
Skype: miguel.vitorino
Support UK: +44 (20) 33 896 112
Support US: +1 (646) 350-0511



--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/uaiyicw6rhg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/0337d53b-e93f-4890-a911-2e973ccacd43%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Renaud Cerrato

unread,
Jun 16, 2018, 2:45:41 PM6/16/18
to Google App Engine
Appengine flexible is nowhere less than $40/month with minimal settings (1 core/512MB/10G) where the same application would cost nearly zero in the standard environment. That's a show stopper.

Rob Curtis

unread,
Mar 20, 2019, 6:52:50 AM3/20/19
to Google App Engine
Hi,

Any update on this "scale to zero" solution.
It seems the minimum cost I'm able to achieve is $38 per month, which seems kinda high for something not doing very much.

Thanks
Rob

George (Cloud Platform Support)

unread,
Apr 5, 2019, 9:37:49 AM4/5/19
to Google App Engine
Hello Miguel, 

As Jordan was saying, the standard environment can scale from zero instances up to thousands very quickly. In contrast, the flexible environment must have at least one instance of your application running and can take longer to scale up in response to traffic.You may check, among others, the "App Engine Flexible Environment for Users of App Engine Standard Environment" documentation page
Reply all
Reply to author
Forward
0 new messages