这是用户在 2025-8-7 15:14 为 https://docs.langchain.com/langgraph-platform/data-plane 保存的双语快照页面,由 沉浸式翻译 提供双语支持。了解如何保存?
The term “data plane” is used broadly to refer to LangGraph Servers (deployments), the corresponding infrastructure for each server, and the “listener” application that continuously polls for updates from the LangGraph Control Plane.
术语“数据平面”被广泛用于指代 LangGraph 服务器(部署)、每个服务器的相应基础设施,以及持续从 LangGraph 控制平面轮询更新的“监听器”应用程序。

Server Infrastructure  服务器基础设施

In addition to the LangGraph Server itself, the following infrastructure components for each server are also included in the broad definition of “data plane”:
除了 LangGraph 服务器本身外,以下每个服务器的以下基础设施组件也包含在“数据平面”的广义定义中:
  • Postgres
  • Redis
  • Secrets store  密钥存储
  • Autoscalers  自动扩展器

”Listener” Application  “监听器”应用

The data plane “listener” application periodically calls control plane APIs to:
数据平面“监听器”应用程序定期调用控制平面 API 以:
  • Determine if new deployments should be created.
    确定是否应创建新的部署。
  • Determine if existing deployments should be updated (i.e. new revisions).
    确定现有部署是否需要更新(即新版本)。
  • Determine if existing deployments should be deleted.
    确定现有部署是否需要删除。
In other words, the data plane “listener” reads the latest state of the control plane (desired state) and takes action to reconcile outstanding deployments (current state) to match the latest state.
换句话说,数据平面“监听器”读取控制平面的最新状态(期望状态),并采取行动使未完成的部署(当前状态)与最新状态保持一致。

Postgres

Postgres is the persistence layer for all user, run, and long-term memory data in a LangGraph Server. This stores both checkpoints (see more info here), server resources (threads, runs, assistants and crons), as well as items saved in the long-term memory store (see more info here).
Postgres 是 LangGraph Server 中所有用户、运行和长期内存数据的持久化层。这存储了检查点(更多信息请见此处)、服务器资源(线程、运行、助手和定时任务),以及保存在长期内存存储中的项目(更多信息请见此处)。

Redis

Redis is used in each LangGraph Server as a way for server and queue workers to communicate, and to store ephemeral metadata. No user or run data is stored in Redis.
Redis 在每个 LangGraph 服务器中用作服务器和队列工作进程之间通信的方式,以及存储临时元数据。Redis 中不存储任何用户或运行数据。

Communication  通信

All runs in a LangGraph Server are executed by a pool of background workers that are part of each deployment.
LangGraph 服务器中的所有运行都是由一组后台工作进程执行的,这些工作进程是每个部署的一部分。

In order to enable some features for those runs (such as cancellation and output streaming) we need a channel for two-way communication between the server and the worker handling a particular run. We use Redis to organize that communication.
为了为这些运行启用某些功能(例如取消和输出流式传输),我们需要一个服务器和处理特定运行的工作进程之间的双向通信通道。我们使用 Redis 来组织这种通信。
  1. A Redis list is used as a mechanism to wake up a worker as soon as a new run is created. Only a sentinel value is stored in this list, no actual run information. The run information is then retrieved from Postgres by the worker.
    一个 Redis 列表被用作机制,以便在创建新运行时唤醒工作进程。该列表中只存储一个哨兵值,不存储实际的运行信息。然后工作进程从 Postgres 中检索运行信息。
  2. A combination of a Redis string and Redis PubSub channel is used for the server to communicate a run cancellation request to the appropriate worker.
    Redis 字符串与 Redis PubSub 通道的组合用于服务器向合适的工人通信运行取消请求。
  3. A Redis PubSub channel is used by the worker to broadcast streaming output from an agent while the run is being handled. Any open /stream request in the server will subscribe to that channel and forward any events to the response as they arrive. No events are stored in Redis at any time.
    工人使用 Redis PubSub 通道在处理运行时广播代理的流式输出。服务器中任何打开的 /stream 请求将订阅该通道,并将事件按到达顺序转发到响应中。任何时候 Redis 中都不会存储事件。

Ephemeral metadata  临时元数据

Runs in a LangGraph Server may be retried for specific failures (currently only for transient Postgres errors encountered during the run).
LangGraph 服务器中的运行可能会因特定失败重试(目前仅针对运行期间遇到的临时 Postgres 错误)。

In order to limit the number of retries (currently limited to 3 attempts per run) we record the attempt number in a Redis string when it is picked up. This contains no run-specific info other than its ID, and expires after a short delay.
为了限制重试次数(目前限制每个运行最多 3 次尝试),我们在将其拾取时在 Redis 字符串中记录尝试次数。这包含的运行特定信息仅限于其 ID,并在短时后过期。

Data Plane Features  数据平面功能

This section describes various features of the data plane.
本节描述数据平面的各种功能。

Data Region  数据区域

Only for Cloud Data regions are only applicable for Cloud deployments.
仅适用于云数据区域,仅适用于云部署。
Deployments can be created in 2 data regions: US and EU
部署可以创建在 2 个数据区域:美国和欧洲
The data region for a deployment is implied by the data region of the LangSmith organization where the deployment is created. Deployments and the underlying database for the deployments cannot be migrated between data regions.
部署的数据区域由创建部署的 LangSmith 组织的区域决定。部署及其底层数据库不能在不同数据区域之间迁移。

Autoscaling  自动扩展

Production type deployments automatically scale up to 10 containers. Scaling is based on 3 metrics:
Production 类型部署会自动扩展到 10 个容器。扩展基于 3 个指标:
  1. CPU utilization  CPU 利用率
  2. Memory utilization  内存使用率
  3. Number of pending (in progress) runs
    待处理(进行中)运行数量
For CPU utilization, the autoscaler targets 75% utilization. This means the autoscaler will scale the number of containers up or down to ensure that CPU utilization is at or near 75%. For memory utilization, the autoscaler targets 75% utilization as well.
对于 CPU 利用率,自动扩展器目标是 75%。这意味着自动扩展器将增加或减少容器数量,以确保 CPU 利用率达到或接近 75%。对于内存利用率,自动扩展器同样目标是 75%。
For number of pending runs, the autoscaler targets 10 pending runs.
对于挂起的任务数量,自动扩展器将目标设置为 10 个挂起的任务。

For example, if the current number of containers is 1, but the number of pending runs in 20, the autoscaler will scale up the deployment to 2 containers (20 pending runs / 2 containers = 10 pending runs per container).
例如,如果当前容器数量为 1,但挂起运行的数量为 20,自动伸缩器将扩展部署到 2 个容器(20 个挂起运行 / 2 个容器 = 每个容器 10 个挂起运行)。
Each metric is computed independently and the autoscaler will determine the scaling action based on the metric that results in the largest number of containers.
每个指标都是独立计算的,自动伸缩器将根据产生容器数量最多的指标来决定伸缩操作。
Scale down actions are delayed for 30 minutes before any action is taken. In other words, if the autoscaler decides to scale down a deployment, it will first wait for 30 minutes before scaling down.
缩减操作会在采取任何行动前延迟 30 分钟。换句话说,如果自动伸缩器决定缩减部署,它将首先等待 30 分钟再进行缩减。

After 30 minutes, the metrics are recomputed and the deployment will scale down if the recomputed metrics result in a lower number of containers than the current number. Otherwise, the deployment remains scaled up.
30 分钟后,会重新计算指标,如果重新计算的指标导致容器数量少于当前数量,部署将进行缩减。否则,部署将保持扩容状态。

This “cool down” period ensures that deployments do not scale up and down too frequently.
这个“冷却”期确保部署不会过于频繁地扩容和缩减。

Static IP Addresses  静态 IP 地址

Only for Cloud Static IP addresses are only available for Cloud deployments.
仅适用于云静态 IP 地址,仅适用于云部署。
All traffic from deployments created after January 6th 2025 will come through a NAT gateway. This NAT gateway will have several static IP addresses depending on the data region. Refer to the table below for the list of static IP addresses:
2025 年 1 月 6 日之后创建的所有流量将通过 NAT 网关。该 NAT 网关将根据数据区域拥有多个静态 IP 地址。请参考下表获取静态 IP 地址列表:
USEU
35.197.29.14634.13.192.67
34.145.102.12334.147.105.64
34.169.45.15334.90.22.166
34.82.222.1734.147.36.213
35.227.171.13534.32.137.113
34.169.88.3034.91.238.184
34.19.93.20235.204.101.241
34.19.34.5035.204.48.32

Custom Postgres  自定义 Postgres

Custom Postgres instances are only available for Hybrid and Self-Hosted deployments.
自定义的 Postgres 实例仅适用于混合部署和自托管部署。
A custom Postgres instance can be used instead of the one automatically created by the control plane. Specify the POSTGRES_URI_CUSTOM environment variable to use a custom Postgres instance.
可以使用自定义的 Postgres 实例替代控制平面自动创建的实例。通过指定 POSTGRES_URI_CUSTOM 环境变量来使用自定义的 Postgres 实例。
Multiple deployments can share the same Postgres instance. For example, for Deployment A, POSTGRES_URI_CUSTOM can be set to postgres://<user>:<password>@/<database_name_1>?host=<hostname_1> and for Deployment B, POSTGRES_URI_CUSTOM can be set to postgres://<user>:<password>@/<database_name_2>?host=<hostname_1>. <database_name_1> and database_name_2 are different databases within the same instance, but <hostname_1> is shared. The same database cannot be used for separate deployments.
多个部署可以共享同一个 Postgres 实例。例如,对于 Deployment APOSTGRES_URI_CUSTOM 可以设置为 postgres://<user>:<password>@/<database_name_1>?host=<hostname_1> ,对于 Deployment BPOSTGRES_URI_CUSTOM 可以设置为 postgres://<user>:<password>@/<database_name_2>?host=<hostname_1><database_name_1>database_name_2 是同一个实例中的不同数据库,但 <hostname_1> 是共享的。相同的数据库不能用于不同的部署。

Custom Redis  自定义 Redis

Custom Redis instances are only available for Hybrid and Self-Hosted deployments.
自定义 Redis 实例仅在混合部署和自托管部署中可用。
A custom Redis instance can be used instead of the one automatically created by the control plane. Specify the REDIS_URI_CUSTOM environment variable to use a custom Redis instance.
一个自定义的 Redis 实例可以代替控制平面自动创建的实例。通过设置 REDIS_URI_CUSTOM 环境变量来使用自定义的 Redis 实例。
Multiple deployments can share the same Redis instance. For example, for Deployment A, REDIS_URI_CUSTOM can be set to redis://<hostname_1>:<port>/1 and for Deployment B, REDIS_URI_CUSTOM can be set to redis://<hostname_1>:<port>/2. 1 and 2 are different database numbers within the same instance, but <hostname_1> is shared. The same database number cannot be used for separate deployments.
多个部署可以共享同一个 Redis 实例。例如,对于 Deployment AREDIS_URI_CUSTOM 可以设置为 redis://<hostname_1>:<port>/1 ,对于 Deployment BREDIS_URI_CUSTOM 可以设置为 redis://<hostname_1>:<port>/212 是同一实例中不同的数据库编号,但 <hostname_1> 是共享的。不同的部署不能使用相同的数据库编号。

LangSmith Tracing  LangSmith 追踪

LangGraph Server is automatically configured to send traces to LangSmith. See the table below for details with respect to each deployment option.
LangGraph Server 自动配置为将跟踪信息发送到 LangSmith。有关每个部署选项的详细信息,请参阅下表。
Cloud  Hybrid  混合Self-Hosted  自托管
Required  必需
Trace to LangSmith SaaS.  追踪到 LangSmith SaaS。
Optional  可选
Disable tracing or trace to LangSmith SaaS.
禁用追踪或追踪到 LangSmith SaaS。
Optional  可选
Disable tracing, trace to LangSmith SaaS, or trace to Self-Hosted LangSmith.
禁用追踪、追踪到 LangSmith SaaS 或追踪到自托管 LangSmith。

Telemetry  遥测

LangGraph Server is automatically configured to report telemetry metadata for billing purposes. See the table below for details with respect to each deployment option.
LangGraph Server 会自动配置以报告用于计费的目的的遥测元数据。有关每个部署选项的详细信息,请参见下表。
Cloud  Hybrid  混合Self-Hosted  自托管
Telemetry sent to LangSmith SaaS.
发送到 LangSmith SaaS 的遥测数据。
Telemetry sent to LangSmith SaaS.
发送到 LangSmith SaaS 的遥测数据。
Self-reported usage (audit) for air-gapped license key.
用于隔离许可证密钥的自报使用情况(审计)。

Telemetry sent to LangSmith SaaS for LangGraph Platform License Key.
为 LangGraph 平台许可证密钥发送到 LangSmith SaaS 的遥测数据。

Licensing  许可

LangGraph Server is automatically configured to perform license key validation. See the table below for details with respect to each deployment option.
LangGraph 服务器自动配置以执行许可证密钥验证。有关每个部署选项的详细信息,请参阅下表。
Cloud  Hybrid  混合Self-Hosted  自托管
LangSmith API Key validated against LangSmith SaaS.
LangSmith API 密钥与 LangSmith SaaS 进行验证。
LangSmith API Key validated against LangSmith SaaS.
LangSmith API 密钥与 LangSmith SaaS 进行验证。
Air-gapped license key or LangGraph Platform License Key validated against LangSmith SaaS.
与 LangSmith SaaS 验证的脱机许可证密钥或 LangGraph 平台许可证密钥。