使用AWS Translation API时出现ThrottlingException [英] I get ThrottlingException while using AWS translate api

查看:70
本文介绍了使用AWS Translation API时出现ThrottlingException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行这段代码进行翻译

I am running this code to translate

translate = boto3.client(service_name='translate',
    aws_access_key_id="secret",
    aws_secret_access_key="secret",
    region_name='eu-central-1',
    use_ssl=True)

translate.translate_text(Text=data,SourceLanguageCode="de",TargetLanguageCode="en").get("TranslatedText")

代码在大多数测试中都能正常运行,但突然抛出以下错误:

Code runs properly for most of the test but suddenly throws the following error:

An error occurred (ThrottlingException) when calling the TranslateText operation (reached max retries: 4): Rate exceeded 

如何处理此异常?

推荐答案

此链接提供了节流异常的答案 https://docs.aws.amazon.com/translate/latest/dg/what-is-limits.html#limits-throttling 该服务根据交通模式扩大车队规模.我想知道您达到了什么节流极限.

This link has answers to throttling exceptions https://docs.aws.amazon.com/translate/latest/dg/what-is-limits.html#limits-throttling The service scales up the fleet based on the traffic pattern. I wonder at what TPS you hit the throttling limits.

&

您是否也尝试过eu-west-1这样的其他地区?

Have you also tried a different region like eu-west-1?

这篇关于使用AWS Translation API时出现ThrottlingException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆