TCP/HTTP Keepalive

基本概念

  1. ALB 支持在端口级别配置 keepalive。可以在前端进行配置。

  2. Keepalive 位于客户端与 ALB 之间,而不是 ALB 与后端之间。

  3. 它通过 Nginx 配置实现,当配置发生更改时,Nginx 需要并将自动重新加载。

  4. TCP keepalive 和 HTTP keepalive 是两个不同的概念:

    1. TCP keepalive 是 TCP 协议的一项功能,在没有数据传输时定期发送探测数据包,以检查连接是否仍然有效。它有助于检测并清理失效连接。
    2. HTTP keepalive(也称为持久连接)允许多个 HTTP 请求复用同一个 TCP 连接,从而避免建立新连接的开销。通过减少延迟和资源使用量,这可以提升性能。

CRD

keepalive:
  properties:
    http:
      description: Downstream L7 keepalive
      properties:
        header_timeout:
          description: Keepalive header timeout. Default is not set.
          type: string
        requests:
          description: Keepalive requests. Default is 1000.
          type: integer
        timeout:
          description: Keepalive timeout. Default is 75s.
          type: string
      type: object
    tcp:
      description: TCPKeepAlive defines TCP keepalive parameters (SO_KEEPALIVE)
      properties:
        count:
          description: The TCP_KEEPCNT socket option.
          type: integer
        idle:
          description: The TCP_KEEPIDLE socket option.
          type: string
        interval:
          description: The TCP_KEEPINTVL socket option.
          type: string
      type: object
  type: object

只能在 Frontend .spec.config.keepalive 上进行配置。

商标声明

NGINX® 是 F5, Inc. 在美国及其他国家/地区的注册商标。

Alauda 是独立供应商。本产品与 F5, Inc. 没有关联,也未获得其认可或赞助。所有商标均归其各自所有者所有,此处仅用于标识目的。