title: Flask on Python 3.7 more demanding (and expensive) than webapp2 on Python 2.7 with Google App Engine Standard environment
body: <p>I recently ported a very simple project built in [python 2.7 / webapp2] to [python 3.7 / Flask] and in the last month I've seen the <strong>cost raising from $0 to $20</strong>!</p>
  
  <p>The project is very simple (90 lines of code): just a couple of request handlers that return different json based on the value passed in the query string. There's virtually no difference in the code other than a sligtly different syntax. Traffic and request also didn't change much and decreased if anything.</p>
  
  <p>In the billing I can see how the frontend hours have increased significantly and how GAE spins up more instances more often than before.</p>
  
  <p>Has anyone experienced the same behaviour? Are python 3.7 and Flask "heavier" than webapp2 on 2.7?</p>
  
  <p>For completeness both versions have been deployed with a standard vanilla <code>gcloud app deploy</code> with no other options. It's using the standard environment on F1 instances and no background workers or tasks. The app.yaml is pretty much identical in the parts that relate to the instances setup:</p>
  
  <pre><code>env: standard
  instance_class: F1
  automatic_scaling:
    min_idle_instances: automatic
    max_idle_instances: automatic
    min_pending_latency: automatic
    max_pending_latency: automatic
  </code></pre>
  
  <p>versions with no traffic, don't have any instance running (they can't be stopped, so they are serving, but with 0 instances).</p>
  
  <p>For sake of clarity I can attach the graphs of the new version, and the old one that I temporarily re-enabled. From the graphs is clear how the new setup spins up instances for no apparent reason while the old one keep a cool flat 1 instance active.</p>
  
  <p><a href="https://i.stack.imgur.com/L0E40.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L0E40.jpg" alt="New configuration"></a></p>
  
  <p><a href="https://i.stack.imgur.com/HHu0j.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HHu0j.jpg" alt="Old configuration"></a></p>