22
3 Diciembre 2015 . Buenos Aires . Argentina Think! Performance Mauro Nigrele

MeetMagento 2015 - Argentina - Think Performance

Embed Size (px)

Citation preview

Page 1: MeetMagento 2015 - Argentina - Think Performance

3 Diciembre 2015 . Buenos Aires . Argentina

Think! PerformanceMauro Nigrele

Page 2: MeetMagento 2015 - Argentina - Think Performance

Aboutme

Mauro Nigrele

๏ Arquitecto IT en Lyracons • Php & MySql - 2004 • Zend Framework - 2008 • Magento - 2010 • Magento Certified Dev Plus - 2012 • Obsesivo, Inquieto, Molesto

Page 3: MeetMagento 2015 - Argentina - Think Performance

Tuning

Page 4: MeetMagento 2015 - Argentina - Think Performance

AboutTuning

• Tuning sounds like “Server Adjustments” • There is a lot of “Magento Tuning” Talks & Docs

“Sell, Design, Develop, and Manage your store with Performance in Mind“

Page 5: MeetMagento 2015 - Argentina - Think Performance

AboutTuning

“ … Si solo nos preocupáramos por ‘tunear’ servers lo único que

obtendríamos sería… “Juan Carlos Sarlanga . 1883

Alta llanta!

Page 6: MeetMagento 2015 - Argentina - Think Performance

Evaluation

Features, Catalog, Integrations

Page 7: MeetMagento 2015 - Argentina - Think Performance

EvaluationFeatures

๏ Features Magento (Factory Modules) ๏ Features Custom ✓ To Build ✓ 3rd Party Modules

๏Custom Data on Frontend (views)

Page 8: MeetMagento 2015 - Argentina - Think Performance

EvaluationCatalog

๏Product Attributes Sets ๏Product Attributes

✓ Search

✓ Filter (Layer)

✓ Listing (show in product listing)

Page 9: MeetMagento 2015 - Argentina - Think Performance

EvaluationIntegrations

๏ Frequency ๏Relevance ๏ “News” or “Entire” Catalog Update ๏Critical Situations ✓ Add - to - Cart ✓ Cart ✓ Checkout

Page 10: MeetMagento 2015 - Argentina - Think Performance

Development

Configuration: Magento / Infrastructure

Page 11: MeetMagento 2015 - Argentina - Think Performance

DevelopmentConfiguration . Magento

๏Remove Unused Modules /app/etc/modules/Enterprise_Rma.xml <active>

๏Catalog Attributes & Attributes Sets ๏ Flat EAV Data

- Products - Categories

๏Merge Javascript & Css ๏Avoid, Minimize & Periodically Purge Rules

- Catalog Price Rules ➡ Backend Performance / Cache Hits / Reverse Proxy Implementations

- Shopping Cart Rules ➡ Add to Cart / Cart / Checkout

Page 12: MeetMagento 2015 - Argentina - Think Performance

DevelopmentConfiguration . Infrastructure

๏ Configure ๏ Configure

- Avoid

๏ Configure - Avoid

๏ Install a Reverse Proxy Nginx / Varnish / External Services (like Akamai)

★ Minimize Front Servers Hits, Load & Size

๏ Use ★ Improves Layer Navigation Performance & Search Results Quality

๏ Load Balancer / Multiples Front / CDN

Page 13: MeetMagento 2015 - Argentina - Think Performance

Development

Monitoring: Apps / Tools

Page 14: MeetMagento 2015 - Argentina - Think Performance

DevelopmentMonitoring . Applications

๏ Server & App Monitoring Applications

Page 15: MeetMagento 2015 - Argentina - Think Performance

DevelopmentMonitoring Tools (techniques)

๏ Front - Page Load / Rendering / Debugging ★ Dev Tools ( Google Chrome) ★ Firebug (Firefox)

๏Backend - Php:- Mysql:- Redis:

๏Backend - Magento - Magento Log - Magento Profiler

Page 16: MeetMagento 2015 - Argentina - Think Performance

Wait a minute…

Magento Profiler’s SUCKS!!!

Varien

Page 17: MeetMagento 2015 - Argentina - Think Performance

DevelopmentMonitoring Tools (techniques)

๏ Varien★ https://gist.github.com/MauroNigrele/7a76e625d815797ceb92‣ Include in: ‣ Log Profiler Data on

‣tail -f /var/log/profiler.log

‣tail -f profiler.log | grep -E ‘BLOCK|BLOCK ACTION’

‣tail -f profiler.log | grep -E ‘DISPATCH EVENT’

Page 18: MeetMagento 2015 - Argentina - Think Performance

Development

Frontend / Backend Facts

Page 19: MeetMagento 2015 - Argentina - Think Performance

DevelopmentFrontend Facts

๏Views NO Load Models/Collections YES Load Models/Collections in Blocks & Helpers NO Use HTML Comments NO Comment YES Refactor Inherited Markup when isn’t used, ie. NO Write infinite [ if > else if > else ] Statements NO Write endless [ while > for > foreach ] Loops

๏ Layouts (.xml) NO Add All CSS & JS to <default> handle YES Add CSS & JS only to needed <module_controller_action> handle YES Create Handle(s) to remove unused CSS & JS, ie. <update handle=“clean_static”/> YES Create Handle(s) to remove unused Blocks, ie. <update handle=“clean_blocks”/>

Page 20: MeetMagento 2015 - Argentina - Think Performance

DevelopmentFrontend Facts

๏ Javascript NO Use 100 jQuery Extensions for the same purposeNO Abuse of NO Define Functions inside YES Create Objects that do things instead alone global-functions YES Use id Instead classYES Extend Existing Prototype Objects (like validator.js) YES Load customer “basic” data from cookies instead php

๏ Css (and scss, less, etc) NO Use fronted renderers (javascript) for .less/.sass files YES Remove unused styles from (in RWD Theme use compass config) NO Abuse CSS3 features (box-shadow, transform etc)

๏ Take a Look https://developers.google.com/web/fundamentals/performance/

Page 21: MeetMagento 2015 - Argentina - Think Performance

DevelopmentBackend Facts

๏CachingYES Cache all YES Cache every custom block, if necessary, implement “forced” cache. YES Implements FPC in your custom controllers (EE Only) NO Trust Magento! ensure cache invalidation works well. YES Think! Performance

๏Mysql / Magento “ORM” NO Abuse ORMs Features / Events YES Check ORM generated Queries i.e. echo $collection->getSelectSql(true) NO Load Products/Categories/Customers if isn’t necessary YES Use $resource->saveAttribute() instead $model->save() (When Possible) YES Reduce unnecessary data on selects YES Use $conn->fetchPairs() when only needs pairs

Page 22: MeetMagento 2015 - Argentina - Think Performance

Gracias!!!

[email protected]

https://github.com/MauroNigrele

https://twitter.com/MauroNigrele