How to performance/load test Magento with Load Impact

Load Impact has provided us with the easiest and most accurate performance testing for clients running on Magento hands down.

Load testing can be a daunting task for any developer, so with this article, we hope to help. When looking for resources on how to accomplish load testing Magento we were overwhelmed by the variety of answers and the popularity of JMeter. Though JMeter is a powerful tool, it has a very steep learning curve. After many demos and free trials and a lot of trial and error, we found ourselves extremely happy with Load Impact.

Load Impact has all of the offerings as its competitors, but what stood out was the ease of learning and executing, not to mention their excellent documentation. What pushed it ahead of the rest was the ability to code the test in LUA. Though not being familiar with LUA before our test, it was quick to learn.

Don’t worry you won’t need to code every test up by hand. Load Impact offers a browser plugin to capture page actions and clicks. We recommend putting together a plan before clicking around to capture actions efficiently, so there is less clean up after recording.

Continue clicking through your plan and perform actions that measure the performance of your site through user actions. You should have a thorough knowledge of the site you are testing to ensure you record actions a user regularly perform on a daily basis and also when a sale happens. It’s also important to make sure the site you are testing is performing it’s routine background tasks and has a database of similar to production as the more users, products, and orders you have could return different results from a staging database without that data.

Once done recording, go through the recorded steps and remove any external calls to 3rd party apps that you may have loaded for marketing, like GA, Optimonk, Olark or others. If you feel these are necessary for your testing, by all means, keep them in.

We recommend creating multiple tests with various actions to make managing your scripts and use cases a bit cleaner. For example, one test was solely to record creating an account, and another was to place an order as a guest.

Here is an example of creating an account and measuring the time from start to finish, recording it as a custom metric so that we can evaluate how long it takes a user to create an account throughout the stress testing.

math.randomseed(os.clock()*100000000000)

for i=1,3 do
    random = math.random(10000, 65000)
end

start_time = util.time()

timeresponse = http.request_batch({
    // Load user create end point
    {"GET", "https://www.yourstore.com/customer/account/create/"},
    // Post data to create new account
    {"POST", "https://www.yourstore.com/customer/account/createpost/", data="...", auto_decompress=true}
})

end_time = util.time()

// Push total execution time as a custom metric
result.custom_metric("Total Exectution Time", end_time - start_time)

log.debug(end_time - start_time)

We hope this gave you enough information to try out testing your Magento sites with Load Impact. Are you curious about what kind of kind of traffic your Magento store is capable of handling? Contact us to learn more about how we can help tune and improve the performance of your Magento store.

Leave a Reply

Like the sound of success?

Let's talk.