[ejabberd] Speeding up ejabberd's start-up process

Badlop badlop at gmail.com
Sun May 18 23:13:36 MSD 2008


On Thu, May 1, 2008 at 12:35 PM, Peter Schwindt
<peter.schwindt at gmail.com> wrote:
> I'm (still) using ejabberd 1.1.4 (amd64, mnesia db) and after talking
> to Kev I'm quite impressed:
>
> My box (jabber.ccc.de, about 38k users) needs about 5 to 10 minutes
> from starting ejabberd until users are able to login. Kev told me that
> jabber.org only needs about 10 seconds.
>
> How comes? Is using an external DBMS (pgsql in case of jabber.org)
> that good?

Summary:
Using an external storage for huge tables speeds up ejabberd startup.

Detailed answer:
An empty recently-installed ejabberd takes 1 second to start in my machine.

I checked an jabber.org log of some weeks ago: it took 38 seconds to
start completely.
The time was probably consumed loading some Mnesia tables, creating
the MUC-room processes and serving some impatient clients that
couldn't wait ejabberd to be fully started.


Check your Mnesia tables in ejabberd Web Admin -> Nodes -> your node
-> Data Base
Where Size is the number of records in the table and Memory is the
bytes of the table.
Alternatively you can look at the size of files in mnesia spool dir.

I wouldn't be surprised if the offline_msg table is 100 MB. And the
table vcard more than 200 MB. If your users tend to use transports,
then the roster table may be way more than 40 MB.

jabber.org uses external storage for roster, vcard and offline_msg.
When ejabberd is started, those massive tables don't need to be
loaded, since they are stored by pgsql elsewhere.


You have 38.000 registered accounts in jabber.ccc.de. If I remember
correctly, that server is running since many years ago. If you still
keep the accounts since the server started years ago, then you have
many unused accounts.

In that scenario, I expect in the last month only 5.000 or less were
used. And in the last year, 15.000 or less. You can check in ejabberd
Web Admin -> Virtual Hosts -> your vhost -> Last Activity.

You can purge unused accounts: remove the accounts (and associated
data of accounts) that were not used in the last X months. With that
you can start ejabberd faster, DB backup is faster, and your backup
files are smaller; and you unblock usernames so other people can use
them.

The contributed module mod_ctlextra implements a command for ejabberdctl:
  delete-older-users days     delete users that have not logged in the
last 'days'

---


More information about the ejabberd mailing list