Stress Testing Tool

Component ID

2173489

Component name

Stress Testing Tool

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Stress Test Tool

Description
===========

A suite of tools that allows a Drupal site to be stress tested by clearing caches and publishing/unpublishing of nodes. It is most suitable in conjunction with a load testing tool such as jmeter to test access to the site while nodes are periodically cache busted or un/republished.

Notes:

- Requires drush.
- The site is being stress-tested, and publish status may be altered. It is imperative to back up the drupal database before running tests.

For the command stress-publish, nodes are automatically reset at the end of the stress test. However, it is advisable to run export-publish-status in case the command does not complete. In that case import-publish-status can be used to reload the original node statuses.

Safe steps when running stress-publish:

1) backup database
2) export node statuses
3) run the stress test
4) import node statuses
5) check site, and potentially reload from db backup if there are any issues.

Drush Commands:

drush export-publish-status
drush import-publish-status

drush stress-cache
drush stress-publish

examples:

drush export-publish-status blog_post myNodeStatusBackup.txt
export the status of all blog_post nodes and save to file public://myNodeStatusBackup.txt

drush import-publish-status myNodeStatusBackup.txt
imports the status of all nodes in the file public://myNodeStatusBackup.txt

drush stress-cache blog_post 10 200
bust the cache for all nodes of type blog_post for 10 seconds, with 200ms interval

drush stress-publish 20,200-300 10 200
publish/unpublish nodes 20 as well as 200 through 300 for 10 seconds, with 200ms interval

Upcoming improvements:

- better timespan parsing so that e.g. 10m 10s can be used.

Thanks to https://github.com/edvillan15/node-tools for command line node parsing function.