gpt4 book ai didi

amazon-dynamodb - 如何解决dynamodb的吞吐量错误?

转载 作者:行者123 更新时间:2023-12-03 14:31:07 24 4
gpt4 key购买 nike

回溯(控制台的最后输出):

File "batchpy.py", line 61, in <module>
obj.batch_w1()
File "batchpy.py", line 49, in batch_w1
batch.put_item(data=item)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/table.py", line 1641, in __exit__
self.resend_unprocessed()
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/table.py", line 1718, in resend_unprocessed
resp = self.table.connection.batch_write_item(batch_data)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/layer1.py", line 420, in batch_write_item
body=json.dumps(params))
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/layer1.py", line 2842, in make_request
retry_handler=self._retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 954, in _mexe
status = retry_handler(response, i, next_sleep)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/layer1.py", line 2876, in _retry_handler
response.status, response.reason, data)
boto.dynamodb2.exceptions.ProvisionedThroughputExceededException: ProvisionedThroughputExceededException: 400 Bad Request
{u'message': u'The level of configured provisioned throughput for the table was exceeded. Consider increasing your provisioning level with the UpdateTable API', u'__type': u'com.amazonaws.dynamodb.v20120810#ProvisionedThroughputExceededException'}

最佳答案

有两种方法可以处理这个问题:

  • 提高吞吐量水平(对于此选项,您必须支付更多费用)。
  • 通常我们在某些时候必须做的方式是我们需要在应用程序级别实现逻辑。例如,调用 dynamoDB 来检查异常。如果超过吞吐量,休眠几秒钟并再次调用相同的查询(这是我们在我们的应用程序中实现的)。
  • 关于amazon-dynamodb - 如何解决dynamodb的吞吐量错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31468379/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com