计算机专业文献翻译性能测试方法.docx
《计算机专业文献翻译性能测试方法.docx》由会员分享,可在线阅读,更多相关《计算机专业文献翻译性能测试方法.docx(17页珍藏版)》请在冰豆网上搜索。
计算机专业文献翻译性能测试方法
届毕业设计(论文)
英文参考文献
英文文献1:
DatabaseSecurity
文献出处,年,Vol.卷(期)NetworkSecurityVolume:
2003,Issue:
6,June,2003,pp.11-12
作者:
PaulMorrison
英文文献2:
ApproachestoPerformanceTesting
文献出处,年,Vol.卷(期)ApproachestoPerformanceTestingVol.18,No.3,pp.312-319,2000
作者:
MattMaccaux
学生院系
专业名称学生班级
学生学号学生姓名
学生层次
ApproachestoPerformanceTesting
byMattMaccaux
09/12/2005
Abstract
Therearemanydifferentwaystogoaboutperformancetestingenterpriseapplications,someofthemmoredifficultthanothers.Thetypeofperformancetestingyouwilldodependsonwhattypeofresultsyouwanttoachieve.Forexample,forrepeatability,benchmarktestingisthebestmethodology.However,totesttheupperlimitsofthesystemfromtheperspectiveofconcurrentuserload,capacityplanningtestsshouldbeused.Thisarticlediscussesthedifferencesandexaminesvariouswaystogoaboutsettingupandrunningtheseperformancetests.
Introduction
PerformancetestingaJ2EEapplicationcanbeadauntingandseeminglyconfusingtaskifyoudon'tapproachitwiththeproperplaninplace.Aswithanysoftwaredevelopmentprocess,youmustgatherrequirements,understandthebusinessneeds,andlayoutaformalschedulewellinadvanceoftheactualtesting.Therequirementsfortheperformancetestingshouldbedrivenbytheneedsofthebusinessandshouldbeexplainedwithasetofusecases.Thesecanbebasedonhistoricaldata(say,whattheloadpatternwasontheserverforaweek)oronapproximationsbasedonanticipatedusage.Onceyouhaveanunderstandingofwhatyouneedtotest,youneedtolookathowyouwanttotestyourapplication.
Earlyoninthedevelopmentcycle,benchmarktestsshouldbeusedtodetermineifanyperformanceregressionsareintheapplication.Benchmarktestsaregreatforgatheringrepeatableresultsinarelativelyshortperiodoftime.Thebestwaytobenchmarkistochangeoneandonlyoneparameterbetweentests.Forexample,ifyouwanttoseeifincreasingtheJVMmemoryhasanyimpactontheperformanceofyourapplication,incrementtheJVMmemoryinstages(forexample,goingfrom1024MBto1224MB,thento1524MB,andfinallyto2024MB)andstopateachstagetogathertheresultsandenvironmentdata,recordthisinformation,andthenmoveontothenexttest.Thiswayyou'llhaveacleartrailtofollowwhenyouareanalyzingtheresultsofthetests.Inthenextsection,Idiscusswhatabenchmarktestlookslikeandthebestparametersforrunningthesetests.
Lateroninthedevelopmentcycle,afterthebugshavebeenworkedoutoftheapplicationandithasreachedastablepoint,youcanrunmorecomplextypesofteststodeterminehowthesystemwillperformunderdifferentloadpatterns.Thesetypesoftestsarecalledcapacityplanning,soaktests,andpeak-resttests,andaredesignedtotest"real-world"-typescenariosbytestingthereliability,robustness,andscalabilityoftheapplication.ThedescriptionsIusebelowshouldbetakenintheabstractsensebecauseeveryapplication'susagepatternwillbedifferent.Forexample,capacity-planningtestsaregenerallyusedwithslowramp-ups(definedbelow),butifyourapplicationseesquickburstsoftrafficduringaperiodoftheday,thencertainlymodifyyourtesttoreflectthis.Keepinmind,though,thatasyouchangevariablesinthetest(suchastheperiodoframp-upthatItalkabouthereorthe"think-time"oftheusers)theoutcomeofthetestwillvary.Itisalwaysagoodideatorunaseriesofbaselinetestsfirsttoestablishaknown,controlledenvironmenttocompareyourchangeswithlater.
Benchmarking
Thekeytobenchmarktestingistohaveconsistentlyreproducibleresults.Resultsthatarereproducibleallowyoutodotwothings:
reducethenumberoftimesyouhavetorerunthosetests;andgainconfidenceintheproductyouaretestingandthenumbersyouproduce.Theperformance-testingtoolyouusecanhaveagreatimpactonyourtestresults.Assumingtwoofthemetricsyouarebenchmarkingaretheresponsetimeoftheserverandthethroughputoftheserver,theseareaffectedbyhowmuchloadisputontotheserver.Theamountofloadthatisputontotheservercancomefromtwodifferentareas:
thenumberofconnections(orvirtualusers)thatarehittingtheserversimultaneously;andtheamountofthink-timeeachvirtualuserhasbetweenrequeststotheserver.Obviously,themoreusershittingtheserver,themoreloadwillbegenerated.Also,theshorterthethink-timebetweenrequestsfromeachuser,thegreatertheloadwillbeontheserver.Combinethosetwoattributesinvariouswaystocomeupwithdifferentlevelsofserverload.Keepinmindthatasyouputmoreloadontheserver,thethroughputwillclimb,toapoint.
Figure1.Thethroughputofthesysteminpagespersecondasloadincreasesovertime
Notethatthethroughputincreasesataconstantrateandthenatsomepointlevelsoff.
Atsomepoint,theexecutequeuestartsgrowingbecauseallthethreadsontheserverwillbeinuse.Theincomingrequests,insteadofbeingprocessedimmediately,willbeputintoaqueueandprocessedwhenthreadsbecomeavailable.
Figure2.Theexecutequeuelengthofthesystemasloadincreasesovertime
Notethatthequeuelengthiszeroforaperiodoftime,butthenstartstogrowataconstantrate.Thisisbecausethereisasteadyincreaseinloadonthesystem,andalthoughinitiallythesystemhadenoughfreethreadstocopewiththeadditionalload,eventuallyitbecameoverwhelmedandhadtostartqueuingthemup.
Whenthesystemreachesthepointofsaturation,thethroughputoftheserverplateaus,andyouhavereachedthemaximumforthesystemgiventhoseconditions.However,asserverloadcontinuestogrow,theresponsetimeofthesystemalsogrowsevenasthethroughputplateaus.
Figure3.Theresponsetimesoftwotransactionsonthesystemasloadincreasesovertime
Notethatatthesametimeastheexecutequeue(above)startstogrow,theresponsetimealsostartstogrowatanincreasedrate.Thisisbecausetherequestscannotbeservedimmediately.
Tohavetrulyreproducibleresults,thesystemshouldbeputunderahighloadwithnovariability.Toaccomplishthis,thevirtualusershittingtheservershouldhave0secondsofthink-timebetweenrequests.Thisisbecausetheserverisimmediatelyputunderloadandwillstartbuildinganexecutequeue.Ifthenumberofrequests(andvirtualusers)iskeptconsistent,theresultsofthebenchmarkingshouldbehighlyaccurateandveryreproducible.
Onequestionyoushouldraiseis,"Howdoyoumeasuretheresults?
"Anaverageshouldbetakenoftheresponsetimeandthroughputforagiventest.Theonlywaytoaccuratelygetthesenumbersthoughistoloadalltheusersatonce,andthenrunthemforapredeterminedamountoftime.Thisiscalleda"flat"run.
Figure4.Thisiswhataflatrunlookslike.Alltheusersareloadedsimultaneously.
Theoppositeisknownasa"ramp-up"run.
Figure5.Thisiswhataramp-uprunlookslike.Theusersareaddedataconstantrate(xnumberpersecond)throughoutthedurationofthetest.
Theusersinaramp-uprunarestaggered(addingafewnewuserseveryxseconds).Theramp-uprundoesnotallowforaccurateandreproducibleaveragesbecausetheloadonthesystemisconstantlychangingastheusersarebeingaddedafewatatime.Therefore,theflatrunisidealforgettingbenchmarknumbers.
Thisisnottodiscountthevalueinrunningramp-up-styletests.Infact,ramp-uptestsarevaluableforfindingtheballparkinwhichyouthinkyoulaterwanttorunflatruns.Thebeautyofaramp-uptestisthatyoucanseehowthemeasurementschangeastheloadonthesystemchanges.Thenyoucanpicktherangeyoulaterwanttorunwithflattests.
Theproblemwithflatrunsisthatthesystemwillexperience"wave"effects.
Figure6.Thethroughputofthesysteminpagespersecondasmeasuredduringaflatrun
Notetheappearanceofwavesovertime.Thethroughputisnotsmoothbutratherresemblesawavepattern.
ThisisvisiblefromallaspectsofthesystemincludingtheCPUutilization.
Figure7.TheCPUutilizationofthesystemovertime,asmeasuredduringaflatrun
Notetheappearanceofwavesoveraperiodoftime.TheCPUutilizationisnotsmoothbutratherhasverysharppeaksthatresemblethethroughputgraph'swaves.
Additionally,theexecutequeueexperiencesthisunstableload,andthereforeyouseethequeuegrowingandshrinkingastheloadonthesystemincreasesanddecreasesovertime.
Figure8.Theexecutequeueofthesystemovertimeasmeasuredduringaflatrun
Notetheappearanceofwavesovertime.TheexecutequeueexactlymimicstheCPUutilizationgraphabove.
Finally,theresponsetimeofthetransactionsonthesystemwillalsoresemblethiswavepattern.
Figure9.Theresponsetimeofatransactiononthesystemovertimeasmeasuredduringaflatrun
Notetheappearanceofwavesovertime.Thetransactionresponsetimelinesupwiththeabovegraphs,buttheeffectisdiminishedovertime.
Thisoccurswhenalltheusersaredoingapproximatelythesamethingatthesametimeduringthetest.Thiswillproduceveryunreliableandinaccurateresults,sosomethingmustbedonetocounteractthis.Therearetwowaystogainaccuratemeasurementsfromthesetypesofresults.Ifthetestisallowedtorunforaverylongduration(sometimesseveralhours,dependingonhowlongoneuseriterationtakes)eventuallyanaturalsortofrandomnesswillsetinandthethroughputoftheserverwill"flattenout."Alternatively,measurementscanbetakenonlybetweentwoofthebreaksinthewaves.Th