fix(preprod): Reduce snapshot download concurrency to prevent stream failures#116267
Merged
NicoHinderling merged 1 commit intoMay 27, 2026
Merged
Conversation
…failures Large snapshots (~40K images) cause the download stream to die after ~15s with an HTTP/2 INTERNAL_ERROR. At 32 workers / 200 batch, the endpoint produces ~157 MB/s and pushes RSS to ~906 MB (past the 600 MB reload_on_rss threshold), overwhelming the HTTP/2 transport layer. Halving to 16 workers / 100 batch reduces both throughput and memory pressure while keeping each batch well within the 90s proxy timeout.
mtopo27
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduce
FETCH_MAX_WORKERSfrom 32 → 16 andFETCH_BATCH_SIZEfrom 200 → 100 in the snapshot image download endpoint.Large snapshots (~40K images) cause the streaming download to fail after ~15 seconds with an HTTP/2
INTERNAL_ERROR. The server-side logs show:reload_on_rssthreshold)client_disconnectThe high concurrency causes Python memory fragmentation (32 threads churning through ~600 KB images) that pushes RSS past container limits, and the throughput overwhelms HTTP/2 flow control. Halving both constants reduces memory pressure and data rate while keeping each batch well within the 90s proxy timeout.