> ## Content Index
> Fetch the complete content index at: https://www.process-one.net/llms.txt
> Use this file to discover other available public pages before exploring further.

# Angie: Building Large Scale AJAX Chat System
- URL: https://www.process-one.net/blog/angie-building-large-scale-ajax-chat-system/
- Published: 2007-03-11T23:00:00.000Z
- Updated: 2024-09-24T14:55:47.000Z
- Author: Mickaël Rémond

Ejabberd “Angie” is our internal codename for the next version of the High-Performance Instant Messaging server (See our [previous post presenting Angie](https://www.process-one.net/blog/angie%5Fmillions%5Fusers%5Finstant%5Fmessaging/)).  
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](https://ejabberd.jabber.ru/jwchat?ref=process-one.net)).

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](https://www.process-one.net/en/wiki/ejabberd%5FHTTP%5Frequest%5Fhandlers/).

**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](https://www.process-one.net/en/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](https://www.process-one.net/en/ejabberd/) if you have not yet been selected it as your platform of choice.

## Technical references

- [Tutorial on the new HTTP plugin API](https://www.process-one.net/en/wiki/ejabberd%5FHTTP%5Frequest%5Fhandlers/)
- [mod\_http\_fileserver on ProcessOne Development Forum](https://www.process-one.net/en/forum/viewthread/27/)
- [mod\_http\_fileserver ChangeLog](https://forge.process-one.net/changelog/ejabberd-modules/mod%5Fhttp%5Ffileserver?ref=process-one.net)