[ejabberd] CPU Utilization on ejabber servers

Andreas van Cranenburgh andreas at unstable.nl
Fri Nov 4 00:14:06 MSK 2005


The following is a couple of hints & opinions. I'm trying not to
advocate things, but only trying to point out possible room for
improvement :)


On Thu, Nov 03, 2005 at 08:22:56PM +0200, Tiaan wrote:
>>    2. user activity / behaviour. are they sending each other a lot of
>>    messages? or just working and sending 1 message every hour?
> 
>    There is a lot of login / logoff activity and messages is being sent very
>    frequently, we also run many chat bots on the system, causing messages
>    originating from one user to be delevired to many users.

frequent login / logoff: educate users to keep the jabber client in the
systray. educate them to disable popups when the user has status "busy"
/ "away" (eg. Gajim has such settings).

many bots: consider rewriting bots to use PubSub, which can let people
subscribe to things, and then send new events to any user who is
subscribed, with a multicast-like idea (optimised for one-to-many).
downside of pubsub: even though ejabberd has pubsub, it might be
incomplete (someone explain to me...), furthermore clients need to
support pubsub (I think, again...).

>>    3. if there's memory free, then you installed too much memory. Or: you
>>    can store more things in memory instead of on-disk (note that this can
>>    be dangerous in case of power-loss, data can disappear).
>
>    Most of the Mnesia tables is configured to be stored on disk and
>    memory, the 2nd node is set to the defaults as on the first node.
> 

> [snip]

>    Round-robin howto is still missing in both the guide and the website
>    We use Windows's NLB (Network Load Balancing) to balance the load, which
>    is working very good.

So why don't you post an entry to http://ejabberd.jabber.ru to explain
how to do NLB? Preferably without lots of text but just with a few
screenshots, to get people started -- but that's just how I'd imagine
it.

BTW: round-robin comes down to two little DNS records. But before I'd
write a guide I wanna test it, and see if it works properly. I need said
server, for that.

>    Something else, it seems like the erlang prosses is configured not to use
>    more that 1GB of memory, as it's swapping while physical memory is still
>    available. Looking at the manual it seems like the "+A" and "+h" parameter
>    sets pool and heap values, but I don't know what the default is, nor what
>    to set it to.

Dude, that's exactly why I'd say try UNIX / Linux.

Windows is NOT optimised in its default configuration, because that is a
way to make money for MS and the rest of the closed-world food-chain. If
you hire a really expensive, certified Windows engineer, he'll tweak it
to make it handle more connections etc, and use less CPU. Please consult
the Google if you think I'm just a lying freak.

The same effect (possibly better), can be attained by installing
UNIX/Linux. Any distro would do. What's holding you back? Maybe your
company wants to hire me? Just kidding :P

The problem with Windows, I assume, is that it thinks it's pretty smart
at deciding how to do Virtual Memory. If it's swapping, then it's
certainly stupid, in your case! If it's wasting memory, and decides to
swap instead, well that sounds rather braindead.

But before I accuse teh venerable windows, maybe you configured ejabberd
to do some stuff on-disk, and maybe that's the disk activity in
question, or are you sure you're talking about lots of swapping? If you
generate too much page faults you can get into a downward spiral of
paging . . .

Seriously, I can't help you with tweaking Windows, not even for a 250
euros per hour I wouldn't (want to) know!

[ more, anyone? :P ]

-- 
        Andreas        [ http://unstable.nl | xmpp:andreas at unstable.nl ]
                       [  callto:ils.seconix.com/andreas at unstable.nl   ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.jabber.ru/pipermail/ejabberd/attachments/20051103/c10a7d72/attachment.bin


More information about the ejabberd mailing list