Vaadin scalability-slides

17,039 views
16,819 views

Published on

Joonas Lehtinen,

Lisätietoa aamiaistilaisuudesta jossa nämä kalvot on esitetty sekä esitysten videot löytyvät osoitteesta http://www.codento.com/fi/events/2010-06.html

Published in: Technology, Education
1 Comment
26 Likes
Statistics
Notes
No Downloads
Views
Total views
17,039
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
329
Comments
1
Likes
26
Embeds 0
No embeds

No notes for slide

Vaadin scalability-slides

  1. 1. Server-side RIA Scalability Joonas Lehtinen, PhD Vaadin Ltd, CEO
  2. 2. healthcare portal, 100 kloc of perl, .. 89 19
  3. 3. web 1.0, netscape, ie5, ie6, ...
  4. 4. thinking of object oriented design, desktop, Java, U and I ...
  5. 5. desktop programming paradigm for web!
  6. 6. founded millstone ajax google web toolkit 00 08 02 05 20 20 20 20
  7. 7. re-named to 09 20
  8. 8. Vaadin is a UI framework for desktop-like web apps
  9. 9. java html
  10. 10. more secure code stays in server powerful open source all Java tools free Apache & libraries license Vaadin value proposition simpler forget the web cost-effective no JavaScript modular debugging extensible ♲
  11. 11. BUT
  12. 12. Does Server- side RIA Scale?
  13. 13. Server-side RIA?
  14. 14. “Web 1.0” Client 5 Server HTML Page DOM over HttpResponse View 4 3 Model Parameters over HttpRequest Controller 2 DB 1
  15. 15. Client-side RIA Client 4 Server Requested data View to view as XML / JSON 5 DOM Model 3 1 Changes to model Controller encoded as parameters DB 2
  16. 16. Server-side RIA Client 8 Server 9 7 TerminalAdapter TerminalAdapter HTML Page over HttpResponse View 6 Automated by 5 DOM the RIA framework Model Handled by the framework Parameters over HttpRequest Controller 1 4 3 DB 2
  17. 17. Scale?
  18. 18. Top 3 Questions Server-side memory consumption per session Server-side RIA Scalability Server-side CPU usage by the user questions interface logic Initial application download and Ajax traffic
  19. 19. Answer Depends on your application
  20. 20. Big enough application to prove the point?
  21. 21. Movie ticket reservation system
  22. 22. Think BIG
  23. 23. 238 countries
  24. 24. 6 671 theaters
  25. 25. 70 578 rooms
  26. 26. 21 141 641 seats
  27. 27. 3 movies per night
  28. 28. up to 320 million tickets per month
  29. 29. up to 35 billion € per year
  30. 30. which exceeds total global box office sales of 30 billion USD in 2009 estimated by MPAA
  31. 31. assume • 70% fill rate • 2 tickets per sales transaction we should be able to handle 2 593 transactions per minute on average - 24/7
  32. 32. unfi nis pro hed jec t
  33. 33. unfi nis pro hed jec t
  34. 34. unfi nis pro hed jec t
  35. 35. How it’s made?
  36. 36. Vaadin Framework User Interface Logic Business Logic MySQL DB
  37. 37. Business Logic paid tickets reservations countries cities theaters shows ... MySQL DB
  38. 38. Business Logic reservations cities, ... paid Ehcache tickets cities, ... MySQL DB
  39. 39. Vaadin Framework User Interface Logic Business Logic Ehcache MySQL DB
  40. 40. Apache Tomcat Vaadin Framework User Interface Logic Business Logic Ehcache MySQL DB
  41. 41. Tomcat Tomcat Tomcat Vaadin Vaadin Vaadin UI UI UI Logic Logic Logic Ehcache Ehcache Ehcache MySQL DB
  42. 42. ELB Tomcat Tomcat Tomcat EC2-Large EC2-Large EC2-Large • 7.5GB mem • 7.5GB mem • 7.5GB mem • 2 CPU cores • 2 CPU cores • 2 CPU cores • $0.34 / hour • $0.34 / hour • $0.34 / hour MySQL EC2-Large • $0.34 / hour EBS EBS
  43. 43. Benchmarking
  44. 44. ELB Test Tomcat Tomcat EC2-Large EC2-Large EC2-Large • 7.5GB mem • 7.5GB mem • 7.5GB mem • 2 CPU cores • 2 CPU cores • 2 CPU cores • $0.34 / hour • $0.34 / hour • $0.34 / hour MySQL EC2-Large • $0.34 / hour EBS EBS
  45. 45. JVM Custom Test App HTMLUnit Rhino DOM ELB
  46. 46. Custom Test App #100 ELB
  47. 47. EC2-XL (7GB, 8 cores) Custom Test App #100 Custom Test App #100 ELB
  48. 48. EC2-XL (7GB, 8 cores) EC2-XL Custom Test App #100 Custom Test App #100 ELB
  49. 49. Results in o rk s w res ro g p
  50. 50. 10 XL Test Servers 1 Large Tomcat 1 MySQL (UI Only Test)
  51. 51. 10 XL Test Servers 1 Large Tomcat 1 MySQL (UI Only Test)
  52. 52. 1 XL Test Servers 2 JVMs (200 threads) 1 Large Tomcat 1 MySQL (UI Only Test)
  53. 53. start setup ajax finished
  54. 54. 10 XL Test Servers (2000 clients) 1 Large Tomcat 1 MySQL (UI Only Test) JVM GC Pause
  55. 55. HTTP-level Benchmark in o rk s w res ro g p
  56. 56. ELB Test Tomcat Tomcat EC2-Large EC2-Large EC2-Large • 7.5GB mem • 7.5GB mem • 7.5GB mem • 2 CPU cores • 2 CPU cores • 2 CPU cores • $0.34 / hour • $0.34 / hour • $0.34 / hour MySQL EC2-Large • $0.34 / hour EBS EBS
  57. 57. test Apache JMeter recording ELB
  58. 58. test Apache JMeter recording ELB
  59. 59. One Tomcat Scenarios per minute Average ajax response (ms) 2000 150 1600 120 1200 90 800 60 400 30 0 0 Sales / Minute Avg response (ms) 100 500 1500 2000 3000 Concurrent simulated users users
  60. 60. Server load Tomcat JMeter
  61. 61. Server load 3000 simulated concurrent users Tomcat
  62. 62. Guesstimates
  63. 63. assume • 2 593 sales transactions per minute • 50% of the visitors buy tickets • session takes 5 minutes in average we should be able to handle 25 930 concurrent users on average - 24/7
  64. 64. Resource requirements?
  65. 65. measured session size 188kb tomcat memory req. ~6-8GB
  66. 66. network traffic / session ~200kb 1GB / minute 500 TB / year
  67. 67. Expected hosting costs?
  68. 68. Servers 2 x MySQL Server (EC2-Large) $2984 / year (reserved instance) 10 x Tomcat Server (EC2-Large) $14920 / year (reserved instance) Elastic Block Store (4 x 50GB) $240 / year Total $18144 / year
  69. 69. Network 500TB traffic $55000 / year Elastic Load Balancing $4216 / year Total $59216 / year
  70. 70. Total hosting costs Total hosting costs: $77360 / year $20 per million tickets sold Hosting costs are 0.00016% of the QuickTickets sales
  71. 71. Questions Comments joon as@vaadin.com +358-40-5035001 sky pe://joonaslehtinen

×