Mangento Perofrmnace Optimization

33
Andrey Korolyov Magento Performance Optimization MavenEcommerce

Transcript of Mangento Perofrmnace Optimization

Page 1: Mangento Perofrmnace Optimization

Andrey Korolyov

Magento Performance Optimization

MavenEcommerce

Page 2: Mangento Perofrmnace Optimization

Good example

• Demo: http://demo.mavenecommerce.com• WIFI :

– HTML download 258ms– DOMContentLoaded 456ms– Load 547ms

• Throttling 3G:– HTML download 350ms– DOMContentLoaded 1820ms– Load 7290ms

MavenEcommerce

Page 3: Mangento Perofrmnace Optimization

What does performance means?

• Websites loading longer than 1.5 seconds are ranked as “slow”, have poor SEO and low AdWords Page Quality (Google)

MavenEcommerce

Page 4: Mangento Perofrmnace Optimization

What does performance means?

• Websites loading longer than 1.5 seconds are ranked as “slow”, have poor SEO and low AdWords Page Quality (Google)

• Every additional 0.5 second load time decreases traffic by 5-20% (Yahoo and Google)

MavenEcommerce

Page 5: Mangento Perofrmnace Optimization

What does performance means?

• Websites loading longer than 1.5 seconds are ranked as “slow”, have poor SEO and low AdWords Page Quality (Google)

• Every additional 0.5 second load time decreases traffic by 5-20% (Yahoo and Google)

• Page load time decrease from 7 to 2 seconds alone raises revenue by 10% (Shopzilla)

MavenEcommerce

Page 6: Mangento Perofrmnace Optimization

What does performance means?

• Every additional 0.5 second load time decreases traffic by 5-20% (Yahoo and Google)

• Page load time decrease from 7 to 2 seconds alone raises revenue by 10% (Shopzilla)

• Every additional 1/10th of a second page load time decreases sales by 1% (Amazon)

MavenEcommerce

Page 7: Mangento Perofrmnace Optimization

What does performance means?

• Page load time decrease from 7 to 2 seconds alone raises revenue by 10% (Shopzilla)

• Every additional 1/10th of a second page load time decreases sales by 1% (Amazon)

• A page that takes 5 seconds or more to load loses 20% of visitors (Forrester)

MavenEcommerce

Page 8: Mangento Perofrmnace Optimization

What does performance means?

• Every additional 1/10th of a second page load time decreases sales by 1% (Amazon)

• A page that takes 5 seconds or more to load loses 20% of visitors (Forrester)

• 80% of visitors won’t come back if the site is slow (75% in 2013, 64% in 2006)

MavenEcommerce

Page 9: Mangento Perofrmnace Optimization

What does performance means?

• A page that takes 5 seconds or more to load loses 20% of visitors (Forrester)

• 80% of visitors won’t come back if the site is slow (75% in 2013, 64% in 2006)

• 70% of revenue comes from the fastest visits

MavenEcommerce

Page 10: Mangento Perofrmnace Optimization

Performance budget

There is not difference for the user between a site is being down and site is being inaccessible due to loading issues caused by blocking resource or slow network.

- Andy Hume

MavenEcommerce

Page 11: Mangento Perofrmnace Optimization

Mobile is slow by default

• Latency is the time between when a browser request a resource from a server and when it starts to receive the server’s response.

MavenEcommerce

Page 12: Mangento Perofrmnace Optimization

Mobile is slow by default

• Latency is the time between when a browser request a resource from a server and when it starts to receive the server’s response.

• On mobile, latecny is a major UX killer. For a 1.7Mb page with 90 request per page, it’s 3s+.

MavenEcommerce

Page 13: Mangento Perofrmnace Optimization

Mobile is slow by default

• Latency is the time between when a browser request a resource from a server and when it starts to receive the server’s response.

• On mobile, latecny is a major UX killer. For a 1.7Mb page with 90 request per page, it’s 3s+.

• Javascript is expensive; it takes time and power to download, parse and execute JavaScript.

MavenEcommerce

Page 14: Mangento Perofrmnace Optimization

MavenEcommerce

Page 15: Mangento Perofrmnace Optimization

MavenEcommerce

Page 16: Mangento Perofrmnace Optimization

Performance matters

• If as site responds within 1s, experience feels instant. If it takes 2.5s+, people start falling off.

• Bad performance results in bad business, especially on eCommerce websites.

• Performance is invisible; it’s difficult to argue about how fast a website “feels”,

MavenEcommerce

Page 17: Mangento Perofrmnace Optimization

What we may optimize?

• Time to First Byte• DomContentReady• Load

MavenEcommerce

Page 18: Mangento Perofrmnace Optimization

Time to first byte

• Nginx

• PHP-FPM

• Memcache / APC / Zend Opcache / Redis

• Varnish?!

MavenEcommerce

Page 19: Mangento Perofrmnace Optimization

Do you think that you need Varnish?

• One server may handle 100 nginx processes

• 1 nginx process creates 1 php-fpm process

• 1 php-fpm process creates 1 mysql connection

• Memory out!

MavenEcommerce

Page 20: Mangento Perofrmnace Optimization

How many vistors do you have?

• One php-fpm process is one visitor.

• One visitor takes 2s to get a HTML page.

• Your server may handle 50 visitors at one moment of time.

MavenEcommerce

Page 21: Mangento Perofrmnace Optimization

How many vistors do you have?

• 100 visitor in 2 seconds

• 3 000 visitors in 1 minute

• 180 000 visitors in 1 hour!

MavenEcommerce

Page 22: Mangento Perofrmnace Optimization

“Core HTML content first” with “Core CSS styles first” is a simple eorollary of the good ol’progressive enhancement.

- Andy Hume

MavenEcommerce

Page 23: Mangento Perofrmnace Optimization

The site‘s modular load

• Consider at least three types of page content:

MavenEcommerce

Page 24: Mangento Perofrmnace Optimization

The site‘s modular load

• Consider at least three types of page content:– Core Content (essential HTML+CSS, usable non-Js enhanced experience)

MavenEcommerce

Page 25: Mangento Perofrmnace Optimization

The site‘s modular load

• Consider at least three types of page content:– Core Content (essential HTML+CSS, usable non-Js enhanced experience)

– Enhancement (JS, Geolocations, touch, enhanced CSS, webfonts, wedigets)

MavenEcommerce

Page 26: Mangento Perofrmnace Optimization

The site‘s modular load

• Consider at least three types of page content:– Core Content (essential HTML+CSS, usable non-Js enhanced experience)

– Enhancement (JS, Geolocations, touch, enhanced CSS, webfonts, wedigets)

– Leftovers (analytics, advertising, third-party content)

MavenEcommerce

Page 27: Mangento Perofrmnace Optimization

The site‘s modular load

• Consider at least three types of page content:– Core Content (essential HTML+CSS, usable non-Js enhanced experience)

– Enhancement (JS, Geolocations, touch, enhanced CSS, webfonts, wedigets)

– Leftovers (analytics, advertising, third-party content)

• Idea: load Core content first, then Enhancement on DomContentReady, then Leftovers on Load.

MavenEcommerce

Page 28: Mangento Perofrmnace Optimization

Libraries

• jQuery• PrototypeJs• RequireJs• loadCSS• Gulp builder

MavenEcommerce

Page 29: Mangento Perofrmnace Optimization

RequireJs

RequireJS is a JavaScript file and module loader. It is optimized for in-browser use.

MavenEcommerce

Page 30: Mangento Perofrmnace Optimization

LoadCSS

A function for loading CSS asynchronously.

MavenEcommerce

Page 32: Mangento Perofrmnace Optimization

Cherry on a cake

PageSpeed speeds up your site and reduces page load time. This open-source webserver module automatically applies web performance best practices to pages and associated assets (CSS, JavaScript, images) without requiring that you modify your existing content or workflow.

MavenEcommerce

Page 33: Mangento Perofrmnace Optimization

Andrey Korolyov, Managing director of MavenEcommerce Inc.

If you have a questions please contact with us or ask it now!

Follow us on twitter: @mavenecommerce

MavenEcommerce

About author