[Server-devel] ejabberd eating lots of CPU time - how to diagnose?

Martin Langhoff martin.langhoff at gmail.com
Mon May 25 10:35:33 EDT 2009


On Mon, May 25, 2009 at 3:45 PM, Daniel Drake <dsd at laptop.org> wrote:
> Running XS-0.5.2 at a school. top shows that ejabberd ("beam.smp") is
> using lots of CPU time, in irregular spikes. It has used 43 hours of
> CPU time since I last restarted it 3 days ago (restarting did not
> change anything). It is a big school but even at times when there are
> as few as 33 users connected the situation is the same (and much of
> the 43 hours of CPU time will have happened over the weekend when
> there were probably even fewer users).

Strange.

 - What does `ejabberdctl stats registeredusers ` say?
 - What does `ejabberdctl registered-users` say?

My guess is that some users disconnected "abnormally" (from ejabberd's
PoV) and ejabberd is busy trying to tell them things. For some
reason,such connections don't time out, or timeout after ridiculously
long periods.

If that's the cause, I haven't had a chance to investigate in depth,
but it'd be good to set ejabberd with a shortish timeout.

> 1 thread doing lots of reading from
> /var/lib/ejabberd/spool/pubsub_item.DAT (2.6mb in size, what is
> this?),

that's the silly "who should know about user X
connecting/disconnecting?" When you're using @online@ the answer is
everyone, and it should be from an in mem datastructure. But that's
not how it's implemented :-/

hth!




m
-- 
 martin.langhoff at gmail.com
 martin at laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff


More information about the Server-devel mailing list