使用 AWS Glue 時,如何防止出現 ThrottlingException 或速率超出錯誤?

1 分的閱讀內容
0

當我進行 AWS Glue API 呼叫時,我收到 ThrottlingException 錯誤訊息,指示已超出我的速率。

簡短描述

當您提出 AWS Glue API 請求時,您可能會收到類似於以下其中一項內容的錯誤:

  • "Error Code: ThrottlingException; Request ID: 07512ede-123f-49c8-8933-1298742297b9; Proxy: null)" } }{ "taskSubmitFailedEventDetails": { "resourceType": "glue", "resource": "startJobRun.sync", "error": "Glue.AWSGlueException", "cause": "Rate exceeded (Service: AWSGlue; Status Code: 400;"
  • "TaskSubmitFailed": {"resourceType": "glue", "resource": "startJobRun.sync", "error": "Glue.AWSGlueException", "cause": "Rate exceeded (Service: AWSGlue; Status Code: 400; Error Code: ThrottlingException; Request ID: 70ea5ab7-2bb8-4a47-b957-799ef46c129e; Proxy: null)" }"
  • "botocore.exceptions.ClientError: An error occurred (ThrottlingException) when calling the GetCrawler operation (reached max retries: 4): Rate exceeded cause": "Rate exceeded (Service: AWSGlue; Status Code: 400; Error Code: ThrottlingException; Request ID: 70ea5ab7-2bb8-4a47-b957-799ef46c129e; Proxy: null)"

AWS Glue API 請求會針對每個區域的 AWS 帳戶進行調節,以協助服務效能。如需詳細資訊,請參閱 AWS Glue 端點和配額

解決方案

請遵循以下最佳實務,以減少 ThrottlingException 或速率超出錯誤:

  • 減少 API 呼叫的頻率。
  • 錯開 API 呼叫之間的間隔,以便它們不會全部同時執行。
  • 使用可傳回多個值的 API。例如,GetPartitions 支援透過一個 API 呼叫呼叫 1000 個值。同樣,GetTables 支援透過一個 API 呼叫呼叫 100 個參數。
  • 進行 API 呼叫時,實作錯誤重試和指數退避
  • 使用 AWS CloudTrail 主控台,檢查在指定時段內傳送了哪些 API 呼叫以及傳送了多少個 API 呼叫。

如果您已嘗試了這些疑難排解步驟,但仍然收到速率超出錯誤,則請求提升服務配額

**注意:**在請求增加配額之前,請確定導致該錯誤和呼叫速率的 API 呼叫。


相關資訊

常見錯誤

AWS 官方
AWS 官方已更新 1 年前