-
Notifications
You must be signed in to change notification settings - Fork 0
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
CVPN-1687: Fix memory usage #159
Merged
Merged
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
So far we are tracking only TCP connection disconnects. Move this metric to ConnectionManager::disconnect so that it will be tracked for UDP disconnects also.
This will help to track the number of connections linked-up, but not become online successfully.
In some cases, the connection is becoming link-up, but never become online. Since our inactive connection age out interval is 1 day, we are accumulating lot of inactive connections and waste memory. Introduce a new timeout STALE_AGE (60s) and disconnect the client, if it is not online by that time.
For outside plugins, we apply the plugins in two places. 1. In lightway_core::connection -> Ingress packets 2. In lightway_core::connection::WolfsslIoAdapter -> Egress packets So we had to store the outside PluginList in both places. But we were building PluginList twice from PluginFactory, instead of using the same instance. This will case ingress and egress use different instance of Plugin. This commit fixes that by using the same instance in both places.
We are counting client disconnects as unknown error metric, which is not an actual error. Add a separate metric to track client initiated disconnects.
e9b44b4
to
09bcd3f
Compare
Code coverage summary for 09bcd3f:
✅ Region coverage 56% passes |
xv-raihaan-m
approved these changes
Feb 11, 2025
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.
Description
Fixes and some tracing logs related to memory usage of Lightway server.
Motivation and Context
In prod, some of the lightway server instances were taking more memory.
This is because a lot of connections are stayed in LinkUp state and stayed there for 24 hours until age out timer kicked out.
This is unnecessary, since the connections which are not online within 1 minute will not be online.
So free those connections to save resources.
Also fixed a bug where we use two different instances of plugin for same connection for ingress and egress.
How Has This Been Tested?
Tested by using crafted client which stops after linkup and verified that server kickouts that connection after 1 miunute.
Types of changes
Checklist:
main