-
Notifications
You must be signed in to change notification settings - Fork 62
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
[Question]: How to optimise the memory usage for websocket client #111
Comments
Use a profiler and check where the memory is actually used up, and then we can look at optimizing those things :) |
I profiled using instruments and found that During profiling I also found that |
Which part? |
I see. Do you see any possibility of optimization in there? :) |
Hi,
I am writing a load testing tool and my use case demand opening up many websocket connections to a server, each connection is long lived and has a keep-alive send and receive mechanism, where every client sends "keep-alive" (text message) at interval of 4 second. Server also sends keep-alive text and some events as they occur.
Running that load tool on a k8 pod with 4G of memory limit results in OOM after opening up 5000 connections. I suspect the memory usage shoots up because of websocket connections as I tried to run without opening connection and memory usage was well under 500M.
I was wondering if there is a way to reduce the memory usage of client since I would like to open as many connections as possible with limited resource without triggering OOM.
I am using tokio-runtime with this library, I tried various different libraries such as:
I did not find any difference significant difference.
Thanks
The text was updated successfully, but these errors were encountered: