GSoC - Loadtest module


As some of you know, I did Google's Summer of Code this summer. The result of that ended up being the loadtest module. This entry is basically just a description of how to use the module... so if you're not interested, please move along :-P.

The first part of this module lets you define and configure "states" for your site that you can run tests against.

You can use these states in two different ways:

  1. When running a loadtest, using the loadtest module, you can choose the state you wish to test.
  2. If you want to run more comprehensive tests using an external application such as ab, you can switch between states remotely allowing you to more easily script your benchmark tests.

The following screenshot is of the main testing interface. Each part of this form is described below.

  • The label is used for you to identify your test run at a later date. Each label will automatically have the timestamp for the test run appended to it.
  • A test suite is the "type" of test to run. By default there are two: "Single run", which just runs the selected tests once and "Test individual modules" which autotmatically disables all of the modules and then enables each module one at a time running tests at each step. Test suites can be added by module programmers as well so they can build tests that are more suited to their specific modules.
  • You can select a state from any of your pre-configured states. Leaving this empty will simply use the sites current settings.
  • There are currently two default tests that are included with the module:
    1. RequestRandomNodes - which does just that, page requests on random nodes. This is mostly just for testing, not overly useful for running load tests as you would probably want to compare test runs against identical page requests.
    2. RequestPages - This test requests a set of select pages a certain number of times. By default the pages "frontpage" and "tracker" are requested 10 times.

Unlike simpletest tests, loadtest tests can have individual configuration options that can be set through Drupal. The RequestPages test lets a user define which pages they want to request and how many times each page should be requested.

Depending on the options you choose running a test could take several minutes. Since site settings may be modified on the fly during a test run, it is important that you don't use this module on a production site, and don't interrupt it while it's running.

Finally, once the test has been run, you can view your statistics and compare multiple tests.

The code can be downloaded from the tarball on the module page, but I'd recommend taking it directly from CVS:

cvs -z6 checkout -d loadtest contributions/modules/loadtest

Google Summer of Code

no comments

As some of you already know, I'll be doing the Google Summer of Code this summer. For those of you who just asked "WTF is Google Summer of Code?", it's basically (to sum up in one sentence) Google sponsored and organized open source development. Basically, Google is paying me (and ~900 other students) to work on an open source project. If you're still curious, you can visit here or here, for more info. The basic premise is to raise awareness for open source and get more people (specifically students) involved in open source development.

GSoC officially begins on Monday and I'll be working on the Drupal project, my project proposal consists of developing a framework for allowing Drupal admins to load test their sites and more easily determine bottlenecks and such. I have a more detailed description on the Drupal SoC group, if you want to learn more. I figured it made good sense to do a Drupal project... considering about 90% of my contract work at the moment is Drupal related. What's Drupal? I think you already asked that question, Carla. It's a content management system (CMS). What's a CMS? Yeah, I don't know, really. But basically Drupal helps you build ultra sweet community based websites in like no time at all, and that's all that really matters.

Anyway, I'll probably be posting other random tech stuff here about my project... so fell free to ignore my posts tagged with Drupal and GSoC if you don't wanna hear about benchmarking, bottlenecks, scalability, load balancing, unit testing, or other such terms, my feelings will only be mildly hurt.