Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Orion #1
Member since Jul 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: Message taking a long time to hit jabber server - slowest link appears to be agsXMPP
I have the following scenario:

ComputerA : Java client over smack xmpp (userA)
ComputerB : C# Bot operating w/ agsXMPP
ComputerB : Java client over smack xmpp (same client, different user, userB)
ComputerB : ejabberd

UserA sends the bot a message.  Bot receives the message, and as a result sends a message to UserB using the agsXMPP library. The problem is the messages take excessively long to make it to their destination.  Sometimes several minutes, though more frequently 15-20 seconds.  The first message goes through pretty quickly, but then each successive message takes a little longer, unless I give it a "break". 

Since I had so many systems going on here, I started timestamping the messages as they were received/sent by each system.  For my test, I issued the bot command 5 times in the course of about 1 second, and watched the time stamps. 

Everything is fast going from UserA to the Bot and to the point were the bot calls the xmppConnection.send().  The bot receives the messages just as fast as UserA sends them, and forwards the correct response to UserB via agsXMPP with equal speed.

However, the amount of time from when the message hits the agsXMPP library to when it is received by ejabberd server (as documented by the timestamps on recieved xml streams in the ejabberd log) is where all the lag is happening.  Once it hits ejabberd the time between that event an hitting clientB is also extremely fast.

The one last bit of critical information is this - the messages going from UserA to the bot are small - with the body of the message ~90 characters.  However, the message going from the bot to UserB is significantly larger - the body of the message is on the order of 17K characters.

The message *does* get through, but it takes forever.  It seems like XMPP is just taking my lengthy message body, wrapping it in the requisite xmpp xml format, and forwarding it on through the socketed connection to the server.  This seems like it should be fast - so why am I seeing a delay?  while 17K characters is much larger than 90, this is still a drop in the bucket particularly since the bot/xmpp server/user b client are all on the same box. 

Is there some sort of delay/prioritization logic going on that I'm not aware of?  What's going on here?
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Orion:
Is there some sort of delay/prioritization logic going on that I'm not aware of?  What's going on here?

yes there is in the ejabberd server. And I think this is your problem. If a user in this case your bot exceeds the limit from the server configuration then it slows down the client.
Look at traffic shapers in ejabberd.

Alex
Avatar
Orion #3
Member since Jul 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Thanks for the info - that appears to be the problem.  The timestamps were very misleading - I would've expected the received timestamps on the ejabberd log to mean when the message first hit, not when it was finally process.  Oh well, guess that's something to bring up w/ the ejabber group, and not here!  I truly appreciate the help though.
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
the log entries are when processing the stanzas. When you hit karma (traffic shapers) then messages get queued and not processed.

Otherwise the shapers would not help to stop abuse and bad users. Of course in a closed network where you havel no abuse you can disable thema or adjust to your requirements.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS