performance optimisation - scaling a hobby project to serious business

53
1 Performance op,miza,on: scaling a hobby project to serious business SPELIX.AT web based cave management

Upload: harald-zeitlhofer

Post on 07-Dec-2014

259 views

Category:

Technology


0 download

DESCRIPTION

We can not always start a new project from scratch and choose the right architecture and framework to guarantee scalability and performance, sometimes we have to deal with existing and grown systems. Here I'll show you our findings when we analyzed spelix.at, a web based system for cave management. The hotspots that we identified can be found in various systems all over the world.

TRANSCRIPT

Page 1: Performance optimisation - scaling a hobby project to serious business

1  1  

Performance  op,miza,on:  scaling  a  hobby  project  to  serious  business  SPELIX.AT  

web  based  cave  management  

Page 2: Performance optimisation - scaling a hobby project to serious business

Let me take you onto a short journey …

Page 3: Performance optimisation - scaling a hobby project to serious business

3   COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE

… into a world below us …

Page 4: Performance optimisation - scaling a hobby project to serious business

4   COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE

… full of mystery …

Page 5: Performance optimisation - scaling a hobby project to serious business

5   COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE

… full of surprise …

Page 6: Performance optimisation - scaling a hobby project to serious business

6   COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE

… full of secrets …

Page 7: Performance optimisation - scaling a hobby project to serious business

7   COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE

A world to be discovered

Page 8: Performance optimisation - scaling a hobby project to serious business

8   COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE

To be explored

Page 9: Performance optimisation - scaling a hobby project to serious business

9  9  

our  history  in  digital  cave  management  

• 1989:  first  PC  version:  survey  data  analysis,  simple  list  generator  

• 1996:  database  version  based  on  MS  Access:  master  data,  tour  reports,  extended  lists,  data  export  

• challenge:  mulM  user  capability  

• Import  /  export  files  distributed  via  email  /  disc  

• MySQL  database  on  webserver  ODBC  client/server  connecMons  

• Originally  intended  for  1  (our)  caving  club  (Linz)  • IntegraMon  of  the  HallstaX  club  • 2006:  consideraMons  within  the  caver’s  associaMon  in  Austria  to  use  a  web  database  as  the  base  for  the  Austrian  cave  directory  

Page 10: Performance optimisation - scaling a hobby project to serious business

10  10  

Spelix  1.0  

• 2008:  Web  frontend  • HTML  /  JavaScript  • Server:  LAMP  

Page 11: Performance optimisation - scaling a hobby project to serious business

11  11  

Spelix  2.0  

• Map  based  UI  (Google  Maps  API)  • Extended  funMonality  • Trip  reporMng  • Survey  data  editor  

Page 12: Performance optimisation - scaling a hobby project to serious business

12  12  

a  growing  community  

• Established  as  the  Austrian  cave  directory  

• Most  clubs  in  Austria  have  accounts  (2012:  120)  

• Inquiry  from  Germany  to  use  Spelix  for  “Schwäbische  Alb”    

• Workshops,  trainings  

• Special  feature  requests  • Changing  workflows  • More  and  more  user  complaints  

• Complaints  regarding  performance  

• More  developers  !!!    

 

Time for a new major version ?

Page 13: Performance optimisation - scaling a hobby project to serious business

13  13  

Analyzing  Spelix  2.0  

Performance ! Are we able to

onboard more users ?

Page 14: Performance optimisation - scaling a hobby project to serious business

14  14  

From  the  user’s  perspec,ve  

So  what  does  that  mean  in  detail  ?  

Page 15: Performance optimisation - scaling a hobby project to serious business

15  15  

networking  

• Create  container  files  for  CSS  and  JS  • Use  sprites  for  icons  

HTTP Redirects

Page 16: Performance optimisation - scaling a hobby project to serious business

16  16  

Java  Script  

• showCave  is  the  hotspot  in  Java  Script  

Page 17: Performance optimisation - scaling a hobby project to serious business

17  17  

server  contribu,on  

• ‘getcaves’  is  our  server  side  hotspot  

Page 18: Performance optimisation - scaling a hobby project to serious business

18  18  

Server  side  transac,on  details  

• Always  load  complete  list  of  cave  groups  

• Always  load  complete  list  of  caves  for  selected  group  

• =>  lack  of  data  caching  

Page 19: Performance optimisation - scaling a hobby project to serious business

19  19  

digging  into  getCaves…  

Time  to  check  the  database  !  

Page 20: Performance optimisation - scaling a hobby project to serious business

20  20  

Database  execu,on  plan  

Review  and  tune  database  views  !  

Page 21: Performance optimisation - scaling a hobby project to serious business

21  21  

What  about  single  record  pages  ?  

Page 22: Performance optimisation - scaling a hobby project to serious business

22  22  

Hotspot  tour  reports  

Page 23: Performance optimisation - scaling a hobby project to serious business

23  23  

Considera,ons  for  a  new  version  

• Improve  user  experience  measures  • Scale  system  for  extended  user  community  

• Flexible  data  structure  • MulMmedia  integraMon  

• Mobile  environment  

• Development  environment  

• Google  API  V2  disconMnued  

Page 24: Performance optimisation - scaling a hobby project to serious business

24  24  

Spelix  3  

• New  map  window  (Leaflet  API)  • Map  based  logic  

• Mobile  capability  

• Local  data  storage  • Restructured  database  • GPS  integraMon  • Enhanced  document  management  

Page 25: Performance optimisation - scaling a hobby project to serious business

25  25  

First  impression  

• Looks  beXer  • Network:  sMll  too  many  roundtrips  (css,  js,  images)  • JavaScript:  well,  there  is  a  lot  to  do  on  the  page…  

Page 26: Performance optimisation - scaling a hobby project to serious business

26  26  

User  experience  

Let’s roll up our sleeves…

Page 27: Performance optimisation - scaling a hobby project to serious business

27  27  

Session  cache  

• select  *  from  sys2:    read  user  preferences  from  DB  

• Store  record  in    $_SESSION  

Page 28: Performance optimisation - scaling a hobby project to serious business

28  28  

Start  page  execu,on  plan  

Page 29: Performance optimisation - scaling a hobby project to serious business

29  29  

Usage  of  external  libraries  

Method invocations for /

Method invocations including Spyc

Page 30: Performance optimisation - scaling a hobby project to serious business

30  30  

AJAX  calls  from  main  page  

• /katgrp/browse:  784.59ms  • /cave/browse/gis/$/katgrp/1626:  779.92ms  

• /katgrp/get/$/1626:  762.25ms££  

Page 31: Performance optimisation - scaling a hobby project to serious business

31  31  

/katgrp/browse  

Page 32: Performance optimisation - scaling a hobby project to serious business

32  32  

/cave/browse/gis/$/katgrp/1626  

Page 33: Performance optimisation - scaling a hobby project to serious business

33  33  

/katgrp/get/$/1626  

Page 34: Performance optimisation - scaling a hobby project to serious business

34  34  

Back  to  /cave/browse/gis/$/katgrp/1626  

Page 35: Performance optimisation - scaling a hobby project to serious business

35  35  

Sessions  in  PHP  

• session_start()  locks  the  file  where  session  data  are  stored  

• Released  when  script  ends  • Use  session_write_close()  to  unlock  the  file  before  execuMng  slower  code  

• Or  create  your  own    save  handler  with    session_set_save_handler()  

Page 36: Performance optimisation - scaling a hobby project to serious business

36  36  

Looks  beWer  now…  

Page 37: Performance optimisation - scaling a hobby project to serious business

37  37  

But  …  

• Cave  groups  are  currently  not  held  in  LocalStorage  L  • However  –  what  is  the  server  doing  ?  

Page 38: Performance optimisation - scaling a hobby project to serious business

38  38  

/katgrp/browse  server  side  execu,on  

And  again  it’s  Mme  to    check  the  database  !  

Page 39: Performance optimisation - scaling a hobby project to serious business

39  39  

From  the  DB  perspec,ve  

Page 40: Performance optimisation - scaling a hobby project to serious business

40  40  

We’re  geXng  there…  

• Cave  groups  are  sMll  not  held  in  LocalStorage  L  • But  this  does  not  get  worse  with  more  data  

Page 41: Performance optimisation - scaling a hobby project to serious business

41  41  

Monitoring  the  system  

Page 42: Performance optimisation - scaling a hobby project to serious business

42  42  

Monitoring  ac,vity  

Page 43: Performance optimisation - scaling a hobby project to serious business

43  43  

User  ac,ons  

Page 44: Performance optimisation - scaling a hobby project to serious business

44  44  

Cave  group  access  

Page 45: Performance optimisation - scaling a hobby project to serious business

45  45  

Cave  access  

Page 46: Performance optimisation - scaling a hobby project to serious business

46  46  

A  cave  informa,on  system  ready  for  the  future  

Page 47: Performance optimisation - scaling a hobby project to serious business

47  47  

allowing  us  to  do  what  we  actually  want  to  do…  

Page 48: Performance optimisation - scaling a hobby project to serious business

48  48  

to  document  our  work…  

Page 49: Performance optimisation - scaling a hobby project to serious business

49  49  

to  visualize  our  results  …  

Page 50: Performance optimisation - scaling a hobby project to serious business

50  50  

and  leaving  us  ,me  for  other  important  du,es  aZer  returning  from  the  cave…    

Page 51: Performance optimisation - scaling a hobby project to serious business

51  51  

More  Informa,on,  free  products  

• [email protected]  • @HZeitlhofer  

 

• dynaTrace  Enterprise  –  Full  End-­‐to-­‐End  Visibility  in  your  PHP,  Java,  .NET  Apps  –  Sign  up  for  a  15  Days  Free  Trial  on  hXp://compuwareapm.com    

 

• dynaTrace  AJAX  Edi=on  –  Browser  DiagnosMcs  for  IE  +  FF  –  Free  Download  @  hXp://ajax.dynatrace.com    

• Blog:  hXp://apmblog.compuware.com  

• Caving  in  Austria:  hXp://www.hoehlenforschung.at  

Page 52: Performance optimisation - scaling a hobby project to serious business

52  © 2011 Compuware Corporation — All Rights Reserved © 2011 Compuware Corporation — All Rights Reserved

52

ParMcipate  in  Compuware  APM    Discussion  Forums  apmcommunity.compuware.com  

Like  us  on  Facebook  facebook.com/CompuwareAPM  

Join  our  LinkedIn  group  Compuware  APM  User  Group  

Follow  us  on  TwiWer  twiXer.com/CompuwareAPM  

Read  our  Blog  hXp://apmblog.compuware.com    

Watch  our  Videos  &    product  Demos  youtube.com/Compuware  

www.compuware.com/APM  

Thank You

Page 53: Performance optimisation - scaling a hobby project to serious business

53  © 2011 Compuware Corporation — All Rights Reserved © 2011 Compuware Corporation — All Rights Reserved

53