Resumo do conteúdo contido na página número 1
SunGlassFishEnterpriseServer
2.1PerformanceTuningGuide
SunMicrosystems,Inc.
4150NetworkCircle
SantaClara,CA95054
U.S.A.
PartNo:820–4343–10
January2009
Resumo do conteúdo contido na página número 2
Copyright2009SunMicrosystems,Inc. 4150NetworkCircle,SantaClara,CA95054U.S.A. Allrightsreserved. SunMicrosystems,Inc.hasintellectualpropertyrightsrelatingtotechnologyembodiedintheproductthatisdescribedinthisdocument.Inparticular,andwithout limitation,theseintellectualpropertyrightsmayincludeoneormoreU.S.patentsorpendingpatentapplicationsintheU.S.andinothercountries. U.S.GovernmentRights–Commercialsoftware.GovernmentusersaresubjecttotheSunMicrosystems,Inc.standardlicenseagreementandapplicableprovi
Resumo do conteúdo contido na página número 3
Contents Preface...................................................................................................................................................13 1 OverviewofEnterpriseServerPerformanceTuning.....................................................................17 ProcessOverview ................................................................................................................................17 ▼PerformanceTuningSequence ...........................................
Resumo do conteúdo contido na página número 4
Contents TuningTipsforSpecificTypesofEJBComponents ...............................................................42 JDBCandDatabaseAccess .........................................................................................................46 TuningMessage-DrivenBeans ..................................................................................................47 3 TuningtheEnterpriseServer...................................................................................................
Resumo do conteúdo contido na página número 5
Contents ImprovingORBPerformancewithJavaSerialization .............................................................75 ThreadPoolSettings ...........................................................................................................................76 TuningThreadPools(Unix/Linuxonly) .................................................................................76 Resources..............................................................................................................
Resumo do conteúdo contido na página número 6
Contents DiskI/OSettings ........................................................................................................................102 TCP/IPSettings ..........................................................................................................................102 TuningUltraSPARCT1–BasedSystems ........................................................................................103 TuningOperatingSystemandTCPSettings ..................................................
Resumo do conteúdo contido na página número 7
Figures FIGURE1–1 JavaEEApplicationModel.......................................................................................20 7
Resumo do conteúdo contido na página número 8
8
Resumo do conteúdo contido na página número 9
Tables TABLE1–1 PerformanceTuningRoadmap ...............................................................................17 TABLE1–2 FactorsThatAffectPerformance.............................................................................24 TABLE3–1 BeanTypePoolingorCaching ................................................................................53 TABLE3–2 EJBCacheandPoolSettings ....................................................................................56 TABLE3–3 TunableORBSett
Resumo do conteúdo contido na página número 10
10
Resumo do conteúdo contido na página número 11
Examples EXAMPLE4–1 HeapConfigurationonSolaris ................................................................................89 EXAMPLE4–2 HeapConfigurationonWindows ...........................................................................90 11
Resumo do conteúdo contido na página número 12
12
Resumo do conteúdo contido na página número 13
Preface ThePerformanceTuningGuidedescribeshowtogetthebestperformancewithEnterprise Server. TM ThisprefacecontainsinformationaboutandconventionsfortheentireSunGlassFish EnterpriseServerdocumentationset. SunGlassFishEnterpriseServerDocumentationSet TABLEP–1 BooksintheEnterpriseServerDocumentationSet BookTitle Description DocumentationCenter EnterpriseServerdocumentationtopicsorganizedbytaskandsubject. ReleaseNotes Late-breakinginformationaboutthesoftwareandthedocumentation.Includesa TM comprehensi
Resumo do conteúdo contido na página número 14
Preface TABLEP–1 BooksintheEnterpriseServerDocumentationSet (Continued) BookTitle Description HighAvailabilityAdministration Settingupclusters,workingwithnodeagents,andusingloadbalancers. Guide AdministrationReference EditingtheEnterpriseServerconfigurationfile,domain.xml. PerformanceTuningGuide TuningtheEnterpriseServertoimproveperformance. ReferenceManual UtilitycommandsavailablewiththeEnterpriseServer;writteninmanpagestyle.Includes theasadmincommandlineinterface. DefaultPathsandFileNames Thef
Resumo do conteúdo contido na página número 15
Preface TypographicConventions Thefollowingtabledescribesthetypographicchangesthatareusedinthisbook. TABLEP–3 TypographicConventions Typeface Meaning Example AaBbCc123 Thenamesofcommands,files,and Edityour.loginfile. directories,andonscreencomputer Usels-atolistallfiles. output machine_name% you have mail. AaBbCc123 Whatyoutype,contrastedwithonscreen machine_name%su computeroutput Password: AaBbCc123 Aplaceholdertobereplacedwithareal Thecommandtoremoveafileisrmfilename. nameorvalue AaBbCc123 Boo
Resumo do conteúdo contido na página número 16
Preface TABLEP–4 SymbolConventions (Continued) Symbol Description Example Meaning → Indicatesmenuitem File→New→Templates FromtheFilemenu,chooseNew. selectioninagraphicaluser FromtheNewsubmenu,choose interface. Templates. Documentation,Support,andTraining TheSunwebsiteprovidesinformationaboutthefollowingadditionalresources: ■ Documentation(http://www.sun.com/documentation/) ■ Support(http://www.sun.com/support/) ■ Training(http://www.sun.com/training/) Third-PartyWebSiteReferences Third-partyURLs
Resumo do conteúdo contido na página número 17
CHAPTER 1 1 OverviewofEnterpriseServerPerformance Tuning YoucansignificantlyimproveperformanceoftheSunGlassFishEnterpriseServerandof applicationsdeployedtoitbyadjustingafewdeploymentandserverconfigurationsettings. However,itisimportanttounderstandtheenvironmentandperformancegoals.Anoptimal configurationforaproductionenvironmentmightnotbeoptimalforadevelopment environment. Thischapterdiscussesthefollowingtopics: ■ “ProcessOverview”onpage17 ■ “UnderstandingOperationalRequirements”onpage19 ■ “Gener
Resumo do conteúdo contido na página número 18
ProcessOverview TABLE1–1 PerformanceTuningRoadmap (Continued) Step DescriptionofTask LocationofInstructions 3 Installation:IfyouareusingHADBforsession InstallationGuide persistence,ensurethattheHADBsoftwareis installed. 4 Deployment:Installandrunyourapplications. ApplicationDeploymentGuide Familiarizeyourselfwithhowtoconfigureand AdministrationGuide administertheEnterpriseServer. 5 Tuning:Tunethefollowingitems: Thefollowingchapters: ■ ■ Applications Chapter2,“TuningYourApplication” ■ ■ Enterpris
Resumo do conteúdo contido na página número 19
UnderstandingOperationalRequirements UnderstandingOperationalRequirements BeforeyoubegintodeployandtuneyourapplicationontheApplicationServer,itisimportant toclearlydefinetheoperationalenvironment.Theoperationalenvironmentisdeterminedby high-levelconstraintsandrequirementssuchas: ■ “ApplicationArchitecture”onpage19 ■ “SecurityRequirements”onpage21 ■ “HardwareResources”onpage22 ApplicationArchitecture TheJavaEEApplicationmodel,asshowninthefollowingfigure,isveryflexible;allowingthe applicationarchi
Resumo do conteúdo contido na página número 20
UnderstandingOperationalRequirements Client-Side Server-Side Server-Side Enterprise Presentation Presentation Business Logic Information System Web EJB Browser Server Container Pure JSP EJB HTML Java JSP EJB Applet Desktop Java Java EJB Application Servlet Other Device J2EE J2EE J2EE Client Platform Platform FIGURE1–1 JavaEEApplicationModel ModeratelycomplexenterpriseapplicationscanbedevelopedentirelyusingservletsandJSP technology.MorecomplexbusinessapplicationsoftenuseEnterpriseJavaBeans(EJB) c