mage titans usa 2016 - miguel balparda - magento 2: premium performance with php 7 and varnish
TRANSCRIPT
![Page 1: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/1.jpg)
![Page 2: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/2.jpg)
Magento 2: Premium Performance with PHP 7 and Varnish
![Page 3: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/3.jpg)
•Full time traveler •Magento Master 2016•Meet Magento speaker•Magento Certified Solution Specialist•BBQ Certified Solution Specialist
Miguel Balparda
@mbalparda
![Page 4: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/4.jpg)
Test overview
1. Magento 2 using PHP 5.6 vs Magento 2 using PHP 5.6 and Varnish
2. Magento 2 using PHP 7 vs Magento 2 using PHP 7 and Varnish
3. Magento 2 using PHP 5.6 vs Magento 2 using PHP 7
![Page 5: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/5.jpg)
Hardware
![Page 6: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/6.jpg)
Software● Apache 2.2● Redis 2.8.4● PHP-FPM 5.6.15 (latest versions available at testing time)● PHP-FPM 7.0.2 (latest versions available at testing time)● Percona 5.6● Varnish 4.0.1● Centos 6.7 x86_64● Siege 3.0.5● Magento 2.0.2 with sample data and sample theme
![Page 7: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/7.jpg)
Magento store specs● Stores: 1● SKU count: 2,046 ● Categories: 8● Subcategories: 1,173
![Page 8: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/8.jpg)
Varnish
![Page 9: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/9.jpg)
Magento env.php (redis)
'cache' =>array( 'frontend' => array( 'default' => array( 'backend' => 'Cm_Cache_Backend_Redis', 'backend_options' => array( 'server' => '127.0.0.1', 'port' => '6379' ), ),
![Page 10: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/10.jpg)
Magento env.php (redis)
'page_cache' => array( 'backend' => 'Cm_Cache_Backend_Redis', 'backend_options' => array( 'server' => '127.0.0.1', 'port' => '6379', 'database' => '1', 'compress_data' => '0' ) ) ))
![Page 11: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/11.jpg)
Magento env.php (memcache)
(PHP memcache extension)
'session' => array ( 'save' => 'memcache', 'save_path' => 'tcp://<memcache ip or host>:<memcache port>'),
(PHP memcached extension)
'session' => array ( 'save' => 'memcached’, 'save_path' => '<memcache ip or host>:<memcache port>'),
![Page 12: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/12.jpg)
Magento CLI
We enabled production mode by running:
magento deploy:mode:set production
![Page 13: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/13.jpg)
Siege automation#!/bin/shecho "Creating sitemap:"curl $4 | sed 's/\<url\>/\<url\>\n/g' | grep 0.5 | sed 's/.*loc>\(.*\)<\/loc.*/\1/g' > urls.txtcurl $4 | sed 's/\<url\>/\<url\>\n/g' | grep 1.0 | sed 's/.*loc>\(.*\)<\/loc.*/\1/g' >>urls.txtecho "Warming cache:"Siege -i -c50 -t60s -f urls.txt
echo "Waiting 1 minute for the first test."sleep 1mecho "Starting tests:"for i in `seq 1 $5`;do
echo "Running test # $i / $5:"Siege -i -c$1 -t$2s -f urls.txtecho "Waiting 1 minute for the next test."sleep 1m
doneecho "Removing urls.txt:"rm urls.txt
![Page 14: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/14.jpg)
Siege output ** Siege 2.60
** Preparing 100 concurrent users for battle.The server is now under Siege...doneTransactions: 339 hitsAvaility: 93.39 %Elapsed time: 67.47 secsData transferred: 4273708 bytesResponse time: 8.25 secsTransaction rate: 5.02 trans/secThroughput: 63342.34 bytes/secConcurrency: 41.47Successful transactions: 337Failed transactions: 26Longest transaction: 17.77 secsShortest transaction: 0.37 secs
![Page 15: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/15.jpg)
PHP 5.6 transaction rate
![Page 16: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/16.jpg)
PHP 5.6 transactions
![Page 17: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/17.jpg)
PHP 5.6 response time
![Page 18: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/18.jpg)
PHP 5.6 Varnish transaction rate
![Page 19: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/19.jpg)
PHP 5.6 vs PHP 5.6 Varnish transaction rate
![Page 20: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/20.jpg)
PHP 5.6 vs PHP 5.6 Varnish transactions
![Page 21: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/21.jpg)
PHP 5.6 vs PHP 5.6 Varnish response time
![Page 22: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/22.jpg)
PHP 7 transaction rate
![Page 23: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/23.jpg)
PHP 7 vs PHP 7 Varnish transaction rate
![Page 24: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/24.jpg)
PHP 7 vs PHP 7 Varnish transactions
![Page 25: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/25.jpg)
PHP 7 vs PHP 7 Varnish response time
![Page 26: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/26.jpg)
PHP 5.6 vs PHP 7 transaction rate
![Page 27: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/27.jpg)
PHP 5.6 vs PHP 7 transactions
![Page 28: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/28.jpg)
PHP 5.6 vs PHP 7 response time
![Page 29: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/29.jpg)
Conclusion
![Page 30: Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with PHP 7 and Varnish](https://reader031.vdocuments.site/reader031/viewer/2022030305/5871aed81a28abda6a8b631f/html5/thumbnails/30.jpg)
Thank you for coming!