44
Running Magento 2 Jisse Reitsma - Running Magento 2 Yireo - slides.yireo.com

Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Running Magento 2

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 2: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

About meJisse Reitsma

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 3: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

About meJisse Reitsma

Founder and lead developer of Yireo

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 4: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

About meJisse Reitsma

Founder and lead developer of Yireo

Wrote 2 developer books for J**ml*

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 5: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

About meJisse Reitsma

Founder and lead developer of Yireo

Wrote 2 developer books for J**ml*

Grab a MUGMUG

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 6: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

About meJisse Reitsma

Founder and lead developer of Yireo

Wrote 2 developer books for J**ml*

Grab a MUGMUG

Part of Zend Z-Team

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 7: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

About meJisse Reitsma

Founder and lead developer of Yireo

Wrote 2 developer books for J**ml*

Grab a MUGMUG

Part of Zend Z-Team

Part of ExtDN

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 8: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

About meJisse Reitsma

Founder and lead developer of Yireo

Wrote 2 developer books for J**ml*

Grab a MUGMUG

Part of Zend Z-Team

Part of ExtDN

I live near a palace

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 9: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

The palace

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 10: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Disclaimers

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 11: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

DisclaimersI do not live in a palace

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 12: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

DisclaimersI do not live in a palace

I am not a runner

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 13: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

DisclaimersI do not live in a palace

I am not a runner

I am just a simple Dutch guy

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 14: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

DisclaimersI do not live in a palace

I am not a runner

I am just a simple Dutch guy

Difference between running from runningOperations vs performance

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 15: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Running Magento 2Performance

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 16: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

EnvironmentPHP 7 + Zend OPcache

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 17: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

EnvironmentPHP 7 + Zend OPcache

Nginx + PHP-FPMPHP-FPM via UNIX socket?

HTTP/2

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 18: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

EnvironmentPHP 7 + Zend OPcache

Nginx + PHP-FPM

Redis cachingMultiple Redis databases

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 19: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

EnvironmentPHP 7 + Zend OPcache

Nginx + PHP-FPM

Redis caching

MySQL 5.6 (or alternative) + tuningQuery cache, InnoDB buffers

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 20: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

EnvironmentPHP 7 + Zend OPcache

Nginx + PHP-FPM

Redis caching

MySQL 5.6 (or alternative) + tuning

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 21: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

EnvironmentPHP 7 + Zend OPcache

Nginx + PHP-FPM

Redis caching

MySQL 5.6 (or alternative) + tuning

composer / magerun2Magerun2 addons from Hypernode: Patching, updates

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 22: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

EnvironmentPHP 7 + Zend OPcache

Nginx + PHP-FPM

Redis caching

MySQL 5.6 (or alternative) + tuning

composer / magerun2

CI toolsphpcs, phpmd, Phing/Capistrano/Fabric

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 23: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

OptionalsVarnish

VCL file generated through Magento 2

ClusteringMySQL master/slave, M2 EE

Offloading searchSolr, ElasticSearch

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 24: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

PHP 7

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 25: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

PHP 7Hurray for Zend

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 26: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

PHP 7Hurray for Zend

Ditch HHVM

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 27: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

PHP 7Hurray for Zend

Ditch HHVM

Tune Zend OPcacheopcache.validate_timestamps=0 ?

Reload PHP-FPM instance after git pull

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 28: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

PHP 7Hurray for Zend

Ditch HHVM

Tune Zend OPcache

Recompile PHP with PGOPGO = Profile-Guided Optimization

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 29: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

PHP 7Hurray for Zend

Ditch HHVM

Tune Zend OPcache

Recompile PHP with PGO

Enable huge_code_pages in kernelNot page size of 4k but of 2m

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 30: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Turning offionCube

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 31: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Turning offionCube

Xdebug

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 32: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Turning offionCube

Xdebug

NewRelic, Zend Z-Ray, Blackfire

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 33: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Turning offionCube

Xdebug

NewRelic, Zend Z-Ray, Blackfire

MySQL performance schemas

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 34: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Experimental

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 35: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Experimentalappserver.io

Wait for 06/2016 release for PHP 7

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 36: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Experimentalappserver.io

Wait for 06/2016 release for PHP 7

Tarantool or Aerospike instead of Redisgithub.com/danslo/Rubic_Cache_Backend_Aerospike

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 37: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Experimentalappserver.io

Wait for 06/2016 release for PHP 7

Tarantool or Aerospike instead of Redisgithub.com/danslo/Rubic_Cache_Backend_Aerospike

Hack from HHVM

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 38: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Running Magento 2Operations

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 39: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Magento 2 operationsNo code generation of live server

Not running magento setup:di:compile

Committing var/generation and var/di to git?

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 40: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Magento 2 operationsNo code generation of live server

No composer updates on live serverCommitting composer.lock to git (?)

Use prestissimo for faster downloads

Use Satis or Toran Proxy for offloading

Optimize autoload file (‐‐optimize‐autoloader)

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 41: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Magento 2 operationsNo code generation of live server

No composer updates on live server

Interceptors instead of event observersInterceptor count matters less due to code generation

Count of dispatched events does matter

But events are less confusing than interceptors

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 42: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Magento 2 operationsNo code generation of live server

No composer updates on live server

Interceptors instead of event observers

How to analyse DI properly?Preferences, types, virtual types, plugins

Circular dependencies reports do not help

magento-hackathon/magento2-plugin-visualization

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 43: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

Magento 2 operationsNo code generation of live server

No composer updates on live server

Interceptors instead of event observers

How to analyse DI properly?

Deploying static view filesUse Grunt / Gulp instead

Specify what you want to deploy (PR @denisristic)

Other stuff we did on Monday

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com

Page 44: Running Magento 2 - Create Hosting · Difference between running from running Operations vs performance Jisse Reitsma - Running Magento 2 ... PHP 7 + Zend OPcache Jisse Reitsma -

ThanksQuestions?

Jisse Reitsma - Running Magento 2

Yireo - slides.yireo.com