Hello, Toon As you may already know, presently, App Engine flex supports the WebSocket protocol in beta[1] and in general, the Autoscaling policy of the App Engine flex[2] is based on the Scaling characteristics of Compute Engine Autoscaler. The App Engine Autoscaler considers a number of parameters[3] to scale which includes those you listed and other application metrics like average CPU utilization. This autoscaler can make scaling decisions based on multiple metrics, not only response latency and request rates.
When scaling down, the autoscaler simply sends shutdown signals[4] to Instances that are considered idle. Instances are considered busy when they are handling requests, in your use-case whenever an instance has no connections, it is considered idle. Autoscaling in App Engine is based on the algorithms that are constantly deciding on whether it’s better to queue a request or to spin up a new instance or shutdown an Instance or play around with resident instances to find the optimized setting for the use-case. About your inquiry about how connections are handled while new Instances are still warming up, the flag, cool_down_period_sec parameter[5] is used to manage how the App Engine Autoscaler listens to Instances while initializing. You could always define a different value in the App.yaml as it suits your use-case but there is a default value of 120 seconds. [1]https://cloud.google.com/blog/products/application-development/introducing-websockets-support-for-app-engine-flexible-environment [2]https://cloud.google.com/appengine/docs/flexible/python/flexible-for-standard-users#scaling_characteristics [3]https://cloud.google.com/compute/docs/autoscaler/#policies [4]https://cloud.google.com/appengine/docs/flexible/custom-runtimes/build#application_shutdown [5]https://cloud.google.com/appengine/docs/flexible/custom-runtimes/configuring-your-app-with-app-yaml#automatic_scaling -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/d15e699c-d5d4-42ef-b591-c0a71ef8abcb%40googlegroups.com.
