Repository navigation
Conversation
Full garbage collections walk the registry, feature definitions and protobuf classes that the feature server keeps for its whole life. In a worker this blocks the event loop for tens of milliseconds and shows up as slow online store reads. The new option runs gc.collect() and gc.freeze() after the app is built and before gunicorn forks the workers. Off by default; also available as feature_server.gc_freeze. Signed-off-by: Alexander Borgatin <[email protected]>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7089 +/- ##
==========================================
+ Coverage 50.97% 51.01% +0.03%
==========================================
Files 455 455
Lines 56994 57008 +14
Branches 8321 8323 +2
==========================================
+ Hits 29055 29082 +27
+ Misses 25954 25939 -15
- Partials 1985 1987 +2
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This branch has not been 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.
What this PR does / why we need it:
Adds an opt-in
feast serve --gc-freezeflag, also available asfeature_server.gc_freezeinfeature_store.yaml.Full GC collections in a feature server worker walk the registry, feature definitions and protobuf classes that live for the whole process. Each one blocks the event loop for 50–75 ms, and the requests waiting at that moment look like slow online store reads. With the flag, the server runs
gc.collect()andgc.freeze()in the gunicorn master after the app is built and before the workers fork. Workers inherit the frozen state, including the ones restarted by--max-requests. On Windows, where the server runs on uvicorn without gunicorn, it freezes afterget_app. Off by default, so nothing changes for current users.Also adds a short "Garbage collection pauses" section to the performance tuning guide and the flag to the Python feature server reference.
Which issue(s) this PR fixes:
Fixes #7088
Checks
git commit -s)Testing Strategy
Unit tests check the call order (collect, freeze, then the gunicorn run) for the flag and the config, and that nothing is frozen by default.
Manual test: one worker, 15 req/s for 10 min. Requests over 50 ms went from 16 of 8,991 to 0 of 8,933, p99.9 from 61 to 29 ms. Also tested on a Kubernetes deployment with 0.65.0 and
--max-requests, with the same result. Details in #7088.