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?
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?