From 24dd0df2a6ad9fd3a6aa25e4975d3813c6aa267f Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Wed, 29 Nov 2023 13:13:21 -0800 Subject: [PATCH] fix: Try to resolve heap memory errors (#435) We are seeing errors in prod relating to javascript running out of memory due to the heap growing. Most likely culprit is the block prefetch. There may be some characteristics in prod that cause this error, but not in dev. Failures cause the entire machine to crash and restart. We'll reduce the prefetch queue size, which is likely the largest memory eater in the worker, to hopefully avoid this worker heap memory issue. --- runner/src/stream-handler/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runner/src/stream-handler/worker.ts b/runner/src/stream-handler/worker.ts index 5897c0880..030b8e770 100644 --- a/runner/src/stream-handler/worker.ts +++ b/runner/src/stream-handler/worker.ts @@ -53,7 +53,7 @@ function incrementId (id: string): string { } async function blockQueueProducer (workerContext: WorkerContext, streamKey: string): Promise { - const HISTORICAL_BATCH_SIZE = 100; + const HISTORICAL_BATCH_SIZE = 10; let streamMessageStartId = '0'; while (true) {