Magento – Performance Analysis
In our office we are currently evaluating the pros and cons of Magento. Besides all the great features it offers it has a huge con – the performance. We read a lot about it but couldn’t find any reliable statements about how fast or slow it really it is. So I put a plain Magento install on my testing machine and gave it a shot..
HTTP/1.1 200 1.14 secs: 9701 bytes ==> /
Lifting the server siege… done.
Transactions: 1527 hits
Availability: 100.00 %
Elapsed time: 89.69 secs
Data transferred: 14.13 MB
Response time: 1.46 secs
Transaction rate: 17.03 trans/sec
Throughput: 0.16 MB/sec
Concurrency: 24.78
Successful transactions: 1527
Failed transactions: 0
Longest transaction: 4.24
Shortest transaction: 0.37
These results are for a totally empty Magento install. No products, no categories, default theme – landing page. 17 requests/sec aren’t very satisfying considering the DB is empty. So I took an existing XT:Commerce with ~100 categories and ~5500 products and imported everything in Magento.
The start page now displayed the main categories but besides that nothing. I didn’t put any products or paragraphs on the page.
Transactions: 1728 hits
Availability: 100.00 %
Elapsed time: 89.73 secs
Data transferred: 46.52 MB
Response time: 1.29 secs
Transaction rate: 19.26 trans/sec
Throughput: 0.52 MB/sec
Concurrency: 24.84
Successful transactions: 1728
Failed transactions: 0
Longest transaction: 5.37
Shortest transaction: 0.09
If you read the numbers carefully your probably noticed a slight increase in the req/sec. I’m not sure what happened here – might be tolerance, but I did this test a couple of times and the result was always 19req/sec. Perhaps Magento created some more caches in the background that I forgot to set before – will have to investigate it a bit more later.
However, in real life our customers are supposed to click more than just the start page when they visit our shop. They are supposed to browse categories and sort the products by name, price, size and color. So I grabbed the next sitemap crawler, generated a list of 250urls and fed Siege with the new task.
You better buckle up, this is not pretty!
Transactions: 574 hits
Availability: 100.00 %
Elapsed time: 90.20 secs
Data transferred: 27.55 MB
Response time: 3.83 secs
Transaction rate: 6.36 trans/sec
Throughput: 0.31 MB/sec
Concurrency: 24.36
Successful transactions: 574
Failed transactions: 0
Longest transaction: 15.61
Shortest transaction: 0.33
That’s what I call slow! Imagine you are a shop owner and you are doing it for living. The customers are placing their orders and then – out of the dark – the Google Bots start indexing your site, a customer sends a link to a few friends, makesa post on FaceBook about your fancy new products and then – the server goes down, due to the lack of performance. During this test the server load reached 14 and the site responded veeeery slow – up to 15secs per click. Most customers would leave your site right away.
In the next part, I’m gonna try to see if and how Magento can be tweaked to survive a rush on your site.
Be prepared and check back soon!
April 19th, 2012 at 13:48
Hello Stefen,
Besire reading your above analys I would say you did a great job and your concerns are 100% valid.
Being as an Magento Professional developer, I had analysis many of Magento websites and found that the performance issue occurs oftenly due to many unused active Magento features in each single installation now a days running.
Beside my experience I would suggest you to not only create an crawler but also create an server analysis at that time. You will notice that how many complicated SQL queries will ran in a time.
Anyways generally there are quite a good examples referring to make a fix on performance boost in installation (when we are done with the fixes on memory leaks in server). In my experience with an average traffic load of 109 customers on each store/min, we had successfully configured a server with a load of more than 300 Magento installations and still capable to absorb 160+ customers on the same server, without giving up any slow downs, or higher CPU usage.
Amazingly, Magento is one of the best E-Commerce software made in PHP. Extremely user friendly, works like a charm. Manages each and everything what an eCommerce website might in need.
Thanks
April 19th, 2012 at 14:10
@Farhahn,
drop me a mail at steffen[ at ]thisdomain. I’d like to hear more how u manage such a load (109 users is quite stunning)
September 6th, 2012 at 15:35
@Steffen
Surely I will dispatch you an with an complete snippet of detailed description why Magento gets slower with details in some free time(so you can reduce the un-necessary to gain maximum).
In short I would like you to discover the major three issues which can reduce 80-90% of your System Load.
1) Magento classes compilation.
2) Magento Flat Catalog Product and Magento Flat Catalog Categories.
3) Zend Full Page cache.
Now let me give you a very slight over-view on understanding the base which helps in boost you up to such a huge speed up difference.
1) Magento Classes compilation:
The basic Magento with default installation consists of more than 11k files (According to Magento 1.7). In default Magento goes through several classes rewrites after reading instructions from several XML file instructions and finally generates output for browser.
Classes compilation will help Magento to merge all files/ classes in a single file. This will surely boost Magento classes file read speed where we speak it was reading from around 50 classes now reading only from 1 class file. (Benefit will be IDE performance)
Settings available in System->Tools->Compilation->Run Compilation process
{Note: Compilation process took some time to complete}
2) Flat Catalog product and Flat Catalog categories:
The Magento default run quite complex queries to gain a single product/ category (for more details see/explore http://fishpig.co.uk/blog/direct-sql-queries-magento.html)slightly 5-7 table joins according to my knowledge however I hadn’t ever changed the query so not exactly sure.
Converting the products and categories to Flat catalog products and Flat catalog categories helps you to maintain rest of your attribute relations, necessary information relations to store in a single new table (which will be created upon changing settings).
Using this your all data will be accessible from single table rather than looking from multiple tables, Magento starts looking from one or maximum of two tables which is however effectively improves store performance around 60% guaranteed.
Settings available in System->Configuration->Catalog->Catalog->Frontend tab. Set “Use Flat Catalog Category” and “Use Flat Catalog Product” to yes and hit save.
{Note: can took extra longer time if you have thousands of products}
3) Zend Full Page Cache.
Ah, Well what should I say? The name clearly states its purpose. Anyways, this is slightly different from the (but still dependent on) regular Magento cache module available in Magento.
The regular Cache module pull down the SQL request from 50 to a number of 20 queries but using Zend Full Page cache you actually reduces the 20 queries to further more a bit say 2 sql queries.
Imagine the difference of 50 SQL queries and 2 SQL queries
Settings available in System->Configuration->Advanced->System->”External Full Page Cache”->”Enable External Cache” set it to yet.
I would like you to set-up these changes, and re-test with your performance monitoring tool and I can bet you will be shocked to see that after these 3 basic tweaks you can be able to not only run 103 clients but even 1003 clients challenged even with the complete dynamic features what Magento offers.
There are 20-30 more optimizations which leads the store to more its peak but these above 3 are quite easy to be even configured by site owner at their own.
I can be reached from farhan [at] askwhyweb [dot] com to assist/ provide sample URLs.
Feel free to contact me if gets any issue but make it sure that your email subject should contain some understandable subject otherwise it will be leaded to my spam box and I occasionally opens my spam box.
Thanks
Farhan Islam