From f3448de2dad596f5484cd84c2f6ce7291d87c428 Mon Sep 17 00:00:00 2001 From: conico974 Date: Mon, 23 Jun 2025 15:09:29 +0200 Subject: [PATCH] Improve efficiency of the queue (#3373) Co-authored-by: Nicolas Dorseuil --- .../gitbook-v2/openNext/customWorkers/defaultWrangler.jsonc | 5 +++++ packages/gitbook-v2/openNext/customWorkers/doWrangler.jsonc | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/packages/gitbook-v2/openNext/customWorkers/defaultWrangler.jsonc b/packages/gitbook-v2/openNext/customWorkers/defaultWrangler.jsonc index e036db1c4..05b61fab7 100644 --- a/packages/gitbook-v2/openNext/customWorkers/defaultWrangler.jsonc +++ b/packages/gitbook-v2/openNext/customWorkers/defaultWrangler.jsonc @@ -122,6 +122,11 @@ ] }, "production": { + "vars": { + // This is a bit misleading, but it means that we can have 500 concurrent revalidations + // This means that we'll have up to 100 durable objects instance running at the same time + "MAX_REVALIDATE_CONCURRENCY": "100" + }, "r2_buckets": [ { "binding": "NEXT_INC_CACHE_R2_BUCKET", diff --git a/packages/gitbook-v2/openNext/customWorkers/doWrangler.jsonc b/packages/gitbook-v2/openNext/customWorkers/doWrangler.jsonc index e239202be..0ea87bbf2 100644 --- a/packages/gitbook-v2/openNext/customWorkers/doWrangler.jsonc +++ b/packages/gitbook-v2/openNext/customWorkers/doWrangler.jsonc @@ -98,7 +98,11 @@ }, "production": { "vars": { + // R2 is strongly consistent, so we can disable SQLite "NEXT_CACHE_DO_QUEUE_DISABLE_SQLITE": "true", + // We don't want to pollute the memory with broken cache entries + // Most of the time, those are fake requests. + "NEXT_CACHE_DO_QUEUE_MAX_RETRIES": "1", "STAGE": "production" }, "r2_buckets": [