Sample Title Magento 2 performance comparison in different environments
Yaroslav Rogoza CTO - Atwix
Fixing a bad (slow) code Software tweaks Hardware changes
Bad code <?php $giftcardproducts = Mage::getModel("catalog/product")- >getcollection(); foreach ($giftcardproducts as $giftproduct) { $product = Mage::getModel("catalog/product")- >load($giftproduct->getid());?>...
Software Tweaks [Here should be some funny picture]
Hardware configuration and software Tools used in benchmark: Gatling Docker M2 Custom Sample Data generator Hardware configuration: Intel Core i7-6700, 64 GB DDR4 RAM, 2 x 250 GB SATA 6 Gb/s SSD Intel Core i7-6700, 64 GB DDR4 RAM, 2 TB SATA 4 Gb/s Enterprise Hard Drive
Emulation steps 1. Visit -> 2. Visit -> 3. Visit -> 4. Add to cart -> 5. Search for band keyword -> 6. Go to login page -> 7. Log in -> 8. Go to
Standard sample data, SSD Standard sample data:1 customer, 2k products, 40 categories 453 418 829 1207 1275 1928 3257 3834 0,00 1000,00 2000,00 3000,00 4000,00 Loading time (ms.)
Bottlenecks Configurable::getUsedProducts Configurable::getConfigurableAttributes Configurable\Attribute\Collection::_afterLoad
Standard sample data, SSD Standard sample data:1 customer, 2k products, 40 categories 453 418 829 1207 1275 1928 3257 3834 0,00 1000,00 2000,00 3000,00 4000,00 Loading time (ms.)
Standard sample data, HDD Standard sample data:1 customer, 2k products, 40 categories HDD SSD 1970 1928 4446 3834 1278 829 599 453 3618 3257 470 418 1489 1207 1293 1275 0 1250 2500 3750 5000 Loading Time (ms.)
Standard sample data, SSD Standard sample data:1 customer, 2k products, 40 categories 453 418 829 1207 1275 1928 3257 3834 0,00 1000,00 2000,00 3000,00 4000,00 Loading time (ms.)
Standard sample data + additional customers 2k products, 40 categories, 400k customers 400k customers 1 customer 1933 1928 3837 3834 830 829 470 453 3260 3257 422 418 1350 1207 1392 1275 0 1000 2000 3000 4000 Loading Time (ms.)
Many customers + Redis backend cache 2k products, 40 categories, 400k customers + Redis as backend cache storage Disk 470 469 422 421 953 956 1350 1349 1392 1396 1933 1915 Redis 0 1000 2000 3000 4000 Loading Time (ms.) 3475 3477 3970 3955
Many customers + many products 600k products, 40 categories, 400k customers 400k customers 1 customer 2013 1933 4943 3970 1002 953 521 470 4132 3475 426 422 1347 1350 1396 1392 0 1250 2500 3750 5000 Loading Time (ms.)
Many customers and products + Redis 600k products, 40 categories, 400k customers + Redis as backend cache storage 1002 996 521 524 426 422 Disk 1347 1349 1396 1392 2013 1997 Redis 0 1250 2500 3750 5000 Loading Time (ms.) 4132 4129 4943 4951
Many customers and products, disk cache 600k products, 40 categories, 400k customers + disk cache clean and warmed up Warmed Up 1194 996 522 524 448 422 1355 1349 1436 1392 2107 1997 Clean 4218 4129 0 1500 3000 4500 6000 Loading Time (ms.) 5161 4951
Many customers and products, Redis cache 600k products, 40 categories, 400k customers + Redis and disc cache warmed up 1194 998 522 523 448 421 Disk 1355 1352 1436 1391 2107 1998 Redis 4218 4127 0 1500 3000 4500 6000 Loading Time (ms.) 5161 4951
Many customers and products, MariaDB 600k products, 40 categories, 400k customers + MariaDB as DB engine MariaDB 511 523 422 421 987 998 1362 1352 1391 1391 1994 1998 MySQL 3112 0 1250 2500 3750 5000 Loading Time (ms.) 4120 4127 4951
What else?
Many customers and products, DB replication 600k products, 40 categories, 400k customers + database replication Replication 1001 998 509 523 421 421 1339 1352 1383 1391 1996 1998 No Replication 0 1250 2500 3750 5000 Loading Time (ms.) 4133 4127 4946 4951
What else? PHP7!
Many customers and products, PHP 7.0 PHP 7 PHP 5.6 560 313 523 288 421 816 803 1515 1998 4192 4951 998 2984 4127 1352 1391 0 1250 2500 3750 5000 Loading Time (ms.)
Links Gatling scenario https://github.com/atwix/gatling-m2- benchmark M2 sample data generator https://github.com/atwix/m2- sampledata-generator
Thank You! @rogyar enarc@atwix.com