Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
ijtejedor #1
Member since Apr 2014 · 2 posts
Group memberships: Members
Show profile
Subject: Matrix vs agsx performance comparison
Hi everyone.

I'm trying to change agsx library to Matrix library.

I have noticed that requests arriving at OnMessage: with agsx onmessage event is triggered in 5-15 ms; but with Matrix is triggered in 450-550 ms.

Actually, I'm using Matrix library with a trial license. I'm not sure if this issue can modify times.

To describe the scenario, I'm using Openfire as XMPP server. Client and server, on Windows.

Thanks in advance.
Iván
Avatar
Alex #2
Member since Feb 2003 · 4298 posts · Location: Germany
Group memberships: Administrators, Members
Show profile
Matrix performs better than agsXMPP. Your numbers show the opposite with a factor of 40-100.
Something must go totally wrong in your tests or throttle the connection.

Alex
This post was edited on 2014-04-15, 10:49 by Alex.
Avatar
ijtejedor #3
Member since Apr 2014 · 2 posts
Group memberships: Members
Show profile
I'm agree with you, but I don't know where is the error.

Other Information I'd forgot, I'm using bosh.

This is my code to connect:

  1. Matrix.License.LicenseManager.SetLicense(lic);
  2.  
  3. _xmppClient.Transport = Matrix.Net.Transport.BOSH;
  4. _xmppClient.Uri = new System.Uri(string.Format("http://{0}:{1}/http-bind/", {XmppServerBosh}, {XmppPortBosh}));
  5.    
  6. _xmppClient.XmppDomain = {XmppServerBosh};
  7. _xmppClient.Port = {XmppPortBosh};
  8.  
  9. _xmppClient.SetUsername({userName});
  10. _xmppClient.Password = {userPassword};
  11.  
  12. _xmppClient.Resource = null;
  13.  
  14. _xmppClient.Show = Matrix.Xmpp.Show.chat;
  15.  
  16. _xmppClient.AutoRoster = true;
  17.  
  18. _xmppClient.AutoPresence = true;
  19.  
  20. _xmppClient.Compression = false;
  21.  
  22. _xmppClient.OnMessage += new EventHandler<MessageEventArgs>(xmppClient_OnMessage);
  23.  
  24. _xmppClient.Open();
This post was edited on 2014-04-15, 11:56 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4298 posts · Location: Germany
Group memberships: Administrators, Members
Show profile
OK, BOSH is a different scenario. The BOSH architecture in MatriX is totally different than in agsXMPP. In this BOSH component we address many issues we have seen over the last years.

One of them is that MatriX by default does not create more than 2 Webrequests per second. This is why new messages come in for you about every 500ms. But this does not mean that MatriX retrieves them slower, the opposite should be the case under high load. Because the server can send multiple stanzas to every web request, and it will queue some messages in the 500ms delay and deliver all at once when the next request hits the server. This results in less requests and therefore less HTTP overhead which results in higher throughput on high load.

SO under high load in MAtriX the OnMessage handler will look like that:

delay 500ms

OnMessage
OnMessage
.....
OnMessage
OnMessage

delay 500
OnMessage
OnMessage
.....
OnMessage
OnMessage
The OnMessage handlers for multiple incoming messages on 1 WebRequest fire without any delay. When they are all processed there will be a delay for 500ms until you get the next batch of OnMessage handlers.


Bosh gets often used in company networks with HTTP proxies. Without this delay many proxies also cause problems because of to much HTTP activity.

When required I can supply a way to adjust this delay value, but I would not recommend to lower it. The BOSH component in MatriX works much better than in agsXMPP, and also performs much better under high load.

Alex
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: MatriX RSS