Take me HOME
Comet Explosion
Tuesday, January 10, 2012 04:22 PM

Okay, I've now done some very rough, preliminary testing on my ideas about COMET.  And the results are impressive.

First, let's look at my current test environment.

I've got a VM (Virtual Machine) running Apache + PHP.  It's Debian Linux 6.0.3, with Apache 2.2.20 and PHP 5.3.3.  It has ~512M RAM and a single 2.4Ghz processor.  Nothing fancy.

The host machine (what the VM is running on) is a Lenovo laptop.  It's Ubuntu Linux 11.10, with PostgreSQL 9.  It has ~3G RAM and a dual-core 2.4Ghz processor.  Nothing fancy there, either.

To make things interesting, the VM's web application connects to the host's database.  Not a great solution, but it was spawned from a problem with PHP/Apache faulting on the host machine.  I didn't have time to deal with it, so I created the VM and ran the test site from there. If anything, this (combined with the fact that there's a VM in the mix) would hinder response times.

The application, currently only in testing, is pretty simple.  Upon startup, it performs an Ajax "key validation" request: this is an idea right now, but basically ensures that the current user (which must be logged-in) only has one instance of the application open.  It then immediately sends a "long poll" request to the server, which returns after ~60 seconds or when new data is retrieved.

The data in question is simply some navigation logs.  Whenever someone views the website (a copy of CrazedSanity.com), new logs occur; the application would return those new logs and then immediately poll for new ones.

I'm actually extremely impressed with the results, especially given the complex (or maybe convoluted) environment.  I loaded 4 pages at once (in Firefox, I opened four pages, the right-clicked and selected "reload all tabs"), and both sides were extraordinarily fast.  Most of the delay seemed to be in the browser itself.  The long-polling request returned immediately after I selected to reload the tabs, and immediately sent another request.

So, the next steps are to put it on the test webserver, which lives on the same server as the one you're looking at.  That will give more difinitive, real-world results on how fast it is.  Stay tuned!