SlideShare a Scribd company logo
Miguel Balparda
Magento 2: Premium Performance
with PHP 7 and Varnish
•Full time traveler
•Magento Master 2016
•Meet Magento speaker
•Magento Certified Solution Specialist
•BBQ Certified Solution Specialist
Miguel Balparda
@mbalparda
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
Hardware
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
Varnish
Varnish + Magento
Magento + Varnish
Replace your default VCL and restart the service
service varnish restart
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'
),
),
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'
)
)
)
)
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>'
),
Magento CLI
We enabled production mode by running:
magento deploy:mode:set production
Siege automation
#!/bin/sh
echo "Creating sitemap:"
curl $4 | sed 's/<url>/<url>n/g' | grep 0.5 | sed 's/.*loc>(.*)</loc.*/1/g' > urls.txt
curl $4 | sed 's/<url>/<url>n/g' | grep 1.0 | sed 's/.*loc>(.*)</loc.*/1/g' >>urls.txt
echo "Warming cache:"
siege -i -c50 -t60s -f urls.txt
echo "Waiting 1 minute for the first test."
sleep 1m
echo "Starting tests:"
for i in `seq 1 $5`;
do
echo "Running test # $i / $5:"
Siege -i -c$1 -t$2s -f urls.txt
echo "Waiting 1 minute for the next test."
sleep 1m
done
echo "Removing urls.txt:"
rm urls.txt
Siege output
** Siege 2.60
** Preparing 100 concurrent users for battle.
The server is now under Siege...done
Transactions: 339 hits
Availity: 93.39 %
Elapsed time: 67.47 secs
Data transferred: 4273708 bytes
Response time: 8.25 secs
Transaction rate: 5.02 trans/sec
Throughput: 63342.34 bytes/sec
Concurrency: 41.47
Successful transactions: 337
Failed transactions: 26
Longest transaction: 17.77 secs
Shortest transaction: 0.37 secs
PHP 5.6 transaction rate
PHP 5.6 transactions
PHP 5.6 response time
PHP 5.6 vs PHP 5.6 Varnish transaction rate
8x2.3x2x
PHP 5.6 vs PHP 5.6 Varnish transactions
9x5x2x
PHP 5.6 vs PHP 5.6 Varnish response time
377x90x50x
PHP 7 transaction rate
PHP 7 vs PHP 7 Varnish transaction rate
4.7x1.6x1-7x
PHP 7 vs PHP 7 Varnish transactions
5x1.5x1.6x
PHP 7 vs PHP 7 Varnish response time
187x31x51x
PHP 5.6 vs PHP 7 transaction rate
PHP 5.6 vs PHP 7 transactions
PHP 5.6 vs PHP 7 response time
Conclusion
Thank you for coming!

More Related Content

PDF
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
PDF
Eduardo Silva - monkey http-server everywhere
PPTX
Debugging varnish
PDF
T.Pollak y C.Yaconi - Prey
PDF
(WS14) Sasa Matijasic - Node.js i "novi" web
PPTX
Who Broke My Crypto
PPTX
My journey from PHP to Node.js
PDF
NSClient Workshop: 04 Protocols
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Eduardo Silva - monkey http-server everywhere
Debugging varnish
T.Pollak y C.Yaconi - Prey
(WS14) Sasa Matijasic - Node.js i "novi" web
Who Broke My Crypto
My journey from PHP to Node.js
NSClient Workshop: 04 Protocols

What's hot (20)

PDF
nginxをソースからインストールしてみたよ
PDF
PFIセミナー資料 H27.10.22
PPTX
Write a redis client of your own
PPTX
Run Node Run
PPTX
Plone deployment made easy
PDF
Varnish Caching
PDF
Rails Plugins 2 Hoe
PDF
Config managament for development environments ii
PDF
Haproxy - zastosowania
PDF
Puppet and Openshift
DOCX
Creating qmgr and allowing remote authorization
PDF
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...
PDF
Kettunen, miaubiz fuzzing at scale and in style
PDF
Babushka
PDF
Monit - NHRuby May 2009
KEY
VCLをTDDで書いてデプロイする
KEY
Don’t block the event loop!
PDF
nouka inventry manager
PDF
Dev ops on startup environment
nginxをソースからインストールしてみたよ
PFIセミナー資料 H27.10.22
Write a redis client of your own
Run Node Run
Plone deployment made easy
Varnish Caching
Rails Plugins 2 Hoe
Config managament for development environments ii
Haproxy - zastosowania
Puppet and Openshift
Creating qmgr and allowing remote authorization
Ondřej Šika: Docker, Traefik a CI - Mějte nasazené všeny větve na kterých pra...
Kettunen, miaubiz fuzzing at scale and in style
Babushka
Monit - NHRuby May 2009
VCLをTDDで書いてデプロイする
Don’t block the event loop!
nouka inventry manager
Dev ops on startup environment
Ad

Viewers also liked (17)

PPTX
Magento 2 Seminar - Maarten Schuiling - The App Economy
PPTX
Madison PHP - Getting Started with Magento 2
PDF
Data Insight Russian Ecommerce Ecosystem (oct'2013)
PPTX
Zendcon scaling magento
PPTX
Z-Ray: A customizable development tool belt (Zendcon 2016)
PPTX
Midwest PHP - Scaling Magento
PPTX
php[world] Magento101
PPTX
Elk ruminating on logs
PPTX
Success in E-commerce for India Retail Sector
PPT
12 Amazing Features of Magento 2
PDF
La revolution russe (2)
PPTX
Ulrich
DOCX
Trabalho sobre eleições - João
PDF
Panda Update @ TradeTracker
PPTX
Magento 1.x to Magento 2 Code Migration Tools
DOCX
01. simuladores de negocio
PDF
아마존 AWS 클라우드에서 Magento 설치 매뉴얼
Magento 2 Seminar - Maarten Schuiling - The App Economy
Madison PHP - Getting Started with Magento 2
Data Insight Russian Ecommerce Ecosystem (oct'2013)
Zendcon scaling magento
Z-Ray: A customizable development tool belt (Zendcon 2016)
Midwest PHP - Scaling Magento
php[world] Magento101
Elk ruminating on logs
Success in E-commerce for India Retail Sector
12 Amazing Features of Magento 2
La revolution russe (2)
Ulrich
Trabalho sobre eleições - João
Panda Update @ TradeTracker
Magento 1.x to Magento 2 Code Migration Tools
01. simuladores de negocio
아마존 AWS 클라우드에서 Magento 설치 매뉴얼
Ad

Similar to Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish (20)

PDF
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
PDF
Nginx pres
PDF
Saving The World From Guaranteed APOCALYPSE* Using Varnish and Memcached
ODP
Caching and tuning fun for high scalability
PPTX
Lonestar php scalingmagento
ODP
Caching and tuning fun for high scalability @ FOSDEM 2012
PPTX
Nexcess Magento Imagine 2014 Performance Breakout
PDF
Running php on nginx
PDF
Running PHP on nginx
PPTX
Boost your website by running PHP on Nginx
PDF
Secure PHP environment
PDF
Magento's Imagine eCommerce Conference 2011 - Hosting Magento: Performance an...
PDF
Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...
KEY
Drupal High Availability High Performance 2012
PPTX
Designing enterprise drupal
DOCX
How to install and configure LEMP stack
PPT
Why Managed Service Providers Should Embrace Container Technology
DOC
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
PDF
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
PDF
Varnish presentation for the Symfony Zaragoza user group
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Nginx pres
Saving The World From Guaranteed APOCALYPSE* Using Varnish and Memcached
Caching and tuning fun for high scalability
Lonestar php scalingmagento
Caching and tuning fun for high scalability @ FOSDEM 2012
Nexcess Magento Imagine 2014 Performance Breakout
Running php on nginx
Running PHP on nginx
Boost your website by running PHP on Nginx
Secure PHP environment
Magento's Imagine eCommerce Conference 2011 - Hosting Magento: Performance an...
Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...
Drupal High Availability High Performance 2012
Designing enterprise drupal
How to install and configure LEMP stack
Why Managed Service Providers Should Embrace Container Technology
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Varnish presentation for the Symfony Zaragoza user group

More from Yireo (20)

PDF
Faster Magento Integration Tests
PDF
Mage-OS Nederland
PDF
Modernizing Vue Storefront 1
PDF
Magento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshop
PDF
Magento 2 Seminar - Toon van Dooren - Varnish in Magento 2
PDF
Magento 2 Seminar - Andra Lungu - API in Magento 2
PDF
Magento 2 Seminar - Roger Keulen - Machine learning
PDF
Magento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelen
PDF
Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2
PDF
Magento 2 Seminar - Arjen Miedema - Search Engine Optimisation
PPTX
Magento 2 Seminar - Tjitte Folkertsma - Beaumotica
PDF
Magento 2 Seminar - Jeroen Vermeulen Snelle Magento 2 Shops
PDF
Magento 2 Seminar - Christian Muench - Magerun2
PDF
Magento 2 Seminar - Anton Kril - Magento 2 Summary
PDF
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarks
PDF
Magento 2 Seminar - Ben Marks - Keynote
PDF
Magento 2 Seminar - Community agenda
PDF
Magento 2 Seminar - Jisse Reitsma - Migratie Planning
PDF
Magento 2 Seminar - Welkom
PDF
Dutch Joomla PHP Developers group - HikaShop Plugin Events
Faster Magento Integration Tests
Mage-OS Nederland
Modernizing Vue Storefront 1
Magento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshop
Magento 2 Seminar - Toon van Dooren - Varnish in Magento 2
Magento 2 Seminar - Andra Lungu - API in Magento 2
Magento 2 Seminar - Roger Keulen - Machine learning
Magento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelen
Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2
Magento 2 Seminar - Arjen Miedema - Search Engine Optimisation
Magento 2 Seminar - Tjitte Folkertsma - Beaumotica
Magento 2 Seminar - Jeroen Vermeulen Snelle Magento 2 Shops
Magento 2 Seminar - Christian Muench - Magerun2
Magento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarks
Magento 2 Seminar - Ben Marks - Keynote
Magento 2 Seminar - Community agenda
Magento 2 Seminar - Jisse Reitsma - Migratie Planning
Magento 2 Seminar - Welkom
Dutch Joomla PHP Developers group - HikaShop Plugin Events

Recently uploaded (20)

PPTX
sap open course for s4hana steps from ECC to s4
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
KodekX | Application Modernization Development
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Cloud computing and distributed systems.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
sap open course for s4hana steps from ECC to s4
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
KodekX | Application Modernization Development
Advanced methodologies resolving dimensionality complications for autism neur...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
MYSQL Presentation for SQL database connectivity
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Weekly Chronicles - August'25 Week I
The Rise and Fall of 3GPP – Time for a Sabbatical?
Cloud computing and distributed systems.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish

  • 1. Miguel Balparda Magento 2: Premium Performance with PHP 7 and Varnish
  • 2. •Full time traveler •Magento Master 2016 •Meet Magento speaker •Magento Certified Solution Specialist •BBQ Certified Solution Specialist Miguel Balparda @mbalparda
  • 3. 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
  • 5. 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
  • 8. Magento + Varnish Replace your default VCL and restart the service service varnish restart
  • 9. 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' ), ),
  • 10. 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' ) ) ) )
  • 11. 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>' ),
  • 12. Magento CLI We enabled production mode by running: magento deploy:mode:set production
  • 13. Siege automation #!/bin/sh echo "Creating sitemap:" curl $4 | sed 's/<url>/<url>n/g' | grep 0.5 | sed 's/.*loc>(.*)</loc.*/1/g' > urls.txt curl $4 | sed 's/<url>/<url>n/g' | grep 1.0 | sed 's/.*loc>(.*)</loc.*/1/g' >>urls.txt echo "Warming cache:" siege -i -c50 -t60s -f urls.txt echo "Waiting 1 minute for the first test." sleep 1m echo "Starting tests:" for i in `seq 1 $5`; do echo "Running test # $i / $5:" Siege -i -c$1 -t$2s -f urls.txt echo "Waiting 1 minute for the next test." sleep 1m done echo "Removing urls.txt:" rm urls.txt
  • 14. Siege output ** Siege 2.60 ** Preparing 100 concurrent users for battle. The server is now under Siege...done Transactions: 339 hits Availity: 93.39 % Elapsed time: 67.47 secs Data transferred: 4273708 bytes Response time: 8.25 secs Transaction rate: 5.02 trans/sec Throughput: 63342.34 bytes/sec Concurrency: 41.47 Successful transactions: 337 Failed transactions: 26 Longest transaction: 17.77 secs Shortest transaction: 0.37 secs
  • 18. PHP 5.6 vs PHP 5.6 Varnish transaction rate 8x2.3x2x
  • 19. PHP 5.6 vs PHP 5.6 Varnish transactions 9x5x2x
  • 20. PHP 5.6 vs PHP 5.6 Varnish response time 377x90x50x
  • 22. PHP 7 vs PHP 7 Varnish transaction rate 4.7x1.6x1-7x
  • 23. PHP 7 vs PHP 7 Varnish transactions 5x1.5x1.6x
  • 24. PHP 7 vs PHP 7 Varnish response time 187x31x51x
  • 25. PHP 5.6 vs PHP 7 transaction rate
  • 26. PHP 5.6 vs PHP 7 transactions
  • 27. PHP 5.6 vs PHP 7 response time
  • 29. Thank you for coming!