Monday, July 6, 2009

The Grinder, a Java Load Testing Framework

The Grinder, a Java Load Testing Framework

What is The Grinder?

The Grinder is a JavaTM load testing framework that makes it easy to run a distributed test using many load injector machines. It is freely available under a BSD-style open-source license.

The latest news, downloads, and mailing list archives can be found on

Key features

  • Generic Approach Load test anything that has a Java API. This includes common cases such as HTTP web servers, SOAP and REST web services, and application servers (CORBA, RMI, JMS, EJBs), as well as custom protocols.
  • Flexible Scripting Tests are written in the powerful Jython scripting language.
  • Distributed Framework A graphical console allows multiple load injectors to be monitored and controlled, and provides centralised script editing and distribution.
  • Mature HTTP Support Automatic management of client connections and cookies. SSL. Proxy aware. Connection throttling. Sophisticated record and replay of the interaction between a browser and a web site.

See the longer features list for further details.


The Grinder was originally developed for the book Professional Java 2 Enterprise Edition with BEA WebLogic Serverby Paco Gómez and Peter Zadrozny. Philip Aston took ownership of the code, reworked it to create The Grinder 2, and shortly after began work on The Grinder 3. The Grinder 3 provides many new features, the most significant of which is Jython scripting. Philip continues to enhance and maintain The Grinder.

In 2003, Peter, Philip and Ted Osborne published the book J2EE Performance Testing which makes extensive use of The Grinder 2.

Capabilities of The Grinder

Load TestingLoad Testing determines if an application can support a specified load (for example, 500 concurrent users) with specified response times. Load Testing is used to create benchmarks.
Capacity TestingCapacity Testing determines the maximum load that an application can sustain before system failure.
Functional TestingFunctional Testing proves the correct behaviour of an application.
Stress TestingStress Testing is load testing over an extended period of time. Stress Testing determines if an application can meet specified goals for stability and reliability, under a specified load, for a specified time period.

Open Source

BSD style licenseThe Grinder is distributed under a BSD style license.
DependenciesThe Grinder depends on a number of other open source products including


100% Pure JavaThe Grinder works on any hardware platform and any operating system that supports J2SE 1.4 and above.
Web BrowsersThe Grinder can simulate web browsers and other devices that use HTTP, and HTTPS.
Web ServicesThe Grinder can be used to test Web Service interfaces using protocols such as SOAP and XML-RPC.
DatabaseThe Grinder can be used to test databases using JDBC.
MiddlewareThe Grinder can be used to test RPC and MOM based systems using protocols such as IIOP, RMI/IIOP, RMI/JRMP, and JMS.
Other Internet protocolsThe Grinder can be used to test systems that utilise other protocols such as POP3, SMTP, FTP, and LDAP.

The Grinder Architecture

GoalMinimize system resource requirements while maximizing the number of test contexts ("virtual users").
Multi-threaded, multi-processEach test context runs in its own thread. The threads can be split over many processes depending on the requirements of the test and the capabilities of the load injection machine.
DistributedThe Grinder makes it easy to coordinate and monitor the activity of processes across a network of many load injection machines from a central console.
ScalableThe Grinder typically can support several hundred HTTP test contexts per load injection machine. (The number varies depending on the type of test client). More load injection machines can be added to generate bigger loads.


Graphical Interface100% Java Swing user interface.
Process coordinationWorker processes can be started, stopped and reset from one central console.
Process monitoringDynamic display of current worker processes and threads.
Internationalised and LocalisedEnglish, French, Spanish, and German translations are supplied. Users can add their own translations.
Script editingCentral editing and management of test scripts.

Statistics, Reports, Charts

Test monitoringPre-defined charts for response time, test throughput. Display the number of invocations, test result (pass/fail), average, minimum and maximum values for response time and tests per second for each test.
Data collationCollates data from worker processes. Data can be saved for import into a spreadsheet or other analysis tool.
Instrument anythingThe Grinder records statistics about the number of times each test has been called and the response times achieved. Any part of the test script can be marked as a test.
Statistics engineScripts can declare their own statistics and report against them. The values will appear in the console and the data logs. Composite statistics can be specified as expressions involving other statistics.


Record real usersScripts can be created by recording actions of a real user using the TCP Proxy. The script can then be customised by hand.
Powerful scripting in PythonSimple to use but powerful, fully object-oriented scripting.
Multiple scenariosArbitrary looping and branching allows the simulation of multiple scenarios. Simple scenarios can be composed into more complex scenarios. For example, you might allocate 10% of test contexts to a login scenario, 70% to searching, 10% to browsing, and 10% to buying; or you might have different workloads for specific times of a day.
Access to any Java APIJython allows any Java-based API to be used directly from the test script.
Parameterization of input dataInput data (e.g. URL parameters, form fields) can be dynamically generated. The source of the data can be anything including flat files, random generation, a database, or previously captured output.
Content VerificationScripts have full access to test results. In the future, The Grinder will include support for enhanced parsing of common results such as HTML pages.

The Grinder Plug-ins

HTTPThe Grinder has special support for HTTP that automatically handles cookie and connection management for test contexts.
CustomUsers can write their own plug-ins to a documented interface; although this is rarely necessary due to the powerful scripting facilities.

HTTP Plug-in

HTTP 1.0, HTTP 1.1Support for both HTTP 1.0 and HTTP 1.1 is provided.
HTTPSThe Grinder supports HTTP over SSL.
CookiesFull support for Cookies is provided.
Multi-part formsThe Grinder supports multi-part forms.
Connection throttlingLow bandwidth client connections can be simulated.

TCP Proxy

TCP proxyA TCP proxy utility is supplied that can be used to intercept system interaction at the protocol level. It is useful for recording scripts and as a debugging tool.
HTTP ProxyThe TCP proxy can be configured as an HTTP/HTTPS proxy for easy integration with web browsers.
SSL SupportThe TCP proxy can simulate SSL sessions.
Filter-based architectureThe TCP proxy has a pluggable filter architecture. Users can write their own filters.



Anonymous said...

The Grinder is the best tool for performance testing. I've working on GrinderStone - IDE for Grinder scripts which allows debug scripts using Eclipse and provides some interesting features for development like modularity and pretty useful logging in debug mode. That project you can download from official project site:

we also have Eclipse Update site for simple plugin installation into Eclipse platform. All details you can obtain on our site and support group. Look thru GrinderStone and you'll like it, it gives you more power to develope Grinder scripts.

Unknown said...

The Article on a Java Load Testing Framework, gives detailed information about it. Thanks for Sharing the information about Load Testing in Software Testing. For More information check the detail on the load testing here Software Testing Company

Chad said...

Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Visit here for Penetration testing services and Software testing services