0

This is what I put in the app.yaml file:

runtime: java8
service: 'scheduler'
inbound_services:
- warmup
derived_file_type:
- java_precompiled
threadsafe: True
auto_id_policy: default
api_version: '1.0'
handlers:
- url: (/.*)
  static_files: __static__\1
  upload: __NOT_USED__
  require_matching_file: True
  login: optional
  secure: optional
- url: /
  script: unused
  login: optional
  secure: optional
- url: /.*/
  script: unused
  login: optional
  secure: optional
- url: /_ah/.*
  script: unused
  login: optional
  secure: optional
- url: /cron/v1/simulations
  script: unused
  login: optional
  secure: optional
resources:
  cpu: 1
  memory_gb: 1
  disk_size_gb: 1
  volumes:
  - name: ramdisk1
    volume_type: tmpfs
    size_gb: 0.5
automatic_scaling:
  min_num_instances: 1
  max_num_instances: 2
  cool_down_period_sec: 180
  cpu_utilization:
    target_utilization: 0.6

And when it's deployed, on GCP its config looks like this:

runtime: java8
api_version: '1.0'
env: standard
threadsafe: true
instance_class: F1
inbound_services:
  - warmup
handlers:
  - url: '(/.*)'
    application_readable: false
    static_files: "__static__\\1"
    require_matching_file: true
    upload: __NOT_USED__
  - url: /
    script: unused
  - url: '/.*/'
    script: unused
  - url: '/_ah/.*'
    script: unused
  - url: /cron/v1/simulations
    script: unused
automatic_scaling:
  min_idle_instances: automatic
  max_idle_instances: automatic
  min_pending_latency: automatic
  max_pending_latency: automatic

And here's a screenshot of the result:

enter image description here

I did try changing min_num_instances: 1 and max_num_instances: 2 to min_idle_instances: 1 max_idle_instances: 2, with no different result.

It's creating way more instances than I need, and the billing sum has gone up threefold since I noticed these changes. Very confusing.

2
  • Note that you're mixing flexible env specific configs (resources, for example) in your standard env app.yaml. At best they will be just ignored. This might be of help: stackoverflow.com/q/45842772/4495081 – Dan Cornilescu Mar 23 '18 at 2:36
  • That is also true, and yes they were just ignored. – djokerndthief Mar 24 '18 at 13:45
0

So the simple solution was that it wasn't the app.yaml I should edit for the standard env., it was the appengine-web.xml.

Now I've got full control again, it seems!

I also deleted old services (which I thought wasn't running, because it looked like they were not on? Seeing as they were shown as 0%...). Sometimes GAE doesn't scale down by itself, I learned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.