繁体   English   中英

作业图太大,无法提交到 Google Cloud Dataflow

[英]Job graph too large to submit to Google Cloud Dataflow

我正在尝试在 Dataflow 上运行作业,每当我尝试提交它以使用 DataflowRunner 运行时,我都会从服务中收到以下错误:

{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Request payload size exceeds the limit: x bytes.",
    "reason" : "badRequest"
  } ],
  "message" : "Request payload size exceeds the limit: x bytes.",
  "status" : "INVALID_ARGUMENT"
}
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "(3754670dbaa1cc6b): The job graph is too large. Please try again with a smaller job graph, or split your job into two or more smaller jobs.",
    "reason" : "badRequest",
    "debugInfo" : "detail: \"(3754670dbaa1cc6b): CreateJob fails due to Spanner error: New value exceeds the maximum size limit for this column in this database: Jobs.CloudWorkflowJob, size: 17278017, limit: 10485760.\"\n"
  } ],
  "message" : "(3754670dbaa1cc6b): The job graph is too large. Please try again with a smaller job graph, or split your job into two or more smaller jobs.",
  "status" : "INVALID_ARGUMENT"
}

如何将我的工作更改为更小,或增加工作大小限制?

此问题有一个解决方法,可让您将作业图的大小增加到最多 100MB。 您可以指定此实验: --experiments=upload_graph

实验激活了一个新的提交路径,该路径将作业文件上传到 GCS,并通过不包含作业图的 HTTP 请求创建作业 - 只是对其的引用。

这样做的缺点是 UI 可能无法正确显示作业,因为它依赖于 API 请求来共享作业。


额外说明:减小作业图的大小仍然是一种很好的做法。

一个重要提示是,有时可以创建一些匿名 DoFns / lambda 函数,它们的闭包中会有非常大的上下文,所以我建议查看代码中的任何闭包,并确保它们不包含非常大的上下文他们自己。

也许避免匿名 lambdas/DoFns 会有所帮助,因为上下文将是 class 的一部分,而不是序列化对象。

我首先尝试了上面的一些建议,但看起来其他答案中提到的upload_graph实验在更高版本中被删除了。

在将具有 90k+ 条目的 map 添加到现有管道时,为我解决问题的是将此 map 作为 MapSideInput 引入。 一般方法记录在我用来与 Beam 交互的 Scio 框架的这个例子中:

https://spotify.github.io/scio/examples/RefreshingSideInputExample.scala.html

这种方法没有明显的性能影响。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM