Upload
mendes6212
View
221
Download
0
Embed Size (px)
Citation preview
8/4/2019 Bcs2010 a Developers Guide to Load Testing
1/61
Softwarearchitecturefor
developers
8/4/2019 Bcs2010 a Developers Guide to Load Testing
2/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
3/61
Books
Training
Conferences
itjersey & itguernsey
8/4/2019 Bcs2010 a Developers Guide to Load Testing
4/61
Website
http://www.codingthearchitecture.com
LondonUserGroup
Monthlymixofpresentationanddiscussion
GoogleGroup
http://groups.google.com/codingthearchitecture
8/4/2019 Bcs2010 a Developers Guide to Load Testing
5/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
6/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
7/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
8/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
9/61
Its important
that we know
whatwere releasing
Its importantthat the
software we
release
works
8/4/2019 Bcs2010 a Developers Guide to Load Testing
10/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
11/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
12/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
13/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
14/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
15/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
16/61
http://www.infoq.com/articles/scalability-principles
22/09/200922:26
InfoQ:Scalability Princip
les
Page1of 4
http://www.infoq.com/a
rticles/scalability-princi
ples
Article
ScalabilityPrinciples
Posted bySimonBrown
onMay21,2008
CommunityArchitecture
TopicsPerformance&Scal
ability TagsConcurrenc
y
Atthesimplestlevel,sca
labilityisaboutdoingm
oreof something.Thisco
uld beresponding tomo
reuser requests,execut
ingmore
workorhandling moreda
ta. Whiledesigningsoftw
are hasitscomplexities,
makingthatsoftware ca
pableofdoinglotsofwo
rkpresents itsownset
ofproblems.Thisarticle
presentssomeprinciples
and guidelinesfor buildin
gscalablesoftware syste
ms.
RelatedVendorContent
5 Ways toEnsureApplica
tion Performance
Comprehensive ThreatPr
otectionforREST, SOA,a
nd Web2.0Applications
TheAgileProject Manage
r
TheAgileChecklist
AdobeFlashPlatform
OverviewPDF
1.Decreaseprocessingtim
e
Onewaytoincreasethe
amountofwork that an a
pplication does isto dec
rease the timetakenforin
dividualworkunits to co
mplete. For example,
decreasingthe amounto
ftimerequiredto proces
sauser requestmeans t
hatyouareableto hand
lemore userrequestsin
thesameamountoftime
.
Herearesomeexamples
of where thisprincipleis
appropriateand somepo
ssiblerealisationstrateg
ies.
Collocation:reduce any
overheads associatedwi
thfetchingdata required
forapieceofwork, by c
ollocating thedataand th
ecode.
Caching: ifthe dataand
the codecan'tbecolloc
ated,cache thedatatore
duce the overheadof fetc
hingitoverandoveraga
in.
Pooling:reduce the ove
rheadassociated with us
ingexpensiveresources
bypooling them.
Parallelization :decrea
sethetimetakento com
pleteaunit of workbyde
composingtheprobleman
dparallelizing the individ
ual steps.
Partitioning: concentra
terelatedprocessingas
closetogether as possibl
e, bypartitioning thecod
e andcollocatingrelated
partitions.
Remoting :reduce thea
mount oftime spentacce
ssing remote services by
, for example, makingth
einterfacesmorecoarse
-grained. It'salso
worthrememberingthatr
emotevslocalisan expl
icitdesign decisionnota
switchandto considert
hefirstlawofdistributed
computing-do
notdistributeyourobjec
ts.
Assoftwaredevelopers, w
etend tointroduceabstr
actions andlayerswhere
theyareoftennotrequire
d.Yes,theseconcepts are
great tools for
decouplingsoftwarecomponents,butthey
haveatendencytoincr
easecomplexityandimp
actperformance, particul
arly ifyou'reconverting b
etween
datarepresentationsate
achlayer.Therefore,theother wayinwhich p
rocessing timecanbemin
imisedistoensurethat t
heabstractionsaren'ttoo
abstractandthatthere's
nottoomuch layering.I
naddition,it's worthund
erstandingthecostofruntimeservice
sthatwe take forgrante
dbecause,
unlesstheyhaveaspeci
ficservicelevel agreemen
t,it'spossiblethatthese
couldendupbeing the b
ottlenecksinourapplications.
2.Partition
Decreasingtheprocessin
gtime associatedwitha
particularwork unit willg
etyousofar, butultimat
elyyou'll needtoscale ou
tyoursystemwhen
youreachthelimitsofa
singleprocess deployme
nt. Inatypical web applic
ation, scalingoutcould
beaseasyasstartingup
additional webservers to
handle theuserrequests
andload balancingbetw
een them.Whatyou migh
t find,however,isthatpa
rtsofyour overallarchit
ecturewillstartto
becomepointsofconten
tion becauseeverything w
illgetbusy atthesame t
ime. Agoodexample is
asingledatabaseserver
sittingbehindallthose
webservers.Whenthats
tartstobecomethebottl
eneck, youhave tochang
e yourapproachandone
waytodothisistoadop
tapartitioningstrategy.
Putsimply,this involvesb
reaking upthatsinglepie
ceofthearchitectureint
osmallermoremanageab
le chunks. Partitioningtha
tsingleelementinto
smallerchunksallows yo
utoscale themoutand t
hisis exactly thetechniq
uethat largesitessuch a
s eBayusetoensurethat
theirarchitectures
scale. Partitioningisago
od solution,althoughyou
mayfind thatyoutrade-o
ffconsistency.
Astohowyoupartitiony
our system,wellthatdep
ends.Trulystatelesscom
ponents cansimplybe sc
aledoutandthe work loa
d balancedbetween
them,ideallywithallinst
ancesofthecomponent
runninginanactiveman
ner.If,on the otherhand
,there isstate that needs
tobe maintained, you
needto findaworkload p
artitioning strategy thatw
ill allow youtohave mult
iple instancesofthosest
atefulcomponents,where
each instanceis
responsible foradistinct
subset oftheworkand/
ordata.
3. Scalabilityisabout concu
rrency
Scalabilityisinherentlya
bout concurrency; aftera
ll,it'saboutdoingmore
workatthesametime.T
echnologiessuchasthe
earlyversions of
Enterprise JavaBeans(EJB
) attemptedto providea
simplifiedprogramming
model andencouragedu
stowritecomponentsth
atwere single-threaded.
Unfortunately,thesecom
ponents typicallyhad de
pendencies onothercomp
onents andthisledto co
ncurrencyproblems.Ifco
ncurrency isn't thought
about, youhave system
s where datacaneasily b
ecome corrupted.Onthe
otherhand,toomanygu
ardsaroundconcurrency
lead tosystems thatare
essentially serialin natureand limitedi
nthedegreetowhich the
y canscale. Concurrentpr
ogrammingisn'tthathar
dtodo,buttherearesom
e
simple principles that can
helpwhenbuildingscalablesystems.
Ifyou doneedto holdloc
ks(e.g. localobjects, dat
abase objects, etc),tryto
holdthem foraslittle timeaspossi
ble.
Trytominimizecontentio
nofshared resources an
dtry totakeanycontenti
on off ofthecriticalproc
essingpath(e.g. by scheduling work
asynchronously).
Any designforconcurren
cyneedstobedoneup-
front,sothat it's well un
derstoodwhich resources
can besharedsafely and
wherepotential
scalabilitybottlenecks wi
llbe.
4.Requirementsmustbek
nown
Inorder to buildasucces
sfulsoftwaresystem,you
need toknow whatyour
goalsareand whatyou'r
eaimingfor. Whilethef
unctionalrequirements
are often well-known, it'
sthenon-functionalreq
uirements(orsystemqua
lities)thatareusuallyabs
ent. If youdo genuinely
needtobuildapieceof
softwarethatis highly sc
alable,thenyouneedto
understandthefollowing
typesof thingsup-front
for thecritical compone
nts/workflows.
Targetaverage andpeak
performance(i.e. respon
setime,latency, etc).
Targetaverage andpeak
load(i.e.concurrentuse
rs, messagevolumes, etc
).
Acceptable limitsfor per
formance andscalability.
8/4/2019 Bcs2010 a Developers Guide to Load Testing
17/61
(andwhy?)
8/4/2019 Bcs2010 a Developers Guide to Load Testing
18/61
Will these software systems
perform and scale acceptably?
8/4/2019 Bcs2010 a Developers Guide to Load Testing
19/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
20/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
21/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
22/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
23/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
24/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
25/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
26/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
27/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
28/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
29/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
30/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
31/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
32/61
Stepone
8/4/2019 Bcs2010 a Developers Guide to Load Testing
33/61
Steptwo
8/4/2019 Bcs2010 a Developers Guide to Load Testing
34/61
Stepthree
8/4/2019 Bcs2010 a Developers Guide to Load Testing
35/61
Stepfour
8/4/2019 Bcs2010 a Developers Guide to Load Testing
36/61
Stepfive
8/4/2019 Bcs2010 a Developers Guide to Load Testing
37/61
Stepsix
8/4/2019 Bcs2010 a Developers Guide to Load Testing
38/61
Stepseven
8/4/2019 Bcs2010 a Developers Guide to Load Testing
39/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
40/61
timeStamp,elapsed,
label,responseCode
,threadName,succes
s,URL
1242921099104,77,0
1.Logonpage,200,
Corporateuser1-1
,true,http://ib4cu
rrencydev/user/Log
on.aspx
1242921099318,684,
02.Enterusername
andpassword,200,
Corporateuser1-1
,true,http://ib4cu
rrencydev/user/Log
on.aspx
1242921100101,1057
,03.Entermemorab
leinformation,302
,Corporateuser1-
1,true,http://ib4c
urrencydev/user/Lo
gon.aspx
1242921101170,10,0
4.Post-logonland
ingpage,200,Corpo
rateuser1-1,true
,http://ib4currenc
ydev/user/landing-
page.aspx
1242921101191,42,05.Viewclie
nts,200,Corporate
user1-1,true,http
://ib4currencydev/
view/relationship.
aspx
1242921104394,13,0
1.Logonpage,200,Corporateuser
1-2,true,http://ib
4currencydev/user/
Logon.aspx
1242921104420,788,
02.Enterusername
andpassword,200,
Corporateuser1-2,true,htt
p://ib4currencydev
/user/Logon.aspx
1242921105232,872,
03.Entermemorabl
einformation,302,
Corporateuser1-2
,true,http://ib4currencydev/us
er/Logon.aspx
1242921106120,9,04
.Post-logonlandi
ngpage,200,Corpor
ateuser1-2,true,
http://ib4currency
dev/user/landing-page.aspx
1242921106141,715,
05.Viewclients,2
00,Corporateuser
1-2,true,http://ib
4currencydev/view/
relationship.aspx
1242921109600,166,
01.Logonpage,200
,Corporateuser1-
3,true,http://ib4c
urrencydev/user/Lo
gon.aspx
1242921109775,582,
02.Enterusername
andpassword,200,
Corporateuser1-3
,true,http://ib4cu
rrencydev/user/Log
on.aspx
1242921110377,835,
03.Entermemorabl
einformation,302,
Corporateuser1-3
,true,http://ib4cu
rrencydev/user/Log
on.aspx
1242921111221,9,04
.Post-logonlandi
ngpage,200,Corpor
ateuser1-3,true,
http://ib4currency
dev/user/landing-p
age.aspx
1242921101254,1031
2,06.Viewclient
details,200,Corpor
ateuser1-1,true,
http://ib4currency
dev/view/account-l
ist.aspx
1242921111239,925,
05.Viewclients,2
00,Corporateuser
1-3,true,http://ib
4currencydev/view/
relationship.aspx
1242921111584,1612
,07.Recipientsla
ndingpage,200,Cor
porateuser1-1,tr
ue,http://ib4curre
ncydev/recipients/
Default.aspx
1242921113208,51,0
8.Createrecipien
t,200,Corporateus
er1-1,true,http:/
/ib4currencydev/re
cipients/Create.as
px
1242921113274,268,
09.Createrecipie
nt-choosepaymen
ttype,200,Corpora
teuser1-1,true,h
ttp://ib4currencyd
ev/recipients/Crea
te.aspx
1242921113558,1613,10.Create
recipient-enter
recipientdetails
,200,Corporateuse
r1-1,true,http://
ib4currencydev/rec
ipients/Create.asp
x
1242921114709,480,
01.Logonpage,200,Corporateuse
r1-4,true,http://
ib4currencydev/use
r/Logon.aspx
1242921115197,626,
02.Enterusername
andpassword,200,Corporateuser1-
4,true,http://ib4c
urrencydev/user/Lo
gon.aspx
1242921115857,957,
03.Entermemorabl
einformation,302,
Corporateuser1-4
,true,http://ib4currencydev/u
ser/Logon.aspx
1242921116823,11,0
4.Post-logonland
ingpage,200,Corpo
rateuser1-4,true
,http://ib4currenc
ydev/user/landing-page.aspx
1242921116842,37,0
5.Viewclients,20
0,Corporateuser1
-4,true,http://ib4
currencydev/view/r
elationship.aspx
8/4/2019 Bcs2010 a Developers Guide to Load Testing
41/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
42/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
43/61
This showspoorscalability because
response times havestarted to increase
exponentiallyNumber of users
Respon
setime
This showsgoodscalability because
response times increasein a predictable way Number of users
Responsetime
8/4/2019 Bcs2010 a Developers Guide to Load Testing
44/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
45/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
46/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
47/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
48/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
49/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
50/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
51/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
52/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
53/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
54/61
Areyousure?
8/4/2019 Bcs2010 a Developers Guide to Load Testing
55/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
56/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
57/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
58/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
59/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
60/61
8/4/2019 Bcs2010 a Developers Guide to Load Testing
61/61
http://www.codingthearchitecture.com
Softwarearchitecturefor
developers