views:

800

answers:

8

I need to do some performance/load testing on this website - Information Queensland Atlas

In the past I have used Jmeter and WAPT 5 with reasonable success however in those cases the websites being testing did not make use of AJAX. For the website above I need to simulate a number of users and determine the capacity of the current server infrastructure so that the maximum response time is less than 10 seconds.

The response time needs to be measured when the final image tile is displayed on the browser.

From doing some investigation on the internet, software that controls a real web browser is the best way to load test an AJAX application. I am trialling iMacros Browser at the moment but I will welcome any other suggestions.

So for the question, what is the best software to load/performance test an AJAX web application?

Edit

I have just tried recording a test with Selenium. The test scenario requires the user to bring up the initial map, select the zoom in tool, zoom into an area on the map and then press the full extent button. At the moment Selenium is recording the button press but not the area to be zoomed.

+2  A: 

Selenium can do this. There's an article on it here: Testing Ajax Applications with Selenium

RichieHindle
+1  A: 

Performance testing AJAX applications can only be done by 2 things as far as I know.

  • A service called BrowserMob who use Selenium run on Amazon EC2. You create your selenium script and then submit it to them and then they will run it when you have scheduled it.

  • If you want to run it internally and want to set it yourself you can use PushToTest TestMaker to run your tests. They can also come set it up for your if you want to use it more as a service than a tool

Both of them are really good ways to load test your AJAX applications.

EDIT Sorry, just saw your edit. If you want some tips for Selenium my site has some tutorials

AutomatedTester
A: 

The VS2008 AJAX Profiling Extensions enable you to do this. Check the requirements in the Quick Start section though as you have to have specific versions of certain things (ie. VS2008 Team System, .Net 3.5, IIS7).

adrianbanks
+1  A: 

If Selenium's recorder is unable to record your test completely, I'd suggest adding the missing bits manually.

Marius Gedminas
A: 

I have a GWT-based Ajax web site, penwag.com. I don't have a large user community at this point, but it's a testbed for me, and I want to see how high it can scale. I use Selenium for all of the acceptance tests, but now I'm researching my options for load testing. For these types of tests, I want the browser out of the picture, for a couple reasons. First, including the browser in the process will add enough overhead on the client side that I'd need a sizable cluster to generate any load at all. Secondly, it's pointless to include the client side in scalability tests, since it's the back-end that will be the bottleneck. For performance tests, I might want to include the client side, but I'm just not worried about that for my app.

So, I've been mulling a few different options. First, since I have ATs in Selenium, perhaps Selenium Grid is the tool of choice. But, the browser is still in the picture, and I want it out of there.

Right now, I'm really leaning toward The Grinder. Don't worry, it's not a safety issue, it's a testing framework. No browser involvement, looks like I can record scripts representing different types of users, and it seems to do a fine job generating load.

WebRat is another possibility. I haven't researched it much, but it's a possibility.

I've used JMeter before. It uses a separate thread to simulate each user. Why would I want a scalability testing tool that has scalability issues? So, not JMeter, thanks.

Don Branson
A: 

It takes some effort, but I've been able to use JMeter to load-test web-apps including Ajax requests as part of the script. You can find details here:

http://ptrthomas.wordpress.com/2009/01/14/seam-jsf-vs-wicket-performance-comparison/

The scripts are available in the google-code project SVN(1), so you could open and look at them in JMeter for ideas.

I mainly rely on a couple of things: a) use HttpFox(2) to figure out the structure of the requests. And then b) use the JMeter regular expression support(3) to ensure that the requests are "repeatable" even when things are highly dynamic.

1) perfbench.googlecode.com/svn/trunk/perfbench/wicket-jpa/src/test/jmeter/

2) addons.mozilla.org/en-US/firefox/addon/6647

3) cwiki.apache.org/WICKET/wicket-and-jmeter-with-regular-expressions.html

Peter Thomas
A: 

We do this with a custom client application and ignore the browser altogether.

When I say "ignore", it's easy enough to measure how long it takes for a browser to render a given page. We have a client-side Stopwatch class that uses (new Date()).valueOf() values to collect timing information around AJAX requests that begin with the intiation of the (asynchronous) AJAX request and are stopped when the request has been serviced and the results processed.

As any given browser will only ever be issuing one (or maybe two) requests at a time the load test of the browser isn't really relevant. Once you have the time the browser is going to consume you know how much of your 10 seconds you can allocate for network transmission and server processing time.

For network transmission time we work out how much data we're serving and how long that will take to download over a 128k connection. That's our assumption, feel free to use your own.

That then gives us an idea of how long the server can take to process each request.

To test the server we have a custom C# load generation application. This load generation tool is pretty trivial to write, you can do it in a couple of days. You configure it up with a thead pool to generate "x" users, create a set of test scenarios (ie: the sequence of AJAX requests a typical user will make, using these parameter sets to call the AJAX services on yuor server) and let it go, measuring the response time for each request and reporting the results (ie: min time, max time, average, median, etc.). You can run this load generation application on as many workstations as you have access to.

If you wanted to get sophisticated you could allow the load generator to use the performance measurements to scale back the number of users it is emulating until it is reliably under your target response times.

And then you will know exactly (well, you'll have a pretty good idea) how many users a given server can support!

It is also worth keeping track of the server statistics at the same time as you are running these load tests as you'll start seeing which server resources are being consumed first and give you an indication of what you need to tune in order to get your processing time down. eg: More memory, more worker processes, more CPUs, database locking contention, a database index, etc.

Phil
A: 

Use something like WATin

WATin allows you to script a real browser to perform the same actions over and over again.

FlySwat