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
Joonas Lehtinen, PhDVaadin Ltd, CEO
Server-side RIA Scalability
healthcare portal, 100 kloc of perl, .. web 1.0, netscape, ie5, ie6, ...
1998
healthcare portal, 100 kloc of perl, .. web 1.0, netscape, ie5, ie6, ... object oriented design, desktop, Java, U and I ...thinking of
object oriented design, desktop, Java, U and I ...thinking of
object oriented design, desktop, Java, U and I ... desktop programming paradigm for web! found
desktop programming paradigm for web! founded millstone ajax google web toolkit re-released as
2000
2002
2005
2008
millstone ajax goolge web toolkit re-named to
2009
Vaadin is a UI framework
for desktop-like web apps
htmljava
Vaadin valueproposition
simplerforget the web cost-effective
no JavaScript debuggingmodular
extensible ♲
powerfulall Java tools& libraries
more securecode stays in server
open sourcefree Apachelicense
BUT
Does Server-side RIA Scale?
Server-side RIA?
“Web 1.0”
DOM
Client Server
ViewHTML Page
over HttpResponse
Controller
Model
Parameters overHttpRequest
DB2
3
4
5
1
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
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
Scale?
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
AnswerDepends on your application
Big enough application toprove the point?
Movie ticket reservationsystem
Think BIG
238 countries
6 671 theaters
70 578 rooms
21 141 641 seats
3 movies per night
up to
320 milliontickets per month
up to
35 billion! per year
which exceeds total global box office sales of 30 billion USD in 2009 estimated by MPAA
assume• 70% fill rate• 2 tickets per sales transaction
we should be able to handle2 593 transactions per minute on average - 24/7
unfinishedproject
unfinishedproject
unfinishedproject
How it’s made?
Vaadin Framework
Business Logic
User Interface Logic
MySQL DB
Business Logic
MySQL DB
countriescities
theatersshows
... rese
rvat
ions
paid
tick
ets
Business Logic
Ehcache
MySQL DB
cities, ...
reservations
paidtickets
cities, ...
Vaadin Framework
Business Logic
User Interface Logic
Ehcache
MySQL DB
Vaadin Framework
Business Logic
User Interface Logic
Ehcache
MySQL DB
Apache Tomcat
Vaadin
Logic
UI
Ehcache
MySQL DB
Tomcat
Vaadin
Logic
UI
Ehcache
Tomcat
Vaadin
Logic
UI
Ehcache
Tomcat
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
Benchmarking
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
Test Tomcat Tomcat
ELB
HTMLUnit
Rhino DOM
Custom Test App
JVM
Test Tomcat Tomcat
ELB
Custom Test App
#100
Custom Test App
#100
EC2-XL (7GB, 8 cores)
Test Tomcat Tomcat
ELB
Custom Test App
#100
Custom Test App
#100
EC2-XL (7GB, 8 cores)
Test Tomcat Tomcat
ELB
Custom Test App
#100
EC2-XL
Results
work in
progress
10 XL Test Servers1 Large Tomcat1 MySQL(UI Only Test)
10 XL Test Servers1 Large Tomcat1 MySQL(UI Only Test)
1 XL Test Servers2 JVMs (200 threads)1 Large Tomcat1 MySQL(UI Only Test)
start setup ajax finished
10 XL Test Servers (2000 clients)1 Large Tomcat
1 MySQL(UI Only Test)
JVM GC Pause
HTTP-level Benchmark
work in
progress
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
Test Tomcat Tomcat
ELB
Apache JMetertestrecording
Test Tomcat Tomcat
ELB
testrecordingApache JMeter
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
Server load
Tomcat JMeter
Server load
Tomcat
3000 simulatedconcurrent users
Guesstimates
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
Resource requirements?
measured session size 188kb
tomcat memoryreq. ~6-8GB
network traffic / session ~200kb
1GB / minute500 TB / year
Expected hosting costs?
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
Network
Elastic Load Balancing$4216 / year
500TB traffic$55000 / year
Total $59216 / year
Total hosting costs
Hosting costs are 0.00016% of the QuickTickets sales
$20 per million tickets sold
Total hosting costs: $77360 / year
QuestionsComments
[email protected]+358-40-5035001skype://joonaslehtinen