title: GAE keeps two instances idling, but why?
body: <p><strong>Context:</strong> I run a Google App Engine application with automatic scaling. The only regular workload is a cron job that runs every 5 minutes for about 10 seconds and there are usually no other requests to be served. However, GAE still keeps two instances idling in parallel almost all the time.</p>
  
  <p><strong>Question:</strong> Does anybody have an idea why GAE keeps two idling instances alive? Is it somehow possible to find out what caused a new instance to be spun up?</p>
  
  <p><strong>Supplemental information:</strong> I am familiar with the article <a href="https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed#scaling_dynamic_instances" rel="nofollow noreferrer">Scaling dynamic instances</a> and already tried to derive from the application log why new instances are spun up, but couldn't find any clues. My app.yaml looks like this:</p>
  
  <pre><code>runtime: python27
  api_version: 1
  threadsafe: true
  
  handlers:
  - url: /_ah/queue/deferred
    script: google.appengine.ext.deferred.deferred.application
    login: admin
  
  # some more url handlers...
  
  libraries:
  - name: webapp2
    version: latest
  - name: jinja2
    version: latest
  
  builtins:
  - deferred: on
  </code></pre>