Home > Ajax, Development, Software > Ajax and Server Load

Ajax and Server Load

April 20th, 2006

At OTUG on Tuesday, we got the “but does it scale” question regarding Ajax; a topic that has actually come up at work in regards to the Google Suggest functionality (incidentally, Joel’s article about Google Suggest first triggered my interest in the XHR object). Now, I’ve talked about this a bit in the past and we basically said - of course it scales…if you do it right. Obviously, Ajax can get “chatty” and I really do have some concerns about dozens of fine grained calls - to this end, I brought up the initial forays into EJB land that resulted in good old Data Transfer Objects. All in all, I’m of the opinion that Ajax should increase performance by lazily fetching data and, when properly architected, scale horizontally quite well. Interestingly enough, it turns out that this very question is making its way around the blogosphere…

Today, Tim Bray posted The Cost of AJAX where he refers to a post from James Governor essentially asking for thoughts about WebSphere guru Billy Newport’s recent writings. Billy got things started with the innocently titled: AJAX and its impact on servers. Now, I’ve tracked Billy’s blog on and off (I worked on WebSphere based apps for many years) but I’m not really sure what he’s basing this quote on:

I think it’s becoming clear now that AJAX enabled applications generate a higher load on an application server than a non AJAX application.

Really? Considering that Basecamp ran on one server for its first year, I’m curious what causes him to make a statement like that. I’m not saying there isn’t some truth to it, but I haven’t been hearing any screaming about this issue; I’m not sure, but I suspect Gmail gets a few hits a day and it seems to be doing OK… Of course maybe he’s just trying to sell more IBM gear ;)

Distributed caching is a critical piece of the toolkit to help with this. Technologies like ObjectGrid allow an application server to pull data from a remote ObjectGrid cluster in under a ms.

In the followup The hidden costs of lazy fetch with AJAX, Billy once again plugs ObjectGrid but he also challenges us to consider patterns for client/server interaction (might I suggest Michael Mahemoff’s AjaxPatterns site). Billy mentions that every database call has a fixed cost so executing more than is necessary can have a negative impact on your application. But he rightly states this is nothing new - frankly, just like the security issues that occasionally crop up in the Ajax space. Hey, this isn’t rocket surgery, the same rules still apply. Now that we can finally give our users a truly rich interface while still retaining the benefits of a server based app doesn’t mean we can forget all the lessons we’ve learned the last decade.

So back to Tim who wanders in and points out that most web pages are already making multiple calls! I especially like this quote:

So saying “AJAX is expensive” (or that it’s cheap) is like saying “A mountain bike is slower than a battle tank” (or that it’s faster). The truth depends on what you’re doing with it.

That said, I am interested in what Ajax means for load testing. If we say our application needs to support 100 concurrent users, what happens when said users are making 20 calls each instead of say, 5? Ajax isn’t a cure for cancer and adding it to your application won’t instantly make you the target of a takeover bid from Google. But, used properly, it can significantly improve your user experience. There’s a chance you might have to add more hardware, but frankly that’s a nice problem to have.

You know, what I really love about Dilbert is how Scott Adams seems to be writing about things that are happening in my workplace when they happen…what I love about the blogosphere is how questions that come up in the course of my day are debated by the likes of Tim and Billy! For whatever reason, this thread doesn’t seem to have been picked up by the “major” Ajax sites but this is important stuff. I echo calls from the comments to back up the claims with data - but I’ll leave you with this thought from Josh Peters:

In the end though, it’s really nothing new: unless you understand a technology you cannot expect to weild it well.

Well said.

Ajax, Development, Software

  1. April 21st, 2006 at 13:33 | #1

    As people move past the bells and whistles of adding AJAX to typical forms-and-reports webapps to document centric webapps (word processors, gui design tools), both the size and frequency of requests from the client and the complexity and size of the user session (and machinery for async processing) is going to grow.

    Face it, people are not going to be content writing slightly better versions of the same old CRUD apps. Maybe it’s time to relearn the lessons of client/server.

  2. April 25th, 2006 at 20:23 | #2

    Dietrich,

    I agree that expectations are certainly rising and Ajax lets us move a lot closer to the thick client server apps that preceded the web explosion. Still, I can’t help but think the next step is closer to a XUL like approach. Anyway, I’m just glad to see a resurgence in the web client space. Thanks for the comment!

  1. No trackbacks yet.