Yaroslav Rogoza - Magento 2 performance comparison in different

Transcription

Yaroslav Rogoza - Magento 2 performance comparison in different
Sample Title
Magento 2 performance comparison in
different environments
DevelopersParadise
2016 / Opatija / Croatia
Yaroslav Rogoza
CTO - Atwix
DevelopersParadise
2016 / Opatija / Croatia
Fixing a bad (slow) code
Software tweaks
Hardware changes
DevelopersParadise
2016 / Opatija / Croatia
Bad code
<?php $giftcardProducts = Mage::getModel("catalog/product")>getCollection();
foreach ($giftcardProducts as $giftProduct) {
$product = Mage::getModel("catalog/product")>load($giftProduct->getId()); ?>
. . .
DevelopersParadise
2016 / Opatija / Croatia
Software Tweaks
[Here should be some funny picture]
DevelopersParadise
2016 / Opatija / Croatia
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
DevelopersParadise
2016 / Opatija / Croatia
Emulation steps
1. Visit Home Page ->
2. Visit Woman Pants category ->
3. Visit Overnight Duffle product ->
4. Add to cart Overnight Duffle product ->
5. Search for “band” keyword ->
6. Go to login page ->
7. Log in ->
8. Go to My Account page
DevelopersParadise
2016 / Opatija / Croatia
Standard sample data, SSD
Standard sample data:1 customer, 2k products, 40 categories
1928
Home Page
3834
Woman Pants category
829
Overnight Duffle product
Add to cart request
453
3257
Search for 'Band'
User log in page
418
User log in process
My Account page
0,00
1207
1275
1000,00
2000,00
Loading time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
3000,00
4000,00
Bottlenecks
• Configurable::getUsedProducts
• Configurable::getConfigurableAttributes
• Configurable\Attribute\Collection::_afterLoad
DevelopersParadise
2016 / Opatija / Croatia
Standard sample data, SSD
Standard sample data:1 customer, 2k products, 40 categories
1928
Home Page
3834
Woman Pants category
829
Overnight Duffle product
Add to cart request
453
3257
Search for 'Band'
User log in page
418
User log in process
My Account page
0,00
1207
1275
1000,00
2000,00
Loading time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
3000,00
4000,00
Standard sample data, HDD
Standard sample data:1 customer, 2k products, 40 categories
HDD
SSD
1970
1928
Home Page
Woman Pants category
3834
1278
829
599
453
Overnight Duffle product
Add to cart request
3618
3257
Search for 'Band'
User log in page
470
418
User log in process
My Account page
0
1489
1207
1293
1275
1250
2500
Loading Time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
4446
3750
5000
Standard sample data, SSD
Standard sample data:1 customer, 2k products, 40 categories
1928
Home Page
3834
Woman Pants category
829
Overnight Duffle product
Add to cart request
453
3257
Search for 'Band'
User log in page
418
User log in process
My Account page
0,00
1207
1275
1000,00
2000,00
Loading time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
3000,00
4000,00
Standard sample data + additional customers
2k products, 40 categories, 400k customers
400k customers
1 customer
1933
1928
Home Page
3837
3834
Woman Pants category
Overnight Duffle product
470
453
Add to cart request
830
829
3260
3257
Search for 'Band'
422
418
User log in page
User log in process
My Account page
0
1350
1207
1392
1275
1000
2000
Loading Time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
3000
4000
Many customers + Redis backend cache
2k products, 40 categories, 400k customers +
Redis as backend cache storage
Disk
Redis
1933
1915
Home Page
3970
3955
Woman Pants category
Overnight Duffle product
470
469
Add to cart request
953
956
3475
3477
Search for 'Band'
422
421
User log in page
User log in process
My Account page
0
1350
1349
1392
1396
1000
2000
Loading Time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
3000
4000
Many customers + many products
600k products, 40 categories, 400k customers
400k customers
1 customer
2013
1933
Home Page
Woman Pants category
3970
1002
953
521
470
Overnight Duffle product
Add to cart request
Search for 'Band'
User log in page
426
422
User log in process
My Account page
0
3475
2016 / Opatija / Croatia
4132
1347
1350
1396
1392
1250
2500
Loading Time (ms.)
DevelopersParadise
4943
3750
5000
Many customers and products + Redis
600k products, 40 categories, 400k customers +
Redis as backend cache storage
Disk
Redis
2013
1997
Home Page
4943
4951
Woman Pants category
1002
996
521
524
Overnight Duffle product
Add to cart request
4132
4129
Search for 'Band'
User log in page
426
422
User log in process
My Account page
0
1347
1349
1396
1392
1250
2500
Loading Time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
3750
5000
Many customers and products, disk cache
600k products, 40 categories, 400k customers +
disk cache clean and warmed up
Warmed Up
Clean
2107
1997
Home Page
5161
4951
Woman Pants category
Overnight Duffle product
Add to cart request
522
524
1194
996
4218
4129
Search for 'Band'
User log in page
448
422
User log in process
My Account page
0
1355
1349
1436
1392
1500
3000
Loading Time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
4500
6000
Many customers and products, Redis cache
600k products, 40 categories, 400k customers +
Redis and disc cache warmed up
Disk
Redis
2107
1998
Home Page
5161
4951
Woman Pants category
Overnight Duffle product
Add to cart request
522
523
1194
998
4218
4127
Search for 'Band'
User log in page
448
421
User log in process
My Account page
0
1355
1352
1436
1391
1500
3000
Loading Time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
4500
6000
Many customers and products, MariaDB
600k products, 40 categories, 400k customers +
MariaDB as DB engine
MariaDB
MySQL
1994
1998
Home Page
Woman Pants category
Overnight Duffle product
511
523
Add to cart request
3112
987
998
4120
4127
Search for 'Band'
User log in page
422
421
User log in process
My Account page
0
1362
1352
1391
1391
1250
2500
Loading Time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
4951
3750
5000
What else?
DevelopersParadise
2016 / Opatija / Croatia
Many customers and products, DB replication
600k products, 40 categories, 400k customers +
database replication
Replication
No Replication
1996
1998
Home Page
4946
4951
Woman Pants category
1001
998
509
523
Overnight Duffle product
Add to cart request
4133
4127
Search for 'Band'
User log in page
421
421
User log in process
My Account page
0
1339
1352
1383
1391
1250
2500
Loading Time (ms.)
DevelopersParadise
2016 / Opatija / Croatia
3750
5000
What else?
PHP7!
DevelopersParadise
2016 / Opatija / Croatia
Many customers and products, PHP 7.0
PHP 7
PHP 5.6
1515
1998
Home Page
4192
Woman Pants category
Overnight Duffle product
560
Add to cart request
313
523
998
2984
Search for 'Band'
User log in page
288
421
User log in process
816
My Account page
803
0
2016 / Opatija / Croatia
4127
1352
1391
1250
2500
Loading Time (ms.)
DevelopersParadise
4951
3750
5000
Links
• Gatling scenario https://github.com/Atwix/gatling-m2benchmark
• M2 sample data generator https://github.com/Atwix/m2sampledata-generator
DevelopersParadise
2016 / Opatija / Croatia
Thank You!
@rogyar
[email protected]
DevelopersParadise
2016 / Opatija / Croatia