Search code examples
testingjmeter

JMeter use in sanity testing in production servers


I'm using JMeter on development environment and I think of executing sanity tests on production servers.

Sanity of web sites login and other actions.

Is it reasonable to use JMeter on production servers? How to limit JMeter so it won't impact real users? I found only tutorial which doesn't advice it.

Do not run these tests against your production servers unless you know they can handle the load, or you may negatively impact your server's performance.


Solution

  • From JMeter's point of view it doesn't really matter where you run your tests. Running load tests against production environment is very useful as this way you can discover "real" limitations, bottlenecks, integration and interoperabitity problems opposite to load testing in scaled down environments where you can only guess or calculate the anticipated production metrics.

    Ideally you should have some form of "staging environment" which is an exact replica of production environment in terms of hardware, software and data.

    If you cannot afford having "staging" environment to play with you can run your tests on production, however you need to keep in mind several important constraints to avoid "surprises"

    1. Run your tests in "dead" time when your application real life usage is minimal, i.e. over night or during weekends.
    2. Make sure JMeter test leaves the system at the same state as it was before test, i.e. if you create users, content, data, etc. - make sure you clean it up after the test so your system is not filled with "junk" data used for load testing. So consider using setUp Thread Group for setting up all the necessary test data and tearDown Thread Group to clean up after yourself
    3. Make sure you monitor your servers health so you will be notified when (if) your system is overloaded. You can use JMeter PerfMon Plugin for this.
    4. It would be also good to have AutoStop Listener enabled so JMeter test would stop automatically
    5. Consider adding SMTP Sampler to your test plan so you would be informed in case of unexpected errors.