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 cost raising from $0 to $20!
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.
In the billing I can see how the frontend hours have increased significantly and how GAE spins up more instances more often than before.
Has anyone experienced the same behaviour? Are python 3.7 and Flask "heavier" than webapp2 on 2.7?
For completeness both versions have been deployed with a standard vanilla gcloud app deploy
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:
env: standard
instance_class: F1
automatic_scaling:
min_idle_instances: automatic
max_idle_instances: automatic
min_pending_latency: automatic
max_pending_latency: automatic
versions with no traffic, don't have any instance running (they can't be stopped, so they are serving, but with 0 instances).
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.