如何在谷歌应用程序引擎停止预热请求?



我在GAE Python应用程序中每秒都会收到预热请求,结果是404,我的app.yaml如下:

runtime: python37
entrypoint: gunicorn -w 4 -k uvicorn.workers.UvicornWorker api:app
instance_class: F4
inbound_services:
- warmup
handlers:
- url: /_ah/warmup
script: auto
- url: /.*
static_dir: /.*
http_headers:
Access-Control-Allow-Origin: "*"
# ...

我试过删除inbound_services: - warmup,但请求并没有停止,它们似乎也起源于较早的版本,我该如何阻止它们?

类似的问题:太多的/_ah/暖化/查询在谷歌应用引擎

我不确定是否要阻止它们,我认为移除inbound_services: - warmup会阻止它们。

至于404的原始问题,您需要在python代码中为url/_ah/warmup设置处理程序,因为您指定了script: auto

最新更新