You and your team have been pushing plenty of updates to your app over the last few weeks in preparation for a marketing milestone.
Everybody in the company is excited, and you can’t wait for users — and potential customers — to see what you’ve cooked up for their enjoyment.
But you haven’t been continuously performance testing throughout development (a bad move, but we forgive you), and you just realized it’s time to start running load tests.
Never fear! We’ve broken down a few steps to get your load testing extravaganza up-and-running, and from there you can smoothly transition to continuous testing, which will save you from this headache in the future.Let’s get started. There’s no time to lose!
Creating User Scenarios
A user scenario defines the URLs and pages our simulated users will request during your load tests.
If you’re interested in saving time while still creating robust, multiple-step user scenarios, we recommend you head straight for the Load Impact User Scenario Recorder Chrome extension.
We built this Chrome extension to make creating user scenarios easy. You can read how to use the recorder in this support article.
Use the recorder to simulate a user’s behavior in your Chrome browser. After you’ve completed the scenario, stop the recording, and you’ll be redirected into the Load Impact app.
The next step is to validate the script. You can do that by simply clicking the “Validate” button in the top-right portion of the dashboard.
Validation entails running a single virtual user through the script to check for errors. Once the validation is successful, you’re ready to configure your load test(s).
NOTE: It’s important to remember that all your users aren’t going to do the same thing, so you should create a few different user scenarios in order to simulate concurrent traffic realistically.
Creating Load Tests
Now we’re getting to the fun part!
There are a few things for you to consider when configuring a load test. Here’s a list for quick reference:
- How many concurrent virtual users do you need to test?
- Rely on your average traffic data if you want to get your performance baseline
- Crank it up 10x (or more) if you want to test the max capacity of your app and infrastructure
- Read this article on how to determine concurrent virtual users in your tests
- Which (and how many) user scenarios are you going to use in each test?
- All of your users aren’t going to behave the same way, so creating multiple scenarios is a good idea
- How will you allocate load between user scenarios?
- You know all your users won’t be on the same journey, and this is where you configure
- It’s usually a good idea to run multiple tests with differing percentages so you get a full picture of how your app could behave differently based on what people are doing
- Where will load be generated from?
- What browsers should the test emulate?
- From your analytics, you should know what browsers people commonly use when accessing your site or app. Set the simulated browser for the test in the test configuration or in your load script
Running Load Tests
The user scenarios and tests have been created, and now it’s time to run the tests.
The best way to do this when you’re strapped for time is to follow this basic process:
- Run the tests
- Analyze the results
- Make optimizations
- Repeat steps 1-3
Of course, these steps can get a bit muddled if your app, website or infrastructure start to encounter serious problems during the tests, but that’s why you’re running them! It’s better that you discover fatal errors instead of the users during crucial business hours.
We’ve worked with and assisted plenty of software developers who are working on a tight deadline. The keys here are to remain calm, trust your test results and make performance optimizations in the simplest way possible.
Check out this blog article if you’re looking for some guidance on what types of performance tests to run and the type of insight you’ll gain.
After you’ve made the necessary optimizations to your website, app or infrastructure, you should be able to breathe a sigh of relief.
You defeated your deadline, and everything goes smoothly upon the wave of traffic. You’re happy. Marketing is happy. The suits are happy. It’s truly a joyous day for you and your company.
But you never want to feel that kind of last-minute load testing pressure again, right?
Automating Load Testing in a Continuous Integration Environment
We’re in love with automating tasks in our development process, and we’ve talked to thousands of engineers who feel the same way.
You have the power to automate load testing in pretty much any continuous integration environment using the Load Impact API, and we also have plenty of documentation to help you integrate with specific continuous integration software.
Defeating deadlines typically brings people happiness, but imagine a world where you don’t even have to worry about a deadline because you’ve been preparing throughout your build process.