Hi all,
After a few days testing and stressing several configurations of an ejabberd server I've found a issue related with memory consumption and roster sizes. Next you can find some measurements (2.000 connected and active users -messages, connections, disconnections, status changes-):
mem (RES) CPU erlang:memory() gen_fsm:loop
with roster (120 contacts/user) 876 M 75 % 1.103 M 17.721 bytes
without roster 133 M 8 % 61 M 2.594 bytes
Notice the enormous amount of memory required when using rosters. After some profiling I've found that the main responsible for this change is the memory consumed by each FSM process associated to every connected user: from 2.594 bytes to 17.721 bytes. After some research I've discovered that this additional & important amount of memory is mainly consumed by the there gb_sets associated to the management of presences (pres_t, pres_f, pres_i). I've tried to replace this memory based storage by disk storage (dets) without result. Any ideas on how to avoid this?
Thanks!
Solved!
Never mind! Removing some stuff in c2s frontends, compressing some data, delaying some notifications and forcing garbage collections in certain scenarios I've achieved significant memory savings.
Thanks anyway! :)
how can u do that? can you
how can u do that? can you show me the config that you changed?
It's not a matter of
It's not a matter of configuration. It's a modification of the ejabberd_c2s module. However, my changes to the module can only be applied due to the particularities of my environment: presence subscriptions are always bidirectional, users domains are restricted to a small set, some presence notifications can be dropped and others can be delayed, etc. Thanks to all those simplifications, the state of the c2s processes can be easily reduced.