Menu

Supabase Edge Functions: fixing 546 WORKER_RESOURCE_LIMIT when you embed a transcript
📰

Supabase Edge Functions: fixing 546 WORKER_RESOURCE_LIMIT when you embed a transcript

DEV Community: typescript·Yusuf Yildiz·about 6 hours ago
#9xfVRkPk
#devtotypescript#devto#dev#batch#embedding
Long article (653 words) — no AI summary yet.
Reading 0:00
15s threshold

I was building a "search what was said in my videos" feature on Supabase: split each transcript into 30-second chunks, embed them with the built-in gte-small model, store the vectors in pgvector, and let someone ask a question and jump to the moment that answers it.

The embedding step kept killing my Edge Function:

546: WORKER_RESOURCE_LIMIT

Enter fullscreen mode

Exit fullscreen mode

It happened on an 18-minute video. I was looping over all 35 chunks and embedding them in one function call, and it died before the tenth.

Why it happens

gte-small runs inside the Edge Function, on CPU. One embedding is about 160 ms of CPU time. Thirty-five of them back to back blows past the per-request CPU budget, and Supabase kills the worker with 546.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.