Python App Engine webapp2 slow to route

你离开我真会死。 提交于 2019-11-29 08:08:07

If keeping the instance hours tab low is of higher interest that keeping the request latency low then maybe you can drop the automatic scaling in favour of basic scaling. From Scaling types and instance classes:

Basic Scaling

A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.

Automatic Scaling

Automatic scaling is based on request rate, response latencies, and other application metrics.

Automatic Scaling targets a better user experience and can launch a large number of instances based on the incoming traffic patterns.

There are config parameters that you can use to tune the scaling behaviour, but for automatic scaling fundamentally there isn't one limiting the number of instances running in parallel, which can lead to balooning instance hours. BTW, your min_idle_instances: 1 will pretty much keep alive an instance at all times, almost always idle (other instances will actually handle the bulk of the requests).

Basic scaling on the other hand has a max_instances config which can be used to effectively cap the bill's instance hours:

max_instances

Required. The maximum number of instances for App Engine to create for this service version. This is useful to limit the costs of a service.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!