Skip to content

⚡ Bolt: [performance improvement] Limit ingest pipeline LLM extraction concurrency#66

Draft
ishaanxgupta wants to merge 1 commit intomainfrom
bolt-parallelize-ingest-extractions-472928156518992823
Draft

⚡ Bolt: [performance improvement] Limit ingest pipeline LLM extraction concurrency#66
ishaanxgupta wants to merge 1 commit intomainfrom
bolt-parallelize-ingest-extractions-472928156518992823

Conversation

@ishaanxgupta
Copy link
Member

What:
Wrapped extraction agent arun invocations (_node_extract_profile, _node_extract_temporal, _node_extract_code, and _node_extract_snippet) inside inline async def helper functions bound by an asyncio.Semaphore(5).

Why:
While asyncio.gather successfully parallelized the extraction LLM queries, without an upper bound, long lists of batched queries could simultaneously fire off requests to the LLM backend, running a severe risk of triggering 429 Too Many Requests errors and API rate limits.

Impact:
Prevents unbounded concurrent requests to external API providers.
Sub-queries execute in predictable batches of up to 5, providing steady performance and preventing event loop starvation on massive workloads.

Measurement:
Validated via a mock benchmark.py that for 15 concurrent sub-requests, the execution was properly bounded to exactly 5 concurrent active tasks at peak while successfully allowing parallelism.


PR created automatically by Jules for task 472928156518992823 started by @ishaanxgupta

What:
Wrapped extraction agent `arun` invocations (`_node_extract_profile`, `_node_extract_temporal`, `_node_extract_code`, and `_node_extract_snippet`) inside inline `async def` helper functions bound by an `asyncio.Semaphore(5)`.

Why:
While `asyncio.gather` successfully parallelized the extraction LLM queries, without an upper bound, long lists of batched queries could simultaneously fire off requests to the LLM backend, running a severe risk of triggering 429 Too Many Requests errors and API rate limits.

Impact:
Prevents unbounded concurrent requests to external API providers.
Sub-queries execute in predictable batches of up to 5, providing steady performance and preventing event loop starvation on massive workloads.

Measurement:
Validated via `benchmark.py` that for 15 concurrent sub-requests, the execution was properly bounded to exactly 5 concurrent active tasks at peak.
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant