Apache JMeter is an open source, 100% Java software designed to load test functional behavior and measure performance. Today JMeter can be used to script tests for web apps and APIs alike. It has a variety of different functionalities, but JMeter does take some trial and error to master successful load tests.
LoadNinja is a SaaS tool for load testing web applications. You can record and replay a load test scenario without any coding, and the recording is done in the LoadNinja platform itself (see: Instaplay Technology or 'browser-in-browser' feature page). It records and runs every test in a real browser as opposed to an emulated browser, for the most accurate test results.
Analyzing End User Experience and Infrastructure Performance Using LoadNinja and JMeter
JMeter and LoadNinja are both great for load testing web applications, and when used simultaneously, can illuminate some helpful insights into infrastructure and end user experience that yout test teams can leverage to optimize performance. To get started using both of these tools it's important to map out your scenario & answer these questions first:
- What are you trying to test? (i.e. web app)
- What are the user journeys or interactions you're trying to test?
- How many virtual users (or load, or traffic) are you planning on driving to your web app?
- What is a standard expected performance benchmark to compare against?
Get End User Experience Metrics with LoadNinja
Getting up and running in LoadNinja is super simple. Create a trial account or log in to your account. Then click record in the navigation, and have the URL of the web app or website you're looking to test handy. Then walk through your test scenario as a real user would interact with your web app or website, and replay your test. Save it, and configure your test run, and you're good to start testing.
Once you've started your tests you can elect to debug in real time, check out what step each virtual user is completing, or wait for your test to finish.
Now that your tests are completed, you have instant access to the reports. Looking at the response time breakdown, the navigation timings, and the error logs you're ready to compare your end user experience with your infrastructure performance.
Get Infrastructure Performance Metrics from JMeter
Setting up a test in JMeter takes some time, so following the steps we mentioned above first is key. It's worth noting that sometimes JMeter test results can be skewed based on a handful of different factors. This includes the system resources like CPU, RAM, and network betweek JMeter & the web server that are leveraged to run the load test. If you're able to distribute the load generation to multiple JMeter servers the load you'll have a better chance of generating load without skewing the results.
JMeter is desktop based, so first things first, we'll start by downloading JMeter to your desktop. Easiest way to install JMeter is to use a package manager or download and unarchive the JMeter binaries and install Java.
To build a test:
- Create a Test Plan - made up of test components that dictate how the test will run
- Add Thread Groups -
- number of threads means how many users JMeter will spin up,
- ramp-up time means how long JMeter will take to restart the threads
- loop count means the number of times you want to run the test
- Add HTTP Request Defaults
- In JMeter you have to configure the HTTP Request Defaults to set default values for HTTP Requests. This is where you'd add your server name or IP address of the web server you want to test - this will be the default server.
- Add HTTP Cookie Manager
- Add HTTP Request Sampler
- Adding an HTTP Request Sampler to a thread group is critical in mapping out the path & item that you want each user to request. This process dictates a page request that a user will send.
- Add the Ability to View Results in Listener
- Adding a listener allows you to view the results of a load test. In this case, we're selecting a Table Reader because it's easier to use.
- Run the Test
- View the Results
- the results listed will be in the form of requests and respones. Each request will list whether it's a success or not.
However most of the interesting information you can get back from JMeter that you can use in conjunction with LoadNinja includes metrics from your web application server. For example, if you logged into your VPS to look at your resource usage during the load test you'll be able to correlate the web server data like resource usage to each step in the load test broken down by LoadNinja's browser based data.
Comparing the CPU user usage and the system usage to the Navigation Timings and Response Times in LoadNinja makes it easy and fast to pinpoint the root-cause of performance problems. This is not always required, but if your team uses both tools in parallel it can be useful to leverage the best of both tools.