32
22. September 2015 Harald Zeitlhofer, Dynatrace [email protected] @HZeitlhofer Improve Magento Performance To Drive Higher Conversions

Improve Magento Performance

Embed Size (px)

Citation preview

Page 1: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 1

22.  September  2015  

Harald  Zeitlhofer,  Dynatrace    

[email protected]  @HZeitlhofer  

Improve  Magento  Performance  To  Drive  Higher  Conversions    

Page 2: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 2

Page 3: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 3

• Major  problem  in  November  2014  • Magento  Shop  was  actually  too  slow!  

• Infrastructure  was  very  limited  at  that  Lme  

• Scale  Infrastructure  ?  • Get  external  advice  • The  real  problems  were  hidden  that  Lme  

Performance  threatens  goals  

Page 4: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 4

lessc  CSS  pre-­‐processor  

social  login  module  

PHP  execuLon  was  really  

slow  

during  the  first  analysis  session  we  iden2fied  

Page 5: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 5

average contribution of PHP compilation time

Slow  PHP  execuLon  

Page 6: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 6

PHP compilation time could be reduced considerably just by using PHP 5.5 + Opcache!

ARer  update  to  PHP  5.5  

Page 7: Improve Magento Performance

use  latest  versions  of  used  technology  

Page 8: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 8

PHP execution presented a major global bottleneck

for page load times

Performance  hotspot:  PHP  execuLon  

Page 9: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 9

less  CSS  preprocessor  

Page 10: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 10

less  CSS  preprocessor  

Page 11: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 11

errors  in  PHP  execuLon  

Page 12: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 12

server-side calls to unused external services

Social  Login  Modul  

Page 13: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 13

Using  external  services  

performance  hotspot  /en/externalprice/  

Page 14: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 14

response  Lme    hotspot  PHP  

Page 15: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 15

slow  SAP  connector  ?  

Page 16: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 16

session  data  locking  

response  Lme  hotspot:  usleep();  

Page 17: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 17

• CM_RedisSession  uses  usleep()  in  locking  logic  

•  session_start()  locks  session  file  • only  lock  if  required  •  session_write_close()  releases  lock  

PHP  session  locking  

Page 18: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 18

• New  feature:  show  stock  and  leadLmes  

• Calculated  on-­‐the-­‐fly  • Very  bad  performance  impact  

Inhouse  development  

• Design  change:  pre  calculate  and  cache  • Workflow  change:  test  automaLon  including  performance  tests  

Page 19: Improve Magento Performance

know  your  code    

know  your  external  libraries    

evaluate  carefully  before  using  

Page 20: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 20

Page 21: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 21

Modern  Web  Pages:  lots  of  staLc  content  

434  Resources  in  total  on  that  page:  230  JPEGs,  75  PNGs,  50  GIFs,  …  

more  than  20MB  page  size  

Page 22: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 22

Not  following  Web  Performance  Best  PracLces   282!  Objects  on  that  page  9.68MB  Page  Size  

8.8s  Page  Load  Time  

Most  objects  are  images  delivered  from  the    

main  domain  

Very  long  connect  Lme  (1.8s)  to  the  CDN  

Page 23: Improve Magento Performance

use  proper  caching    

pack  JS,  CSS    

use  sprite  for  images    

use  CDNs  

Page 24: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 24

cached  content  

sLll  creates  roundtrips  !  

Page 25: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 25

Original  Web  Request  handling  

Page 26: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 26

New  Web  Request  handling  

Page 27: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 27

more information: http://apmblog.dynatrace.com/2014/10/30/proper-configuration-running-php-nginx/ http://www.slideshare.net/HaraldZeitlhofer/php-conference-berlin-2015-running-php-on-nginx

NGINX  

Page 28: Improve Magento Performance

use  proper  server  tools  

Page 29: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 29

Status  Quo  

•  Infrastructure  has  changed  significantly  • New  design  and  review  process  • Test  automaLon  with    performance  tests  

Page 30: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 30

CharLng  data  in    business  dashboards  

Page 31: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 31

PosiLve  impact  on  conversion  rate  

Page 32: Improve Magento Performance

COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE 32

www.dynatrace.com  

Thank you !!!

Harald  Zeitlhofer  Performance  Advocate  #HZeitlhofer  [email protected]  hmp://blog.dyntrace.com  

Dynatrace  Free  Trial:    hmp://bit.ly/dmrial