Google Cloud App Engine(GAE)灵活:负载平衡器错误:Backend_connection_closed_before_data_sent_to_to_client

发布于 2025-01-28 16:19:39 字数 2389 浏览 3 评论 0原文

我让GAE灵活这个app.yaml:

# [START runtime]
runtime: python
env: flex
entrypoint: gunicorn -b :$PORT ******.wsgi

automatic_scaling:
  min_num_instances: 2
  max_num_instances: 2

beta_settings:
    cloud_sql_instances: ******:europe-west6:*******

runtime_config:
  python_version: 3

handlers:
- url: /.*
  script: auto
  secure: always
  redirect_http_response_code: 301
# [END runtime]

”“在此处输入图像说明”

标准实例每周重新启动,我在邮政请求中看到了一些内部错误和502个错误:

{
  "insertId": "2",
  "jsonPayload": {...},
  "timestamp": "2022-05-14T08:34:42.512018934Z",
  "severity": "ERROR",
  "logName": "projects/****/logs/compute.googleapis.com%2Fshielded_vm_integrity",
  "receiveTimestamp": "2022-05-14T08:34:44.518408254Z"
}

而且

{
  "insertId": "*******",
  "jsonPayload": {
    "remoteIp": "******",
    "@type": "type.googleapis.com/google.cloud.loadbalancing.type.LoadBalancerLogEntry",
    "statusDetails": "backend_connection_closed_before_data_sent_to_client"
  },
  "httpRequest": {
    "requestMethod": "POST",
    "requestUrl": "https://*********",
    "requestSize": "2208",
    "status": 502,
    "responseSize": "451",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0",
    "remoteIp": "*******",
    "referer": "********",
    "serverIp": "********"
  },
  "resource": {
    "type": "http_load_balancer",
    "labels": {
      "url_map_name": "",
      "target_proxy_name": "",
      "zone": "global",
      "project_id": "********",
      "backend_service_name": "********",
      "forwarding_rule_name": ""
    }
  },
  "timestamp": "2022-05-14T08:36:28.064500Z",
  "severity": "WARNING",
  "logName": "projects/********/logs/requests",
  "trace": "projects/********/traces/********",
  "receiveTimestamp": "2022-05-14T08:36:28.882230792Z",
  "spanId": "********"
}

我还有一些消息,

/readiness_check failReason:"null"

我读过

对于当前的应用程序,处理每个请求非常重要,因此我想对修复它有信心。

I have GAE flexible this app.yaml:

# [START runtime]
runtime: python
env: flex
entrypoint: gunicorn -b :$PORT ******.wsgi

automatic_scaling:
  min_num_instances: 2
  max_num_instances: 2

beta_settings:
    cloud_sql_instances: ******:europe-west6:*******

runtime_config:
  python_version: 3

handlers:
- url: /.*
  script: auto
  secure: always
  redirect_http_response_code: 301
# [END runtime]

enter image description here

After standard instance weekly restarting, I've seen some internal errors in logs and 502 errors on POST requests:

{
  "insertId": "2",
  "jsonPayload": {...},
  "timestamp": "2022-05-14T08:34:42.512018934Z",
  "severity": "ERROR",
  "logName": "projects/****/logs/compute.googleapis.com%2Fshielded_vm_integrity",
  "receiveTimestamp": "2022-05-14T08:34:44.518408254Z"
}

and

{
  "insertId": "*******",
  "jsonPayload": {
    "remoteIp": "******",
    "@type": "type.googleapis.com/google.cloud.loadbalancing.type.LoadBalancerLogEntry",
    "statusDetails": "backend_connection_closed_before_data_sent_to_client"
  },
  "httpRequest": {
    "requestMethod": "POST",
    "requestUrl": "https://*********",
    "requestSize": "2208",
    "status": 502,
    "responseSize": "451",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0",
    "remoteIp": "*******",
    "referer": "********",
    "serverIp": "********"
  },
  "resource": {
    "type": "http_load_balancer",
    "labels": {
      "url_map_name": "",
      "target_proxy_name": "",
      "zone": "global",
      "project_id": "********",
      "backend_service_name": "********",
      "forwarding_rule_name": ""
    }
  },
  "timestamp": "2022-05-14T08:36:28.064500Z",
  "severity": "WARNING",
  "logName": "projects/********/logs/requests",
  "trace": "projects/********/traces/********",
  "receiveTimestamp": "2022-05-14T08:36:28.882230792Z",
  "spanId": "********"
}

Also I have some messages with

/readiness_check failReason:"null"

I've read Tuning NGINX behind Google Cloud Platform HTTP(S) Load Balancer But as I understand it is related to GCE(not GAE).

For the current app it is VERY important to handle every request, so I want to be confident with fixing it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文