cancel
Showing results for 
Search instead for 
Did you mean: 

Load testing the cart

Load testing the cart

Cross-post from http://magento.stackexchange.com/questions/139271/load-testing-the-cart-with-a-fixed-cookie

 

I am working on improving the performance of a Magento 1.9 store. I have made a lot of improvements that have reflected well in load tests on the home page and product pages, and on the cart without a cookie.

 

I have been asked to load test the checkout too. I am familiar with Blitz, ApacheBench, Siege, Jmeter and httperf but I am unsure of how best to use them to mimic normal cart page loads.

 

So far, I have visited the cart page in my browser, with items in my cart. I then copied the cookie into ApacheBench. The CPU and memory utilization on the server stayed very low but the throughput peaked at about 9 page loads per second, where we are able to do about 15x that on the home page (and it is reflected in the utilization).

 

There is nothing recent in the Magento error logs.

 

Specifically, I wonder if Magento or PHP might lock session data during the page load. If it does, which would be sensible in my opinion, then we would have to load test with a pool of different session cookies to avoid these locks, which would obviously not affect real usage the same way.

 

I am aware that there is already a similar thread. This thread relates specifically to any flaws in my methodology of copying one cookie into the load tester and whether there is a good method specifically for the cart. I am looking for any insight about the use of sessions in Magento, flaws in my methodology and better evaluation techniques for the cart.

 

The setup is as follows: Magento 1.9, Nginx 1.9, HHVM 3.16 via FCGI (also tested with PHP 5.6), MariaDB 10.1 & Redis.

1 REPLY 1

Re: Load testing the cart

Welcome to load testing tools.

Most tools allow for scripting of variable that occur during run-time.  What you need to do is dynamic data correlation the session sent back to the browser so that it will replay at run-time.  It looks something like this:

Browser: Send me that page:

Web server: HTML goes back with Session ID buried in it

Script: parses out the session ID and stores to variable
Browser: sends next page request with variable inserted in playback 
Web server: understands session and sends back appropriate data

 

Based upon my limited knowledge of the tools you mentioned, you might be able to do it in jMeter?  We use HP Loadrunner here because it will do this for you automatically (mostly).  You can get a 50 user license for free with Community Edition.  If you run just a couple of users, that will be plenty to shut down Magento.

BTW- You can try to bypass this other ways, but they will not work (sharing cookies, etc).  Each user gets its own unique session, and the web server knows which one it is talking to.  Any efforts to bypass it will result in filling your logs with errors.

 

Steven Antonucci
LiteSpeed Technologies