vaadin scalability-slides
DESCRIPTION
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.htmlTRANSCRIPT
![Page 1: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/1.jpg)
Joonas Lehtinen, PhDVaadin Ltd, CEO
Server-side RIA Scalability
![Page 2: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/2.jpg)
healthcare portal, 100 kloc of perl, .. web 1.0, netscape, ie5, ie6, ...
1998
![Page 3: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/3.jpg)
healthcare portal, 100 kloc of perl, .. web 1.0, netscape, ie5, ie6, ... object oriented design, desktop, Java, U and I ...thinking of
![Page 4: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/4.jpg)
object oriented design, desktop, Java, U and I ...thinking of
![Page 5: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/5.jpg)
object oriented design, desktop, Java, U and I ... desktop programming paradigm for web! found
![Page 6: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/6.jpg)
desktop programming paradigm for web! founded millstone ajax google web toolkit re-released as
2000
2002
2005
2008
![Page 7: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/7.jpg)
millstone ajax goolge web toolkit re-named to
2009
![Page 8: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/8.jpg)
Vaadin is a UI framework
for desktop-like web apps
![Page 9: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/9.jpg)
htmljava
![Page 10: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/10.jpg)
Vaadin valueproposition
simplerforget the web cost-effective
no JavaScript debuggingmodular
extensible ♲
powerfulall Java tools& libraries
more securecode stays in server
open sourcefree Apachelicense
![Page 11: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/11.jpg)
BUT
![Page 12: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/12.jpg)
Does Server-side RIA Scale?
![Page 13: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/13.jpg)
Server-side RIA?
![Page 14: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/14.jpg)
“Web 1.0”
DOM
Client Server
ViewHTML Page
over HttpResponse
Controller
Model
Parameters overHttpRequest
DB2
3
4
5
1
![Page 15: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/15.jpg)
Client-side RIA
DOM
Client Server
View
Controller
Model
DB2
3
4
5
1
Requested datato view as
XML / JSON
Changes to modelencoded as parameters
![Page 16: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/16.jpg)
Server-side RIA
DOM
Client Server
ViewHTML Pageover HttpResponse
Controller
Model
Parameters overHttpRequest
DB4
5
6
2
Term
inalAdapter
Term
inalAdapter
Automated bythe RIA framework
3
7
1
9
8
Handled by the framework
![Page 17: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/17.jpg)
Scale?
![Page 18: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/18.jpg)
Server-side RIA Scalability questions
Initial application download and Ajax traffic
Server-side CPUusage by the user interface logic
Server-side memory consumption per session
Top 3 Questions
![Page 19: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/19.jpg)
AnswerDepends on your application
![Page 20: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/20.jpg)
Big enough application toprove the point?
![Page 21: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/21.jpg)
Movie ticket reservationsystem
![Page 22: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/22.jpg)
Think BIG
![Page 23: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/23.jpg)
238 countries
![Page 24: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/24.jpg)
6 671 theaters
![Page 25: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/25.jpg)
70 578 rooms
![Page 26: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/26.jpg)
21 141 641 seats
![Page 27: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/27.jpg)
3 movies per night
![Page 28: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/28.jpg)
up to
320 milliontickets per month
![Page 29: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/29.jpg)
up to
35 billion! per year
![Page 30: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/30.jpg)
which exceeds total global box office sales of 30 billion USD in 2009 estimated by MPAA
![Page 31: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/31.jpg)
assume• 70% fill rate• 2 tickets per sales transaction
we should be able to handle2 593 transactions per minute on average - 24/7
![Page 32: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/32.jpg)
unfinishedproject
![Page 33: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/33.jpg)
unfinishedproject
![Page 34: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/34.jpg)
unfinishedproject
![Page 35: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/35.jpg)
How it’s made?
![Page 36: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/36.jpg)
Vaadin Framework
Business Logic
User Interface Logic
MySQL DB
![Page 37: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/37.jpg)
Business Logic
MySQL DB
countriescities
theatersshows
... rese
rvat
ions
paid
tick
ets
![Page 38: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/38.jpg)
Business Logic
Ehcache
MySQL DB
cities, ...
reservations
paidtickets
cities, ...
![Page 39: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/39.jpg)
Vaadin Framework
Business Logic
User Interface Logic
Ehcache
MySQL DB
![Page 40: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/40.jpg)
Vaadin Framework
Business Logic
User Interface Logic
Ehcache
MySQL DB
Apache Tomcat
![Page 41: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/41.jpg)
Vaadin
Logic
UI
Ehcache
MySQL DB
Tomcat
Vaadin
Logic
UI
Ehcache
Tomcat
Vaadin
Logic
UI
Ehcache
Tomcat
![Page 42: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/42.jpg)
Tomcat Tomcat Tomcat
MySQL
ELB
EBS EBS
EC2-Large• 7.5GB mem• 2 CPU cores• $0.34 / hour
EC2-Large• 7.5GB mem• 2 CPU cores• $0.34 / hour
EC2-Large• 7.5GB mem• 2 CPU cores• $0.34 / hour
EC2-Large• $0.34 / hour
![Page 43: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/43.jpg)
Benchmarking
![Page 44: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/44.jpg)
Test Tomcat Tomcat
MySQL
ELB
EBS EBS
EC2-Large• 7.5GB mem• 2 CPU cores• $0.34 / hour
EC2-Large• 7.5GB mem• 2 CPU cores• $0.34 / hour
EC2-Large• 7.5GB mem• 2 CPU cores• $0.34 / hour
EC2-Large• $0.34 / hour
![Page 45: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/45.jpg)
Test Tomcat Tomcat
ELB
HTMLUnit
Rhino DOM
Custom Test App
JVM
![Page 46: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/46.jpg)
Test Tomcat Tomcat
ELB
Custom Test App
#100
![Page 47: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/47.jpg)
Custom Test App
#100
EC2-XL (7GB, 8 cores)
Test Tomcat Tomcat
ELB
Custom Test App
#100
![Page 48: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/48.jpg)
Custom Test App
#100
EC2-XL (7GB, 8 cores)
Test Tomcat Tomcat
ELB
Custom Test App
#100
EC2-XL
![Page 49: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/49.jpg)
Results
work in
progress
![Page 50: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/50.jpg)
10 XL Test Servers1 Large Tomcat1 MySQL(UI Only Test)
![Page 51: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/51.jpg)
10 XL Test Servers1 Large Tomcat1 MySQL(UI Only Test)
![Page 52: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/52.jpg)
1 XL Test Servers2 JVMs (200 threads)1 Large Tomcat1 MySQL(UI Only Test)
![Page 53: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/53.jpg)
start setup ajax finished
![Page 54: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/54.jpg)
10 XL Test Servers (2000 clients)1 Large Tomcat
1 MySQL(UI Only Test)
JVM GC Pause
![Page 55: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/55.jpg)
HTTP-level Benchmark
work in
progress
![Page 56: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/56.jpg)
Test Tomcat Tomcat
MySQL
ELB
EBS EBS
EC2-Large• 7.5GB mem• 2 CPU cores• $0.34 / hour
EC2-Large• 7.5GB mem• 2 CPU cores• $0.34 / hour
EC2-Large• 7.5GB mem• 2 CPU cores• $0.34 / hour
EC2-Large• $0.34 / hour
![Page 57: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/57.jpg)
Test Tomcat Tomcat
ELB
Apache JMetertestrecording
![Page 58: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/58.jpg)
Test Tomcat Tomcat
ELB
testrecordingApache JMeter
![Page 59: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/59.jpg)
Scenarios per minute
One Tomcat
0
400
800
1200
1600
2000
Sales / Minute0
30
60
90
120
150
Avg response (ms)100 500 1500 2000 3000
Average ajax response (ms)
Concurrent simulated users users
![Page 60: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/60.jpg)
Server load
Tomcat JMeter
![Page 61: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/61.jpg)
Server load
Tomcat
3000 simulatedconcurrent users
![Page 62: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/62.jpg)
Guesstimates
![Page 63: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/63.jpg)
assume• 2 593 sales transactions per minute• 50% of the visitors buy tickets• session takes 5 minutes in average
we should be able to handle25 930 concurrent userson average - 24/7
![Page 64: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/64.jpg)
Resource requirements?
![Page 65: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/65.jpg)
measured session size 188kb
tomcat memoryreq. ~6-8GB
![Page 66: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/66.jpg)
network traffic / session ~200kb
1GB / minute500 TB / year
![Page 67: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/67.jpg)
Expected hosting costs?
![Page 68: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/68.jpg)
Servers
Elastic Block Store (4 x 50GB)$240 / year
10 x Tomcat Server (EC2-Large)$14920 / year (reserved instance)
2 x MySQL Server (EC2-Large)$2984 / year (reserved instance)
Total $18144 / year
![Page 69: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/69.jpg)
Network
Elastic Load Balancing$4216 / year
500TB traffic$55000 / year
Total $59216 / year
![Page 70: Vaadin scalability-slides](https://reader033.vdocuments.site/reader033/viewer/2022052900/55632e63d8b42a57348b5300/html5/thumbnails/70.jpg)
Total hosting costs
Hosting costs are 0.00016% of the QuickTickets sales
$20 per million tickets sold
Total hosting costs: $77360 / year