Skip to content
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

Conditionally allocate CustomCommandManager to reduce overhead #829

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

msft-paddy14
Copy link
Contributor

Currently, even if CustomCommands are not required, a CustomCommandManager session is silently created with every RespSession and adds an overhead of ~1MB per connection. For ~10k connections, this overhead can be huge upto 10GB. Not trying to address the overhead amount here but disabling it for scenarios which don't even use CustomCommands.

From memory dump
image

@@ -185,7 +185,7 @@ public RespServerSession(
bool enableScripts)
: base(networkSender)
{
this.customCommandManagerSession = new CustomCommandManagerSession(storeWrapper.customCommandManager);
this.customCommandManagerSession = storeWrapper.serverOptions.LoadModuleCS != null ? new CustomCommandManagerSession(storeWrapper.customCommandManager) : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! However, you have to update the unit tests also to enable LoadModuleCS because the ones using modules are breaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants