|
Web Application Load Simulator
Introduction
LoadSim is a web application load simulator. It allows you to create simulations and have those simulations run against your webserver.
While I have used and followed quite closely several open source projects this is my first attempt at actually managing one. Please bear with me as I learn both the ins and outs of managing such a project as well as how to best manage one using the SourceForge website.
Motivation
LoadSim began life after I spent a frustrating several weeks trying to load test a consulting client's web site. The web-based application was fairly complex and to get as accurate information as possible I wanted to be able to faithfully recreate the usage patterns of real users. Nothing I could find in the free software world seemed to fit the bill and commercial products were prohibitively expensive and in many cases offered many features that we didn't need.
My search did uncover JMeter, which I used for some basic load testing. JMeter will let you pound a way at a website with some number of virtual users. It's shortcoming, at least for the application being tested, was that every virtual user would submit the same exact links with the same exact form and querystring data. Because the functionality of JMeter was close to what I needed I started reading through the JMeter source code and found the core simulation engine to be a good starting point for what would become LoadSim. I took the JMeter engine, as well as JMeter's cookie manager, modified them, and added some Tcl extensions so that I could script highly dynamic simulations. To help analyze the results I added some basic statistics routines. Finally, I added some rough support for generating HTML pages that could summarize the results.
Anway, when I looked up I thought I had a pretty useful tool and decided to release it under an open source license.
Between the first version and the one I am working on now a good deal has changed. Most importantly, the way simulations are specified has undergone substantial change. Instead of using Tcl to specify the simulation you now do it by creating an XML file. I made this change because I found the Tcl approach to be a bit cumbersome and wouldn't support a GUI frontend very well, which is something I would like to add in future.
Features
LoadSim is currently in a pre-alpha state. What that means to me is that most of the functionality is present, but not much testing has taken place. Most of the following features are already implemented but some, most notably the statistics and publishing, are in a fairly rough state and are not very usable. By the full release, however, the following feature set will be supported:
- Records your browser session to create the simulation scenarios.
- SSL through JavaSofts JSSE 1.0.2 SSL implementation (or just by using JDK 1.4). Because of the increased computation on the client using this reduces the number of virtual users you can simulation on each testing machine.
- 100% Pure Java. All you need is JDK 1.2.2 (it has been tested using JDK1.4) or greater and the jar file. See JDK compatibilities page for more details on which versions of the JDK work with LoadSim. If people have successfully used LoadSim with other JDK's/OSes please let me know.
- Supports cookies.
- Supports HTTP redirects.
- Contents of downloaded pages accessible using the HttpUnit WebResponse class.
- Web applications can result in a lot of data moving between a user's browser and a webserver. To support the complexities of passing this data between the 2 systems the following methods are available for specifying querystring and form data:
- Predefined datasets. This method is most appropriate for form data, where you want to simulate different virtual users typing data into forms.
- Constant data. This is just data that never changes for a link during the course of a simulation run.
- CustomUsing the HttpUnit WebResponse object and the LoadSim content handler interface a developer can parse the page and extract any information and then set querystring/form data dynamically during the execution of the load/functional test.
These methods allow you to very accurately recreate usage patterns of real users, without having to modify your web application to support testing.
It should be noted that when the custom approach you will be able to simulate fewer virtual users per machine. The reason for this is that the downloaded pages must be parsed and the anchor and form elements must be extracted so that the data can be retrieved. This takes up CPU time, whereas both constant and dataset link data require no such parsing.
- Remote management of simulations. Remote simulations can be created and managed from a single management console. The console is a Tcl shell with some extra commands added to create, start, stop, etc. simulations.
- XML format for simulation specification.
- The following raw data is currently gathered: time-to-first-byte (TTFB), time-to-last-byte (TTLB), size of the file downloaded, content type, and HTTP response code.
- Various stats (average, min, max, and standard deviation of each link) can be calculated based on the raw data.
- Results can be published as HTML pages. An XML based configuration is used to customize the pages.
- Random delays can be added between links to simulate real users.
Requirements
See the JDK Compatibilities Page for details on which JDKs are supported.
If you want to test your site under SSL then you will also need Sun's secure sockets library (or just use Sun's JDK 1.4), JSSE 1.0.2.
Documentation
LoadSim User Guide
JavaDoc
Acknowledgements
LoadSim would not exist without a lot of help from other open source projects. Here is a list of projects I would like to thank for making some really great software freely available.
Download
The current release of LoadSim is 0.9.8.
To try it download the tarball.
Java Web Start Deployment
Java Web Start is technology provided by Sun to manage the deployment of new Java based applications as well as managing the updates of those applications. If you are a big Java user I highly recommend you download this excellent product and promote it's use wherever and whenever you can.
Once you have Java Web Start installed you can launch LoadSim with it. This will launch LoadSim in --record mode so that you can easily create a LoadSim sequence file, bypassing the instructions in the LoadSim Users Guide. To use LoadSim in this way on Linux you must have JDK 1.4 installed (JDK 1.3 is okay for Windows).
Because LoadSim acts as a proxy server it must open up connections to hosts other than the one from which it was installed. For that reason it must be run as a full blown application with the no security restrictions such as apply to applets. For this reason the LoadSim Jar files must be signed, which they are but with a dummy certificate that I created. So, when you first launch the application you will get a warning telling you that it is not properly signed. Although there is nothing sinister with the application (no adware, for instance) it is up to you whether you want to ignore this warning or proceed with the install. If you have any concerns about the application you can always look at the source code yourself.
Source Code
Anonymous CVS Access
This project's SourceForge CVS repository can be checked out through anonymous
(pserver) CVS with the following instruction set. The module you wish
to check out must be specified as the modulename. When prompted
for a password for anonymous, simply press the Enter key.
cvs -d:pserver:anonymous@cvs.loadsim.sourceforge.net:/cvsroot/loadsim login
cvs -z3 -d:pserver:anonymous@cvs.loadsim.sourceforge.net:/cvsroot/loadsim co modulename
Mailing Lists
Subscribe to the mailing lists.
|
|