MongooseIM icon indicating copy to clipboard operation
MongooseIM copied to clipboard

[Memory Usage] gradually growing

Open fluttercid opened this issue 11 months ago • 4 comments

MongooseIM version: 4.2.0 Installed from: Helm chart (version 0.3.2) Image

Hello. I am applying it on k8s cluster and I am facing memory consumption issue on it.

vm.args)

Image

online users count)

Image

memory usage)

Image

Image

When 23 or 24 users are online without messages, memory usage is increased as above. Is this normal consumption with these users? If not, what and where can I adjust configurations?


After all users logout There is no change on onlineusers Image

Not much reducing memory usage Image

I appreciate your help in advance.

fluttercid avatar Feb 04 '25 12:02 fluttercid

Sure, connect to the erlang remote shell, check what is using memory:

        rp([{Len, case erlang:process_info(TopPid, registered_name) of {_,X} -> X; _ -> TopPid end, erlang:process_info(TopPid, [current_stacktrace])} || {Len, TopPid} <- lists:sublist(lists:reverse(lists:keysort(1, [{try element(2,erlang:process_info(Pid, memory)) catch _:_ -> -1 end, Pid} || Pid <- erlang:processes()])), 20)]).

Will show you which processes consume the most of memory. You can wait a bit and run in again. And check which processes consume the most.

To open debug shell, use something like mongooseim debug when connecting to the container shell.

arcusfelis avatar Feb 13 '25 16:02 arcusfelis

Extra information:

  • not ok, something could be wrong with your installation - could be some issue, like DB connection issues, or something is not consuming messages.
  • Check logs for more messages.
  • Debug with function above.
  • Our current installations have memory which is scales well with the number of users. So, your memory should be around 200megabytes (see the start of the graph). Maybe something happened at 20:00.

arcusfelis avatar Feb 27 '25 18:02 arcusfelis

Thank you for your response.

  1. at 20:00 login with 20 users and stay connect (regularly send ping request)
  2. I got this when I tried to use erl for memory check, I got this. (env with version 6.2.1)

Image Do you have any idea?

fluttercid avatar Feb 28 '25 18:02 fluttercid

Use mongooseim debug to open debug shell.

Or

/usr/lib/mongooseim/bin/mongooseim debug

erl just starts an erlang VM. It usually opens it, when you have erlang installed. Except, MongooseIM has built-in erlang VM, so some parts of it are stripped away, so erl command does not work properly anymore. But the correct way to open shell is mongooseim anyway.

arcusfelis avatar Mar 10 '25 06:03 arcusfelis