|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。iis|参考Tip9:Out-of-ProcessExecutionTradesoffPerformanceforReliability
BothASPandMTS/COM+haveconfigurationoptionsthatallowyoutotradeoffreliabilityforperformance.Youshouldunderstandthesetrade-offswhenbuildinganddeployingyourapplication.
ASPOptions
ASPApplicationscanbeconfiguredtoruninoneofthreeways.WithIIS5.0,theterminology“isolationlevel?hasbeenintroducedtodescribetheseoptions.ThethreeisolationlevelvaluesareLow,Medium,andHigh:
LowIsolation.ThisissupportedinallversionsofIISandisthefastest.ItrunsASPinInetinfo.exe,whichistheprimaryIISprocess.IftheASPapplicationcrashes,sodoesIIS.(TorestartIISunderIIS4.0,WebmasterswouldmonitorthesiteusingtoolssuchasInetMon,andfireoffbatchfilestorestarttheserverifitfailed.IIS5.0introducesreliablerestart,whichautomaticallyrestartsafailedserver.)
MediumIsolation.IIS5.0introducesthisnewlevel,whichisreferredtoasout-of-process,sinceASPrunsoutsideoftheIISprocess.InMediumisolation,allASPapplicationsconfiguredtorunasMediumshareasingleprocessspace.Thisreducesthenumberofprocessesrequiredtorunmultipleout-of-processASPapplicationsononebox.MediumisthedefaultisolationlevelinIIS5.0.
HighIsolation.SupportedinIIS4.0andIIS5.0,Highisolationisalsoout-of-process.IfASPcrashes,theWebserverdoesn’t.TheASPapplicationisautomaticallyrestartedonthenextASPrequest.WithHighisolation,eachASPapplicationthatisconfiguredtorunasHighrunsinitsownprocessspace.ThisprotectsASPapplicationsfromeachother.ItsdrawbackisthatitrequiresaseparateprocessforeachASPapplication.Thiscanadduptoalotofoverheadwhendozensofapplicationsneedtobehostedononebox.
Whichoptionisthebest?InIIS4.0,therewasafairlysteepperformancepenaltyforrunningout-of-process.InIIS5.0,alotofworkwasdonetominimizethecostofrunningASPapplicationsout-of-process.Infact,inmosttests,ASPout-of-processapplicationsinIIS5.0runfasterthanin-processapplicationsinIIS4.0.Regardless,in-process(Lowisolationlevel)stillproducesthebestperformanceonbothplatforms.However,youwon’tseemuchbenefittotheLowisolationlevelifyouhavearelativelylowhitrateorlowmaximumthroughput.Therefore,youshouldnotfeeltheneedtoreachfortheLowisolationleveluntilyouneedhundredsorthousandsofpagespersecondperWebserver.Asalways,testwithmultipleconfigurationsanddeterminewhichtrade-offsyouarewillingtomake.
Note:WhenyourunASPapplicationsout-of-process(MediumorHighisolation),theyruninMTSonNT4andCOM+onWindows2000.Thatis,onNT4theyruninMtx.exe,andonWindows2000,theyruninDllHost.exe.YoucanseetheseprocessesrunninginTaskManager.YoucanalsoseehowIISconfiguresMTSPackagesorCOM+Applicationsforout-of-processASPapplications.
COMOptions
COMcomponentsalsohavethreeconfigurationoptions,thoughnotcompletelyanalogoustotheASPoptions.COMcomponentscanbe:”unconfigured,?configuredasLibraryApplications,orconfiguredasServerApplications.UnconfiguredmeansthatthecomponentisnotregisteredwithCOM+.Thecomponentwillruninthecaller’sprocessspace,thatis,theyare“in-process.?LibraryApplicationsarealsoin-process,butbenefitfromCOM+’sservices,includingsecurity,transactions,andcontextsupport.ServerApplicationsareconfiguredtorunintheirownprocessspace.
YoumayseeaslightbenefitofunconfiguredcomponentsoverLibraryApplications.You’relikelytoseealargeperformancebenefitofLibraryApplicationsoverServerApplications.ThisisbecauseLibraryApplicationsruninthesameprocessasASP,whereasServerApplicationsrunintheirownprocess.Inter-processcallsaremoreexpensivethanin-processcalls.Also,whenpassingdatasuchasrecordsetsbetweenprocesses,allofthedatamustbecopiedbetweenthetwoprocesses.
Pitfall!WhenusingCOMServerApplications,ifyoupassobjectsbetweenASPandCOM,makesurethattheobjectsimplement“marshal-by-value,?orMBV.ObjectsthatimplementMBVcopythemselvesfromoneprocesstoanother.Thisisbetterthanthealternative,inwhichtheobjectremainsinthecreator’sprocess,andtheotherprocesscallsrepeatedlyintothecreatingprocesstousetheobject.DisconnectedADOrecordsetswillmarshal-by-value;connectedrecordsetswon’t.TheScripting.DictionarydoesnotimplementMBVandshouldnotbepassedbetweenprocesses.Finally,amessagetoVBprogrammersoutthere:MBVisNOTachievedbypassingaparameterByVal.MBVisimplementedbytheoriginalcomponentauthor.
WhattoDo?
Ifwe</p>由于ASP提供的是一对多的服务,所以用户的一些特殊需求很难得到满足。 |
|