---
title: A JMeter test plan for Drupal
description: Learn how to execute a comprehensive JMeter test plan for Drupal, including anonymous browsing, authenticated browsing, editing, search, and login tasks, with downloadable resources.
---

[Blog ](https://www.metaltoad.com/blog)

# [A JMeter test plan for Drupal](https://www.metaltoad.com/blog/jmeter-test-plan-drupal)

 Written by [Metal Toad Staff](https://www.metaltoad.com/blog/author/metal-toad-staff) | Aug 25, 2010 12:00:00 AM

Last week, I wrote about [graphing JMeter results](https://www.metaltoad.com/blog/plotting-your-load-test-jmeter) with *Matplotlib*. Let's take a closer look at the actual Drupal test plan.

This plan was adapted from [Jacob Singh's test](http://github.com/jacobSingh/Drupal-Performance-Testing-Suite) and has five different thread groups:

- Anonymous browsing
- Authenticated browsing
- Editing a node
- Search
- Login and view user page

Since some of these samplers need a variety of URLs to test, we have two input files:

`urls:`

Not surprisingly, this contains a list of URLs for the browsing threads. A simple list can be generated with the following query:

```
SELECT CONCAT('/node/', nid) FROM node WHERE STATUS = 1
  ORDER BY changed LIMIT 1000;
```

For an active site, an alternative might be to extract this list from your site's access logs; such a list would closely match actual traffic patterns.

`wordlist:`

The wordlist contains a list of queries for the search thread. Querying the search_index table provides a basic list:

```
SELECT word FROM search_index ORDER BY RAND() LIMIT 1000;
```

This list will only contain one-word queries, so again you may want to tailor the wordlist to your site.

### Running the test

To generate multiple samples with different parameters, it's best to run JMeter from a script. In this way configuration options can be parameterized (using the `__P()` function) and passed to JMeter with the `-J` option. The [plotting script](https://www.metaltoad.com/blog/plotting-your-load-test-jmeter) in particular expects multiple test runs with a variable number of threads. For this test, the thread_count variable is applied only to anonymous browsing, as it was testing a site that serves primarily anonymous visitors. This balance can be adjusted by editing the thread groups in JMeter.

```
#!/bin/bash
 
# The host under test.
HOST=localhost
 
# A Drupal username.
USER=user
 
# USER's password
PASS='12345'
 
# A node id to edit.
EDIT_ID=42
 
# Ramp up by factors of sqrt(2).
for thread_count in 2 3 4 6 8 11 16 23 32 45 64 91 128 181 256 362 512
do
  jmeter.sh -n -t DrupalStress.jmx -Jhost=$HOST -Juser=$USER\
  -Jpassword=$PASS -Jthreads=$thread_count -Jedit_id=$EDIT_ID
done
```

Each thread group uses a Runtime Controller set to 30 seconds, so this script will take about 10 minutes total. When it's finished, the CSV output will be in `/tmp/Drupal6`.

[View full post](https://www.metaltoad.com/blog/jmeter-test-plan-drupal)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Metal Toad Staff"
  },
  "dateModified" : "2025-04-23T15:16:11.828Z",
  "datePublished" : "2010-08-25T00:00:00Z",
  "headline" : "A JMeter test plan for Drupal",
  "image" : {
    "@type" : "ImageObject",
    "height" : 500,
    "url" : "https://6104926.fs1.hubspotusercontent-na1.net/hubfs/6104926/Imported_Blog_Media/Metal_Toad_blog_generic-Aug-11-2023-10-27-14-4577-PM.jpg",
    "width" : 870
  },
  "mainEntityOfPage" : "https://www.metaltoad.com/blog/jmeter-test-plan-drupal",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60.0,
      "url" : "https://6104926.fs1.hubspotusercontent-na1.net/hubfs/6104926/social-suggested-images/6104926.fs1.hubspotusercontent-na1.nethub6104926hubfsMetal_Toad_Logo_orange_horizontal-50-1.jpg",
      "width" : 240.00002
    },
    "name" : "Blog"
  }
}
```