Skip to content

Commit 39c553e

Browse files
thomasgauvinMaddy-Cloudflare
authored andcommitted
Update FAQ for bulk updates KV (#22170)
* Update limits.mdx * update faq for limits re 1000 limits and bulk reads
1 parent 8b8e93f commit 39c553e

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/content/docs/kv/api/read-key-value-pairs.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,12 @@ The `cacheTtl` parameter must be an integer greater than or equal to `60`, which
253253
254254
The effective `cacheTtl` of an already cached item can be reduced by getting it again with a lower `cacheTtl`. For example, if you did `NAMESPACE.get(key, {cacheTtl: 86400})` but later realized that caching for 24 hours was too long, you could `NAMESPACE.get(key, {cacheTtl: 300})` or even `NAMESPACE.get(key)` and it would check for newer data to respect the provided `cacheTtl`, which defaults to 60 seconds.
255255
256+
### Requesting more keys per Worker invocation with bulk requests
257+
258+
Workers are limited to 1000 operations to external services per invocation. This applies to Workers KV, as documented in [Workers KV limits](/kv/platform/limits/).
259+
260+
To read more than 1000 keys per operation, you can use the bulk read operations to read multiple keys in a single operation. These count as a single operation against the 1000 operation limit.
261+
256262
## Other methods to access KV
257263
258264
You can [read key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#kv-key-get) and [from the REST API](/api/resources/kv/subresources/namespaces/subresources/values/methods/get/).

src/content/docs/kv/platform/limits.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { Render } from "~/components"
2525
| Value size | 25 MiB | 25 MiB |
2626
| Minimum [`cacheTtl`](/kv/api/read-key-value-pairs/#cachettl-parameter) | 60 seconds | 60 seconds |
2727

28-
[^1]: Within a single invocation, a Worker can make up to 1,000 operations to external services (for example, 500 Workers KV reads and 500 R2 reads).
28+
[^1]: Within a single invocation, a Worker can make up to 1,000 operations to external services (for example, 500 Workers KV reads and 500 R2 reads). A bulk request to Workers KV counts for 1 request to an external service.
2929

3030
<Render file="limits_increase" product="workers" />
3131

src/content/docs/kv/reference/faq.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ Workers KV stores data in central stores and replicates the data to all Cloudfla
2828

2929
Refer to [How KV works](/kv/concepts/how-kv-works/).
3030

31+
### If a Worker makes a bulk request to Workers KV, would each individual key get counted against the [Worker subrequest limit (of 1000)](/kv/platform/limits/)?
32+
33+
No. A bulk request to Workers KV, regardless of the amount of keys included in the request, will count as a single operation. For example, you could make
34+
500 bulk KV requests and 500 R2 requests for a total of 1000 operations.
35+
3136
## Pricing
3237

3338
### When writing via Workers KV's [REST API](/api/resources/kv/subresources/namespaces/methods/bulk_update/), how are writes charged?

0 commit comments

Comments
 (0)