31
© 2016 Magento, Inc. All rights reserved.

Oleh Kobchenko - Configure Magento 2 to get maximum performance

Embed Size (px)

Citation preview

Page 1: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. All rights reserved.

Page 2: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 2

Agenda 1 Environment Settings

2 Magento Deployment

3 Magento Configuration

4 Extended configuration

5 Testing performance

6 Scaling your store

Page 3: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 3© 2015

Environment settings Magento2

Environment Settings

Magento Deployment

Magento

Configuration

Extended Configuration

Testing performance

Scaling your store

Page 4: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 4

Environment Settings: Web Server

is now officially supported [tested 1.7+]

fully supported as before [tested 2.2+]

configuration samples available:

.htaccess.sample nginx.conf.sample

Settings to pay attention: MaxClients and max_children_count

Page 5: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 5

Environment Settings: PHP

Recommended list of extensions

Sufficient memory_limit 768MB

XDebug adds extra 20% to response time

OpCache with recommended settings

- Enough memory portion to fit the code [512MB]

- Max_accelarated_files count [60000]

- Timestamps validation / Consistency checks

PHP7 is officially supported [tested on 7.0.3]

PHP7 1.5x-3x profit [only with OpCache enabled]

php-bcmath

php-cli

php-common

php-gd

php-intl

php-mbstring

php-mcrypt

php-pdo

php-soap

php-xml

Page 6: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 6

Environment Settings: DB server

MySQL: Oracle and Percona versions are supported [tested on 5.6.x]

Default buffer_size / pool_size / connections / memory_limits settings are OK

Megento 2 Whitepaper clearly regulates recommendations on high load

Page 7: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 7© 2015

Magento deployment Magento2

Environment Settings

Magento Deployment

Magento

Configuration

Extended Configuration

Testing performance

Scaling your store

Page 8: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 8

Deployment: Steps

Actions to perform after installation:

Step 1: Deploy of static content

Step 2: DI instructions preprocessing

Step 3: Magento Mode selection

Page 9: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 9

Deployment: Static content

bin/magento setup:static-content:deploy

What happens inside?

How much time does it save?

Page 10: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 10

Deployment: Compilation

bin/magento setup:di:compile

What happens inside?

How much time saved?

Page 11: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 11

Deployment: Mode selection

Developer Default Production

.htaccess or nginx.conf

Page 12: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 12© 2015

Magento configuration Magento2

Environment Settings

Magento Deployment

Magento

Configuration

Extended Configuration

Testing performance

Scaling your store

Page 13: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 13

Configuration: Server side features

Indexers activation

Flat Product and Flat Category index

Indexers mode [Update on Schedule]

Caches activation

Page Cache [Varnish]

Asynchronous emailing for Checkout / Order Management

Asynchronous OMS grid indexing

Page 14: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 14

Configuration: Client side features

Minification (CSS, JS, HTML)

JS resources bundling

Caching of static content

Images compression

bin/magento catalog:images:resize

Page 15: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 15© 2015

Extended configuration Magento2

Environment Settings

Magento Deployment

Magento

Configuration

Extended Configuration

Testing performance

Scaling your store

Page 16: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 16

Extended configuration: Page Cache

recommended for Page Cache [tested on 3.x & 4.x]

available in both CE + EE

Fast response, less load on server

Varnish sample configuration file available

Build-in PageCache is only for development purposes

Page 17: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 17

Extended configuration: Cache

single web-node installation

local cache storage

RAM FS to get up to 30% improve

several web-nodes installation

Redis as cache storage

sufficient network channel

Page 18: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 18

Extended configuration: Search

recommended for search [tested on 4.x]

available only in EE

SOLR sample configuration file available

0

5

10

15

20

25

-200000 0 200000 400000 600000 800000 1000000 1200000

Seco

nd

s

Records found

MySQL

SOLR

Page 19: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 19

Extended configuration: Job Queue

integration with RabbitMQ

available only in EE version

asynchronous jobs execution

Deferred stock update

… more actions on the way

Recommended for 3PD extensions

Page 20: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 20© 2015

Testing performance Magento2

Environment Settings

Magento Deployment

Magento

Configuration

Extended Configuration

Testing performance

Scaling your store

Page 21: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 21

Testing: Pre-launch steps

Indexation process

bin/magento indexer:reindex

Cache cleaning

bin/magento cache:clean

bin/magento cache:flush

Cache warm up

tool is on the way

Page 22: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 22

Testing: Server side tools

Profiling toolkit [JMeter based]

Representable Benchmark scenario

Profile generator

3 profiles size [small, medium, large]

bin/magento setup:performance:generate-fixtures

Page 23: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 23

Testing: Client side tools

WebPageTest

all aspects of page load time

resources count and size

Yslow by PhantomJS

PageSpeed by Google

optimization recommendations

Page 24: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 24

Testing: Profiling instruments

ZRay by Zend

Magento 2 plugin already available in gallery

Page 25: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 25© 2015

Scaling your store Magento2

Environment Settings

Magento Deployment

Magento

Configuration

Extended Configuration

Testing performance

Scaling your store

Page 26: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 26

Scaling: Out of the box opportunities

Scalability area Community Edition (CE) Enterprise Edition (EE)

Web servers Y Y

Media servers Y Y

Caching system Y Y

Database scalability Y

Search Y

Job queue Y

Page 27: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 27

Scaling: DB solutions (CE)

Community version:

Single database to addresses CE load

Simplified data access / connection

Easy setup on hosting Single

Master DB

Page 28: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 28

Scaling: DB solutions (EE)

Enterprise version:

A number of possible configurations

Up to 3 masters for separate

business domains

Opportunity to have slave DBs

for each master

Checkout and OMS databases

compatible with MySQL Cluster

Web servers

Automatic connection resolving (CQRS pattern)

Main (Catalog)

Master

Main

Slave

Checkout

Master

Order MS

Master

Catalog

Slave

Checkout

Slave

EAV

Slave…

Page 29: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 29

Scaling: Adding more databases

Adding slave database for resource:

bin/magento setup:db-schema:add-slave

Moving specific domain to separate master database

bin/magento setup:db-schema:split-quote

bin/magento setup:db-schema:split-sales

Page 30: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 30

Scaling: Deployment example

Web server

Database

Session server

Caching server

Caching server & Reverse Proxy

Balancer

Search

server

Application server

Job queue server

Job server

Job server

Media server

Web server Web server…

Database Database…

Caching server

Page 31: Oleh Kobchenko - Configure Magento 2 to get maximum performance

© 2016 Magento, Inc. Page | 31© 2015

Q & A Magento2

Environment Settings

Magento Deployment

Magento

Configuration

Extended Configuration

Testing performance

Scaling your store