aws 发电机数据库吞吐量 [英] aws dynamo db throughput

查看:16
本文介绍了aws 发电机数据库吞吐量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于 AWS DynamoDb 吞吐量,我有些不明白.

There's something which I cant understand about AWS DynamoDb throughput.

让我们考虑强一致性读取.

Lets consider strongly consistent reads.

现在,我知道在这种情况下,1 个容量单位意味着我每秒最多可以读取 4KB.

Now, I understand that in this case, 1 unit of capacity would mean I can read up to 4KB of per second.

让我有点困惑的是每秒"位.如果您确切知道要以多快的速度读取数据,则可以适当地设置单位.但是,如果您对阅读时间不太挑剔怎么办?

It's the "per second" bit that slightly confuses me. If you know exactly how quickly you want to read data then you can set the units appropriately. But what if you're not too fussy about the read time?

假设我的表只分配了 1 个读取单元,我尝试读取超过 4KB 的项目.现在肯定这只是意味着我的阅读将花费超过 1 秒吗?那很好,但是文档谈到了请求失败.当我没有要求在特定时间内读取数据时,AWS 如何确定我使用了太多单位?

Say I do have only 1 read unit assigned to my table and I try to read an item which is more than 4KB. Now surely that just means that my read is going to take more than 1 second? That would be fine but the documentation talks about Requests failing. How can AWS determine that I used too many units when I didn't request that the data be read within a particular time?

也许我遗漏了一些明显的东西.有人可以帮忙解决这个问题吗?

Maybe I am missing something obvious. Can you someone help clear this up?

推荐答案

DynamoDB 在 突发容量.

DynamoDB can consume up to 300 seconds of unused throughput in burst capacity.

DynamoDB 中的最大项目大小为 400KB,1 个 RCU 可让您读取高达 4KB.

The maximum item size in DynamoDB is 400KB and 1 RCU gives you a read of up to 4KB.

假设您要读取一个大小为 400KB 的项目,并且您的桌子上有 1 个 RCU.您可以每 100 秒检索一次该项目.

Lets say you want to read an item that is 400KB in size and you have 1 RCU on your table. You could retrieve that item once every 100 seconds.

由于突发容量,您总会有一段时间可以读取该项目,因为实际上您一次最多可以使用 300 个 RCU,而不仅仅是 1 个.

Because of burst capacity there will always be a time you can read that item, because in fact you can use up to 300 RCUs in one go, not just 1.

想象一下从那个 400KB 的项目开始的表格.您需要等待 100 秒且不花费任何 RCU,以便您获得足够的爆发容量来获取该物品.101 秒后您提出请求,花费 100 RCU 并获得该物品.再过 5 秒后,您再次发出请求,但因节流异常而被拒绝.

Imagine starting the table with that 400KB item. You need to wait 100 seconds without spending any RCUs so that you've earned enough burst capacity to get the item. After 101 seconds you make the request, spend 100 RCUs and get the item. After another 5 seconds you make the request again, but get denied with a Throttling Exception.

所以不,DynamoDB 不会增加请求延迟以满足您的 RCU 规定.它要么尽快返回结果,要么抛出异常.

So no, DynamoDB will not increase request latency to meet your RCU provision. It either returns your results as fast as possible, or throws an exception.

顺便提一下,所有 AWS DynamoDB 开发工具包都会为您处理限制异常.如果您尝试读取某个项目,但由于没有足够的可用吞吐量而被拒绝,则 SDK 会退出并重试.因此,除非您的表确实配置不足,否则您不必担心处理限制异常.

By the way, I should mention that all AWS DynamoDB SDKs handle Throttling Exceptions for you. If you try and read an item, but get denied because you don't have enough throughput available, the SDK backs off and try again. So unless your table really is under provisioned, you shouldn't have to worry about handling Throttling Exceptions.

这篇关于aws 发电机数据库吞吐量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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