Hello,
I am still trying to figure out why ejabberd spends so much memory when deployed on real site with real users.
I sorted all the processes in ejabberd by consuming memory:
pid name current msgq mem cpu
<0.28831.2> (ejabberd_c2s:init/1) (prim_inet:send/2) 6056 62880 0
<0.32611.3> (ejabberd_c2s:init/1) (prim_inet:send/2) 2800 32186 0
<0.4614.4> (ejabberd_c2s:init/1) (prim_inet:send/2) 2446 25755 0
<0.22393.4> (ejabberd_c2s:init/1) (prim_inet:send/2) 1953 25740 0
<0.15.5> (ejabberd_c2s:init/1) (prim_inet:send/2) 1659 20595 0
<0.31944.4> (ejabberd_c2s:init/1) (prim_inet:send/2) 1565 20592 0
<0.31252.4> (ejabberd_c2s:init/1) (prim_inet:send/2) 1287 16475 0
<0.13786.4> (ejabberd_c2s:init/1) (prim_inet:send/2) 1254 16474 0
<0.11932.5> (ejabberd_c2s:init/1) (prim_inet:send/2) 1218 16473 0
As you can see all the memory eaters are client FSMs.
They got a large message queues and the queues contain {route .... } messages with outgoing stanzas.
All the processes are blocked on socket send operation. All the client sockets have send_timeout option enabled. Maybe the timeout error is not handled properly?
Does anyone have a clue why does all this happens and how to aid it?
Currently I am trying ejabberd snapshot 2.1.0 r1931.
This was also discussed at
This was also discussed at mailing list.
I wrote a simple patch to aid the problem. The patch is in the mailing list too.