问题描述
我有一个设置为 400 RU/s 的 cosmosGB gremlin API.如果我必须运行需要 800 个 RU 的查询,是否意味着此查询需要 2 秒才能执行?如果我将吞吐量增加到 1600 RU/s,这个查询会在半秒内执行吗?通过使用 RU,我没有看到查询性能有任何显着变化.
I have a cosmosGB gremlin API set up with 400 RU/s. If I have to run a query that needs 800 RUs, does it mean that this query takes 2 sec to execute? If i increase the throughput to 1600 RU/s, does this query execute in half a second? I am not seeing any significant changes in query performance by playing around with the RUs.
推荐答案
正如我在一个不同但有些相关的答案这里,请求单位按秒分配.如果给定查询的成本高于该一秒窗口中可用的请求单位数:
As I explained in a different, but somewhat related answer here, Request Units are allocated on a per-second basis. In the event a given query will cost more than the number of Request Units available in that one-second window:
- 查询将被执行
- 您现在将陷入债务"状态按请求单位的超额
- 您将受到限制,直到您的债务"付清为止.还清了
假设您有 400 RU/秒,并且您执行了一个花费 800 RU 的查询.它会完成,但随后您将欠债约 2 秒(每秒 400 RU,乘以 2 秒).此时,您将不再受到限制.
Let's say you had 400 RU/sec, and you executed a query that cost 800 RU. It would complete, but then you'd be in debt for around 2 seconds (400 RU per second, times two seconds). At this point, you wouldn't be throttled anymore.
查询执行的速度与分配的 RU 数量无关.无论您有 1,000 RU/秒还是 100,000 RU/秒,查询都将在相同的时间内运行(除了任何阻止查询最初运行的节流时间).因此,除了限制之外,您的 800 RU 查询将始终如一地运行,无论 RU 数量如何.
The speed in which a query executes does not depend on the number of RU allocated. Whether you had 1,000 RU/second OR 100,000 RU/second, a query would run in the same amount of time (aside from any throttle time preventing the query from running initially). So, aside from throttling, your 800 RU query would run consistently, regardless of RU count.
这篇关于如何强制执行 cosmosDB RU 吞吐量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!