[ejabberd] chatroom cleaning

Badlop badlop at gmail.com
Fri Nov 16 01:31:20 MSK 2007

2007/11/15, Peter Saint-Andre <stpeter at stpeter.im>:
> The conference.jabber.org MUC service has 3654 rooms. Probably most of
> them are not needed (rooms used to default to persistent, but we changed
> that a while ago). Does Mnesia keep information about the last access
> time for a chatroom?

No. But the chatroom has a history of last messages, including the timestamps.

This information is used by the function mod_muc_admin:decide_room/2
to decide if a chatroom is kept or destroyed. That function is used by
the ejabberdctl commands
muc-unused-destroy and muc-unused-list. It requires ejabberd SVN.

The module mod_muc_admin is available in ejabberd-modules SVN.

> If so, I assume that I can do a dirty delete to remove old rooms.

If you already have a list of the rooms you want to destroy, you can
use the new command muc-destroy-file implemented in mod_muc_admin.
This one works with ejabberd 1.1.3 and newer.

> Oh, also the IQ-result for the room list is 271330 bytes, which is a
> problem for s2s communication if one of the servers doesn't allow
> stanzas that big. :)

Even if that stanza doesn't hit any limit, it is anyway a problem:
 - for your server: CPU consumption while constructing the XML
 - for the receiving Jabber client: CPU and RAM consumption while
parsing the XML
 - for the receiving machine: bandwidth consumption while receiving the stanza
 - for the receiving user: a list of 3600 items is not much
human-friendly I guess.

More information about the ejabberd mailing list