Angie: Building Large Scale AJAX Chat System

Posted by Mickaël Rémond on March 12, 2007

Ejabberd "Angie" is our internal codename for the next version of the High-Performance Instant Messaging server (See our previous post presenting Angie). The next version is going to offer a High-Performance HTTP server, for convenience and scalability purpose. It will both help the deployment of in-browser, AJAX-based chat solution but also will make it able to sustain an extremely high loads.

The problem: deployment and scalability issues

Many ejabberd system administrators have always wanted to have a simpler way to deploy AJAX based chat tools on top of ejabberd.

The difficult part is a well known Javascript security limitation. The main characteristics of XMPP AJAX based chat tool is that you need to have the URL for the HTTP polling or HTTP binding protocol to be on the same domain that the code of the AJAX tool itself. In practice, this means that you need to use Apache as a proxy, to deploy an AJAX tool like JWChat on your website (See ejabberd with JWChat tutorial).

This approach have several drawbacks. It makes the whole system pretty complex to deploy as you need to configure and operate two components. It also make the system less scalable: It is not a problem for ejabberd to handle thousands of HTTP polling or binding simultaneous connections, but it quickly become a problem for the Apache proxy, that cannot sustain such a high load.

The solution: serve AJAX code with a high-performance HTTP server inside ejabberd

The solution is to provide an all-in-one solution by making ejabberd able to serve the code of the chat system through the HTTP protocol.

For this reason, we have developed a new ejabberd module called mod_http_fileserver whose purpose is to serve content throught HTTP. This module use our new development API for HTTP plugins.

The result is a full-featured, highly maintenable, easy to deploy high-performance AJAX chat system.

Quick benchmarks

A simple benchmark shows that this basic HTTP file server does scale very, very well. You can easily serve thousands of simultaneous users on a laptop. As a comparison, a Tomcat container can usually only serve between 50 to 500 simultaneously connected users.

In a simple test using Apache Benchmark (ab), the ejabberd mod_http_fileserver module was able to serve 4000 requests per seconds, on a small 100 bytes file. The test machine was a simple MacBook Pro Intel laptop. We also tried a simple Tsung HTTP benchmark. On the same hardware, we reach 6000 simultaneous users, serving a maximum of 1500 requests per second in our scenario. As you can see, all those new developments are really high-performance.

A High-Performance AJAX Chat System

What we describe here is of course the approach we are using to deploy OneTeam, our rich web client, on customers' sites.

Now, if you want to build a large scale and high-performance AJAX chat system, you know that ejabberd is probably your best choice. This new development does provide you another reason to try ejabberd if you have not yet been selected it as your platform of choice.

Technical references

 



Categories: Jabber / XMPP  ejabberd  
Share article:   Tweet this   Make delicious   Stumble upon  

Comments

anonymous avatar

Perhaps this is a silly question, but how to scale up past one box?  Would you have to use a load balancer?

Posted by Matthew Wilson on 12 Mar 2007 at 18:08



 
Mickaël Rémond's avatar

Yes, of course a load-balancing mechanism is needed. It can be either a hardware of software loadbalancer. A DNS load balancer can be used in some cases.

Posted by Mickaël Rémond on 12 Mar 2007 at 18:20



 
anonymous avatar

well connecting ejabberd and solutions like Cisco SLB (see http://www.planeta.toliman.pl/?p=12) you can build rock-solid xmpp environments (including replication of sessions between two catalyst switches based on hsrp protocol), even geographically dislocated.

Posted by Zbigniew Żółkiewski on 13 Mar 2007 at 10:37



 
anonymous avatar

Nobody seems willing to say how far they think this can go.
Obviously you are tackling vertical scaling, what about scaling sideways? how would you tackle handling webscale deployments ( multi million )?

http://www.amorvine.com/

Posted by Howard Bell on 17 Jul 2007 at 21:03



 
Mickaël Rémond's avatar

Howard,

We are willing to say that if you get in touch with us and you will know that we have very impressive references already.
This really depends on your project. For example, if you do not put the webscale in one domain requirements, you can use s2s (even though, ejabberd is probably one of the most scalable one domain cluster only server, if not the most scalable).

Posted by Mickaël Rémond on 17 Jul 2007 at 22:49



 


Add comment

Name:

Email:

URL:

Smileys

Remember my personal information

Notify me of follow-up comments?