magento performancenbs
TRANSCRIPT
1
E-commerce is also about
Magento server & environment optimizationGet very fast page rendering, even under heavy load !
© NBS System 2011, all right reserved Managed Hosting & Security www.nbs-system.com
33
“The what”
Why Speeding up ? How to measure what really count ? What contribute to load time ? Why Magento is resource Hungry ?
4
► So many figures to paste here… Akamai & Forrester : 5 seconds to load, 20% of people bailing out Shopzilla raised its revenues of ~10% by stepping down from 7s to 2s loadtime Yahoo : +400 ms, 5 to 9% traffic loss and Google : +500 ms, -20% traffic Amazon : +100 ms, -1% sales Interrogated users claims that 2 seconds is fair, 4s is too much 52% of visitors consider speed an essential criteria for returning to a site In 2010, 75% of visitors won’t come back if the site is slow (64% in 2006) Speed directly influence your SEO & SEM efficiency 60% of visitors go away if a page load in more than 6 seconds on vid.stream…
Speeding up is not an option, it is a major key to success.
Why speeding up ?
5
Speed, seen by Google
►Google is also using speed as an important ranking factor (it’s official)
► Graph (given by Google) show clearly the target: 1.5s► More and you are part of the red team called « SLOW »► This is not good for your SEO ranking and SEM efficiency► Relevance is still more important but… Don’t you have competitors ?
Our goal is now clear : load in less than 1.5 second
6
What contribute to load time ?
This and, of course, network transfers.
8
Why Magento is resource hungry ?
► Large features panel & flexibility comes at a price► Do it in assembler, it will be fast and you’ll become crazy► The use of OOP language & framework help to work faster► PHP is still an interpreted language (Vs Compiled one)► Magento is a kind of “meta” framework► The EAV model gave a lot of flexibility to the catalog but is costly
Give me CPU & RAM and you’ll be able to use a framework instead of coding all by yourself
99
Benchmark
Apdex Funkload Yslow, Pagespeed & Gtmetrix Realistic goals to reach
10
Benchmarking : APDEX
► APDEX is the key to “user oriented” benchmarks
► When you reach a 0,85 APDEX index, your server is loaded but responsive, it’s a fair “deal”
► 4 levels for user experience (like your girlfriend, except for the timings) :
o Satisfied (for exemple less than a second)o Tolerating (from 1 second to 4 seconds)o Frustrated (more than 4 seconds)o Inacceptable (not served/errors)
U
P
FGE
1,000,94
0,85
0,70
0,50
0,00
APDEX =T Total samples
Satisfied count + Tolerating count
2
12
Measuring with Yslow & Pagespeed
► Yslow & Pagespeed are Firefox extensions to check your optims► www.gtmetrix.com does it directly through a site (thus 4 all browsers)► Reaching more than 90% is not easy, a default demostore, on a default
serveur (no optim) scores C/C (76/72%) and takes ~3,1s to load.
► Those two performance rule set are among the most complete► Respecting all rules will grant you a serious SEO & perfs boost
It is mainly not Magento’s task to take care of this but your hosting company should !
13
What is a realistic goal ?
► Less than 0,9 seconds to (fully) load the homepage► 45 ms to get the home and start downloading the static files► Grade A/A on Yslow & Pagespeed► Deliver massive parallelizing and caching capability► Serving up to 200 simultaneous actions (~50 000 Uniq visitor / day)
per front web servers with a Community Edition► Serving up to 300 simultaneous actions on a Enterprise Edition (FPC)
This is not a dream, this is called engineering & optimization
I have a dream…
1414
Architecture
The performances booby traps Where to act ? Sizing your architecture
http://fr.fotolia.com/id/7005820
15
The performances booby traps
► Leave some 404► Forget to activate Bloc Caching► Badly coded Crons► “Cold cache” effect► Load a lot of products/categories on the Home► Let the Log database be overcrowded► Foreign includes► Misconfiguring Magento’s cache setting► Conception errors (like real time sliders)► Hard disk access, nothing worse
Usually it’s the small errors, the temporary fix, that wreck havoc
16
Where to act
More than 16 points to act
on, it’s no small duty.
Minify
CSS3
Sprite
SolR
Integration / Extension
EtagsExpire
Alt httpd
Alt PhpRamdis
ks
Opcode
caching
Webserver
Mysql tunin
g
Linux
tuningMagento
tuning
Apache
tuning
Tuning / Settings
MemcachedCDN
Rproxy
Split web/D
B
Environment
17
Sizing your architecture
Large Extra LargeSmall Medium
MutualizedVirtualized0 to 2000 UV/d
Dedicated, Separate W/DB~30 000 UV/d
Dual DatacenterLoad balanced~80 000 UV/d
UV/d = Uniq Visitor per Day
Dual DatacenterCDN + Cloud for pikes> 100 000 UV/d
1818
Optimization
Standard optimization tricks Advanced optimization tricks Top optimization tricks Nitrogento
19
Standard optimization tricks
► Split front & DB► Activate Flat catalog► Use Enterprise Edition (full page cache)► Activate Mage_optimizer► Use SOLR for large catalog► Opcode caching system (APC, Zend, Eaccel etc.)► Activate caching in back office (and check that code calls it)► Minify & compress JS & CSS files (Nitrogento does it)► Tweak your apache config (Use Etags, Expire headers, Gzip)
Simple but yet efficient.
20
Advanced optimization
► Fine tune your Linux Setup► Put cache & sessions files on ramdisks► Split Front / Back Office instances► Use IRQ Balancing► Mount disk with noatime option ► Lower socket Wait Timeout in /proc► Add a reverse proxy (Nginx or Varnish for example)► CDN get resources from many different CNAMES► Truncate (or archive) your log tables in Magento► Check foreign includes response times and put them at the end
A bit tricky but will help.
21
Advanced optimization : Focus CDN
CDN / media servers are good for load time.8 resources, then the next 8 resources, etc…
8 resources per servers, 32 resources in one run !
22
Top tricks
► CSS3► HTML5► Progressive degradation► Sprites► Deactivate atime► Tune up your DB► Try Nginx + PHP FPM (warning, no htaccess support)► Use DRBD to link two servers (blockdevice across network)► Latest Memcached + memcache client => flush the old cache keys
Get the most out of the technology, fine tune, upgrade to latest, enjoy !
23
Top tricks
► Extend to Cloud► Hybrid your physical servers with a Cloud will optimize your costs
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 230
2000
4000
6000
8000
10000
12000
14000
16000 Visits per hour, Servers are taking blue load, Cloud light blue
CloudArchitecture
Hour ranges
Peop
le c
onne
cted
24
► This Magento extension provide : Standard & Custom bloc caching (even if not called in code) Automated Sprite generation Gathering & Minifying of your JS / CSS files Gzip / Etags / Expire header configuration Automatically deploy your static files to CDN (& patch themes files) Reduce http requests numbers Learning mode to help
Nitrogento provide all needed Optimizations in one extension !
þþþþþþ
25
► On a Demostore with Nitrogento : Homepage load time falls to 0,05s to get the main file Static resources are fetched in one time (reducing DL time, 2 times faster) Your pages make 20 or more less HTTP requests You transfer 20% less content (zipping) Your customer use their browser cache more efficiently Lower pressure on your servers & bandwidth
Before
After
Results are … plainly amazing and you will all be able to test !
26
Thank you for your attention !
Need (fast) Magento managed hosting ?
www.nbs-system.com (soon available in English)Telephone : +33.1.58.56.60.86Mail : [email protected]
France USA Asia Spain Switzerland
Our skills are now available in :