Repository navigation
fix(pii): bound NER memory per worker so large texts stop OOM-killing Presidio workers - #10068
Merged
Merged
Conversation
… Presidio workers
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThis PR reduces NER memory use within each Presidio worker.
No actionable issues were found.
|
This branch was successfully deployed
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.
Summary
Child process diedwith noMaximum request limitline before it. The trigger is full-NER traffic carrying single texts between the client's 256KB chunk budget and spaCy's 1Mmax_length. Those went whole through one NER pass, which peaks about 3.3GB above the worker's baseline for about 4s.NER_WINDOW_CHARS, instead of only texts overmax_length. This reuses the windowing from fix(pii): mask texts over spaCy's length limit and drop encoded files from logs #9979: pattern and custom recognizers still run over the whole text, and every window's spans are kept._NER_SLOT). A long text takes it per window, so it interleaves with other requests. Regex-only requests never take it.MALLOC_ARENA_MAX=2in the image, and/healthis async so health checks never queue behind waiting threads.Type of Change
Testing
Reproduced on a box with the exact pinned deps, the real entrypoint and 2 workers. Memory and CPU were capped in proportion to prod (
MemoryMax=10G,CPUQuota=200%), with 16 concurrent clients sending 2000-text full-NER batches plus 30% single texts of 300–900KB, for 5 minutes:Child process died)MALLOC_ARENA_MAXwithout the lock left 2.test-pii-redaction-e2e.tslong-text check (over 1M chars) still goes through the same windowed path.Checklist
test-auditauthoring gate)