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.…