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

Optimization feasibility in CustomCommandManagerSession #834

Closed
Xizt opened this issue Nov 27, 2024 · 0 comments · Fixed by #836
Closed

Optimization feasibility in CustomCommandManagerSession #834

Xizt opened this issue Nov 27, 2024 · 0 comments · Fixed by #836

Comments

@Xizt
Copy link
Contributor

Xizt commented Nov 27, 2024

Feature request type

enhancement

Is your feature request related to a problem? Please describe

We are running garnet in cluster mode and have high incoming number of connections from our partners. This following issue is though reproducible in standalone mode as well. Here is a small repro of the issue:

Started server with following arguments: --no-obj False --cluster False --clean-cluster-config False --aof False --lua False --lua-transaction-mode False --server-certificate-required False --tls False --latency-monitor False --logger-freq 5 --fast-commit False --main-memory-replication False --on-demand-checkpoint False --aof-null-device False --use-azure-storage-for-config-import False --use-azure-storage-for-config-export False --use-native-device-linux False --extension-allow-unsigned False

More importantly, we have not enabled lua transaction or neither enabled object store in the configuration.
Once the server is initiated, we created multiple connections to the same server. With each, garnet creates a new Session object which also has a CustomCommandManagerSession. Each of these connections acquires ~1MB memory. Following is the snapshot before and after making 5 connections:
Image
Image

With each connection, a new sessionTransactionProcMap is allocated
sessionTransactionProcMap = new (CustomTransactionProcedure, int)[CustomCommandManager.MaxRegistrations];

With our incoming connections exploding to 5k-6k per node, the allocation runs as high as 6GB. Requesting optimization possibilities with this code.

Describe the solution you'd like

Can custom command be a flag if it needs to be enabled.
Possibilities of Lazy initialization.

Describe alternatives you've considered

No response

Additional context

No response

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