ejabberd - Comments for "Chatrooms (muc) from external Database possible?" https://www.ejabberd.im/node/1251 en Sweep Rooms https://www.ejabberd.im/node/1251#comment-55276 <p>My application does a similar thing with conference rooms. I have deployed the mod_muc_admin module which provides a function to delete unused rooms. I run this once an hour. This keeps the memory under control and prevents a room creation rate that exceeds ejabberd's resources.</p> Tue, 09 Feb 2010 15:25:38 +0000 lazzarello comment 55276 at https://www.ejabberd.im A hard choice https://www.ejabberd.im/node/1251#comment-55275 <p>Thanks for the informative reply.<br /> I didn't know each room is a process, no matter there are occupants or not. So, my initial design was a bad one.<br /> To be more specific, the scenario is as follow: each player in our game owns a "shop", which enable the owner to decorate the shop and his/her friends to visit the shop exchange goods there. I want the presence of a player in a shop and the interaction within to be exchanged by MUC. If the chat rooms are not persistent, virtually a room will be created and destroyed every time a player visit a shop, which is very frequent. There would be a lot of communication between clients and the server. If chat rooms are persistent, since the ratios of concurrent users/registered users is less than 1/100, more than 99% of chat rooms would be idle while taking up memory. That's a hard choice, any suggestions? Or maybe we should not use ejabberd in this way?</p> Tue, 09 Feb 2010 14:02:03 +0000 linzhp comment 55275 at https://www.ejabberd.im Let's make some numbers https://www.ejabberd.im/node/1251#comment-55272 <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>(2) how ejabberd uses those memory, the size of muc_room.DCD and muc_room.DCL is only about 200M in total; even mnesia stores them in memory, it wouldn't need so huge menory. </p></div> <p>Each alive room is represented in ejabberd as a process which keeps track of its configuration, presence, message history, ... Additionally, some information is stored in the database persistently.</p> <p>I've made some quick numbers. When a room is created and a user joins, the process of the room has a heap_size of 2600 words:<br /> 2600 words * 32 bits/word * 1/8 byte/bits = 10.400 bytes = 10 KB</p> <p>If you create one room per registered account: 300000 rooms * 10 KB = 3000000 KB = 3000 MB = 3 GB</p> <p>If you configure the rooms to be persistent, etc, the consumption per room increases. If you use a 64 bit machine, the memory consumpion doubles.</p> <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>I wonder (1) if storing muc in MySQL would be less memory consuming,</p></div> <p>As you can see, it wouldn't.</p> <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>each user owning a persistent chat room</p></div> <p>Consider your design: you create a Multi User Chat room for each account that was registered, even if it wasn't used in several days, even if it is only used for 1 hour each day, even if the room has only 1 occupant ever.</p> Tue, 09 Feb 2010 10:05:33 +0000 mfoss comment 55272 at https://www.ejabberd.im MUC is so memory consuming https://www.ejabberd.im/node/1251#comment-55268 <p>My actual interest in mod_muc_odbc is because MUC is so memory consuming. We use ejabberd as the backend of a multi-user online game, which to date creates 300,000 users in ejabberd's database, with each user owning a persistent chat room. The concurrent online users are about 3000+.</p> <p>The memory used by ejabberd can increase to more than 10G in a few hours after restart. Now I delete muc_room.DCD and muc_room.DCL, which in effect deletes all the persistent rooms I guess, things seem to be better.</p> <p>I wonder (1) if storing muc in MySQL would be less memory consuming, (2) how ejabberd uses those memory, the size of muc_room.DCD and muc_room.DCL is only about 200M in total; even mnesia stores them in memory, it wouldn't need so huge menory.</p> <p>version of ejabberd: 2.0.5, OS: CentOS</p> Sun, 07 Feb 2010 14:45:27 +0000 linzhp comment 55268 at https://www.ejabberd.im Maybe mod_muc_admin https://www.ejabberd.im/node/1251#comment-55266 <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>It has been a year since last post, what's the current progress? Is mod_muc_odbc implemented?</p></div> <p>Only mod_muc is available, which stores room information in the internal Mnesia database. If your interested in ODBC storage is to allow you to modify/read room information, maybe <noindex><a href="/mod_muc_admin" rel="nofollow" >mod_muc_admin</a></noindex> is useful to you. It provides commands that you can call in the shell ejabberdctl, or using XML-RPC, or using HTTP REST calls.</p> Fri, 05 Feb 2010 18:51:57 +0000 mfoss comment 55266 at https://www.ejabberd.im Is mod_muc_odbc implemented? https://www.ejabberd.im/node/1251#comment-55263 <p>It has been a year since last post, what's the current progress? Is mod_muc_odbc implemented?</p> Fri, 05 Feb 2010 02:00:35 +0000 linzhp comment 55263 at https://www.ejabberd.im mod_muc_odbc https://www.ejabberd.im/node/1251#comment-54020 <p>This will require commiting a new module to the codebase, possibly called mod_muc_odbc. This module does not exist right now, so the answer to your question is "no". It's a desired feature. I'm putting some work into it myself.</p> Mon, 16 Feb 2009 17:23:07 +0000 lazzarello comment 54020 at https://www.ejabberd.im