0

My Parse App running on google app engine is configured in its app.yaml to use a minimum and maximum of 1 instance in the flexible environment, yet I keep seeing it create 4 instances. Because of this, I have disabled billing on the account, because the costs keep growing even though I want to it have a maximum of just 1 instance.

I would like to know why it is doing this and how I could stop it from happening. Does app.yaml not work in the flexible environment?

My app.yaml:

runtime: nodejs
env: flex
api_version: 1

automatic_scaling:
  min_num_instances: 1
  max_num_instances: 1
  cool_down_period_sec: 120 # default value
  cpu_utilization:
    target_utilization: 0.5

resources:
  cpu: .2
  memory_gb: 0.6
  disk_size_gb: 10

This is for a node.js app btw (Parse).

Edit: I also tried manual scaling and setting the number of instances to 1 for that. It didn't make much of a difference, there are 3 instances running instead of 4. Sometimes it goes back to 4.

AppreciateIt
  • 101
  • 2
  • This is possibly related to an issue with the instance count displayed in the console. Are you seeing the extra instances on the graph, or do you have 4 physical instances on the 'Instances' page? I'd advise filing a report on the [googleappengine issue tracker](https://code.google.com/p/googleappengine/issues/list). – Adam Jan 16 '17 at 20:47
  • I see 4 physical instances, all of which are on different versions of the app. I can delete them but then they are just recreated. Honestly I am amazed that this appears to be not happening to everyone - I never had this occur before the flex beta. – AppreciateIt Jan 16 '17 at 23:59
  • I changed app.yaml to now have `vm: true` instead of `env: flex` to revert back to the flexible environment alpha and it works fine now...definitely a beta issue. – AppreciateIt Jan 17 '17 at 04:55
  • Okay, I switched back to `env: flex` and I see now that I just need to delete other versions of the app. Problem solved! :D – AppreciateIt Jan 17 '17 at 05:27
  • Glad to hear you discovered the issue. Yes, App Engine flex enforces a [minimum of 1 instance](https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml#automatic_scaling), so you need to delete the extra versions in order to remove them. – Adam Jan 20 '17 at 20:46
  • Also, consider posting your solution as a self-answer to close this question and to help other readers who come across it. – Adam Jan 20 '17 at 20:48
  • Done! I am curious: Is there a way to replace the current version of the app on google app engine without service outage? – AppreciateIt Jan 20 '17 at 22:19
  • Great question! You should set 'gcloud config set app/promote_by_default false' to prevent new versions from becoming the new default, then always deploy to a new version, and then [migrate traffic](https://cloud.google.com/appengine/docs/flexible/nodejs/migrating-traffic) to the new version. – Adam Jan 22 '17 at 21:04
  • 'promote_by_default false' really should be the default setting, because it allows for proper integration of new versions, but so far it remains enabled by default. – Adam Jan 22 '17 at 21:07

1 Answers1

0

I simply needed to delete/stop older versions of the app that existed on google app engine. Each one actively uses a minimum of one instance if not stopped.

AppreciateIt
  • 101
  • 2