Upload
mauro-nigrele
View
359
Download
0
Embed Size (px)
Citation preview
3 Diciembre 2015 . Buenos Aires . Argentina
Think! PerformanceMauro Nigrele
Aboutme
Mauro Nigrele
๏ Arquitecto IT en Lyracons • Php & MySql - 2004 • Zend Framework - 2008 • Magento - 2010 • Magento Certified Dev Plus - 2012 • Obsesivo, Inquieto, Molesto
Tuning
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“
AboutTuning
“ … Si solo nos preocupáramos por ‘tunear’ servers lo único que
obtendríamos sería… “Juan Carlos Sarlanga . 1883
Alta llanta!
Evaluation
Features, Catalog, Integrations
EvaluationFeatures
๏ Features Magento (Factory Modules) ๏ Features Custom ✓ To Build ✓ 3rd Party Modules
๏Custom Data on Frontend (views)
EvaluationCatalog
๏Product Attributes Sets ๏Product Attributes
✓ Search
✓ Filter (Layer)
✓ Listing (show in product listing)
EvaluationIntegrations
๏ Frequency ๏Relevance ๏ “News” or “Entire” Catalog Update ๏Critical Situations ✓ Add - to - Cart ✓ Cart ✓ Checkout
Development
Configuration: Magento / Infrastructure
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
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
Development
Monitoring: Apps / Tools
DevelopmentMonitoring . Applications
๏ Server & App Monitoring Applications
DevelopmentMonitoring Tools (techniques)
๏ Front - Page Load / Rendering / Debugging ★ Dev Tools ( Google Chrome) ★ Firebug (Firefox)
๏Backend - Php:- Mysql:- Redis:
๏Backend - Magento - Magento Log - Magento Profiler
Wait a minute…
Magento Profiler’s SUCKS!!!
Varien
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’
Development
Frontend / Backend Facts
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”/>
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/
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
Gracias!!!
https://github.com/MauroNigrele
https://twitter.com/MauroNigrele