0

I'm maintaining a production app on GAE. The number of 'dynamic' instances we have seems very high. According to our app.yaml, these should be 'F4' instances. Some of these instances serve lots of requests - and others very few (see pic below). I have no idea why.

my questions:

  1. why are some instance very busy and others not?
  2. can I limit the number of dynamic instances?

enter image description here

EDIT: I'm adding some more details here:

  1. the pic above shows a few dynamic instances. there are a lot more - as many as 24 in total.
  2. In the app.yaml we configured 1 min/max idle instances. this (presumably) shows up as the single 'resident' instance I have.
  3. below is a portion of my app.yaml that is relevant.
  4. I understand that the idle machine kicks in when other machines can't handle the load. perhaps this is triggered by requests that take too long to complete (and perhaps this is why I have so many dynamic machines?)
runtime: python27
api_version: 1
threadsafe: yes
instance_class: F4
automatic_scaling:
  min_idle_instances: 1
  max_idle_instances: 1
....
libraries:
- name: webapp2
  version: "2.5.1"
- name: ssl
  version: latest
inbound_services:
- warmup
Zoe
  • 27,060
  • 21
  • 118
  • 148
FuzzyAmi
  • 7,543
  • 6
  • 45
  • 79
  • 1
    Can you share the relevant details from your `app.yaml` file? There's documentation around [configuring the number of instances](https://cloud.google.com/appengine/docs/standard/python/config/appref#scaling_elements), but it helps to know what settings you're currently using and what your traffic patterns look like in order to make suggestions. – erichiggins Jan 01 '18 at 17:08
  • @erichiggins: I added more details. thanks! – FuzzyAmi Jan 02 '18 at 06:58
  • Yes, a rather choppy traffic pattern with at least some of the requests having a long response time could explain what you see. Try setting `min_pending_latency` to a value greater than the max typical response time. See cloud.google.com/appengine/docs/standard/python/config/appref#scaling_elements – Dan Cornilescu Jan 02 '18 at 09:05
  • Going from memory based on experiencing this issue myself a year or two ago, I seem to recall that traffic is biased towards your resident instances. That is to say, you should expect them to receive more traffic since they are always running, whereas dynamic instances are spun up/down based on traffic patterns. Hopefully this matches what you are seeing in your usage, but I do seem to recall seeing some strange discrepancies with this in the past. – erichiggins Jan 02 '18 at 18:24
  • @erichiggins it's actually the other way around, see https://stackoverflow.com/questions/47246060/how-to-stop-google-appengine-instances-when-not-being-used/47251556#47251556 – Dan Cornilescu Jan 03 '18 at 07:21
  • @DanCornilescu Ah, got it. Thanks for refreshing my memory & clarifying! – erichiggins Jan 03 '18 at 18:21

0 Answers0