Hello. I am seeing a high memory usage cowboy_protocol.init/4.
A brief overview about the application:
Data is aggregated into a genserver and updates are pushed out via websockets when the data changes or a new user is connected. The data changes a lot. - Pretty simple.
The dataset is fairly large.
To reduce the binary memory leak issue in the GenServers that aggregate the data, I had to manually garbage collect between each iteration.
I believe I have the same probably but now with each user connected via the socket.
My question is, how do you guys handle the websocket memory in phoenix? From what I am seeing, most people do not worry about it. My 100 users are eating about 500 mbs. When I trigger a GC from the observer tool, i reclaim about 400.
Is this something I should be using: https://hexdocs.pm/phoenix/Phoenix.Transports.WebSocket.html#module-garbage-collection
I guess what I am looking for is overall strategies. This application is in beta right now in our organization and will bump up to about 1000 users once I get this figured out.