-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cap error heap usage #987
Merged
Merged
Cap error heap usage #987
Conversation
This file contains 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
Jake-Shadle
requested review from
markmandel,
XAMPPRocky and
koslib
as code owners
July 4, 2024 15:12
markmandel
reviewed
Jul 12, 2024
Don't bother sending resource update if there aren't actually any changes
This allows easier testing of proxies by creating a certain number of unique tokens of a specified length to each address in --to
This can be used to do the same thing as --to-tokens but to a config file instead of directly via cli
Jake-Shadle
force-pushed
the
cap-error-heap
branch
from
August 5, 2024 12:46
b3c2c38
to
7d0cdbb
Compare
Jake-Shadle
force-pushed
the
cap-error-heap
branch
from
August 5, 2024 12:57
343be17
to
052edbf
Compare
XAMPPRocky
approved these changes
Aug 5, 2024
Build Succeeded 🥳 Build Id: d2794817-c17c-442a-ab47-3ba5ba9930af The following development images have been built, and will exist for the next 30 days: To build this version:
|
markmandel
added
kind/bug
Something isn't working
area/performance
Anything to do with Quilkin being slow, or making it go faster.
and removed
kind/other
labels
Aug 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/performance
Anything to do with Quilkin being slow, or making it go faster.
kind/bug
Something isn't working
size/l
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.
This is a rework of #986
This resolves an unbounded memory growth issue that can occur in a particularly hostile context, ie, every packet is invalid in some way, generating an error, and CPU usage is high enough that tasks, notably
quilkin/src/components/proxy/packet_router.rs
Lines 272 to 295 in 50d91e4
do not consistently receive CPU time. In this context, where every received packet generates an error, which is then sent to an unbounded channel before being dequeued, the dequeue task might not run quickly enough to dequeue each error, causing both the memory allocated by the error, as well as by the queue, grow quickly enough that the process can be OOM killed.
This PR changes it so that instead of each error being sent to an unbounded channel, the errors are instead accumulated by the receive tasks themselves, and those accumulations being sent to the print task once they reach a cap, or a certain amount of time since the first error was pushed has elapsed to a bounded channel. If the bounded channel is full and too many errors are accumulated on a particular receive task, we drop the errors and note that it happened, rather than risk consuming too much heap memory.
Previously:
This PR:
While investigating I ran into a bug with xDS filterchain where the server will send empty delta updates, so now the server doesn't send updates if the resource(s) haven't changed.
Also added 2 ways to generate unique tokens, one where n tokens of length l are generated and written to ./quilkin-test-config.yaml that can be used with
-c
, and the other is with a new--to-tokens
arg on proxy that can do the same, assigning unique tokens of a specific length to each address in--to
.Resolves: #983