Resumen del contenido incluido en la página 1
SunGlassFishEnterpriseServer
2.1PerformanceTuningGuide
SunMicrosystems,Inc.
4150NetworkCircle
SantaClara,CA95054
U.S.A.
PartNo:820–4343–10
January2009
Resumen del contenido incluido en la página 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
Resumen del contenido incluido en la página 3
Contents Preface...................................................................................................................................................13 1 OverviewofEnterpriseServerPerformanceTuning.....................................................................17 ProcessOverview ................................................................................................................................17 ▼PerformanceTuningSequence ...........................................
Resumen del contenido incluido en la página 4
Contents TuningTipsforSpecificTypesofEJBComponents ...............................................................42 JDBCandDatabaseAccess .........................................................................................................46 TuningMessage-DrivenBeans ..................................................................................................47 3 TuningtheEnterpriseServer...................................................................................................
Resumen del contenido incluido en la página 5
Contents ImprovingORBPerformancewithJavaSerialization .............................................................75 ThreadPoolSettings ...........................................................................................................................76 TuningThreadPools(Unix/Linuxonly) .................................................................................76 Resources..............................................................................................................
Resumen del contenido incluido en la página 6
Contents DiskI/OSettings ........................................................................................................................102 TCP/IPSettings ..........................................................................................................................102 TuningUltraSPARCT1–BasedSystems ........................................................................................103 TuningOperatingSystemandTCPSettings ..................................................
Resumen del contenido incluido en la página 7
Figures FIGURE1–1 JavaEEApplicationModel.......................................................................................20 7
Resumen del contenido incluido en la página 8
8
Resumen del contenido incluido en la página 9
Tables TABLE1–1 PerformanceTuningRoadmap ...............................................................................17 TABLE1–2 FactorsThatAffectPerformance.............................................................................24 TABLE3–1 BeanTypePoolingorCaching ................................................................................53 TABLE3–2 EJBCacheandPoolSettings ....................................................................................56 TABLE3–3 TunableORBSett
Resumen del contenido incluido en la página 10
10
Resumen del contenido incluido en la página 11
Examples EXAMPLE4–1 HeapConfigurationonSolaris ................................................................................89 EXAMPLE4–2 HeapConfigurationonWindows ...........................................................................90 11
Resumen del contenido incluido en la página 12
12
Resumen del contenido incluido en la página 13
Preface ThePerformanceTuningGuidedescribeshowtogetthebestperformancewithEnterprise Server. TM ThisprefacecontainsinformationaboutandconventionsfortheentireSunGlassFish EnterpriseServerdocumentationset. SunGlassFishEnterpriseServerDocumentationSet TABLEP–1 BooksintheEnterpriseServerDocumentationSet BookTitle Description DocumentationCenter EnterpriseServerdocumentationtopicsorganizedbytaskandsubject. ReleaseNotes Late-breakinginformationaboutthesoftwareandthedocumentation.Includesa TM comprehensi
Resumen del contenido incluido en la página 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
Resumen del contenido incluido en la página 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
Resumen del contenido incluido en la página 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
Resumen del contenido incluido en la página 17
CHAPTER 1 1 OverviewofEnterpriseServerPerformance Tuning YoucansignificantlyimproveperformanceoftheSunGlassFishEnterpriseServerandof applicationsdeployedtoitbyadjustingafewdeploymentandserverconfigurationsettings. However,itisimportanttounderstandtheenvironmentandperformancegoals.Anoptimal configurationforaproductionenvironmentmightnotbeoptimalforadevelopment environment. Thischapterdiscussesthefollowingtopics: ■ “ProcessOverview”onpage17 ■ “UnderstandingOperationalRequirements”onpage19 ■ “Gener
Resumen del contenido incluido en la página 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
Resumen del contenido incluido en la página 19
UnderstandingOperationalRequirements UnderstandingOperationalRequirements BeforeyoubegintodeployandtuneyourapplicationontheApplicationServer,itisimportant toclearlydefinetheoperationalenvironment.Theoperationalenvironmentisdeterminedby high-levelconstraintsandrequirementssuchas: ■ “ApplicationArchitecture”onpage19 ■ “SecurityRequirements”onpage21 ■ “HardwareResources”onpage22 ApplicationArchitecture TheJavaEEApplicationmodel,asshowninthefollowingfigure,isveryflexible;allowingthe applicationarchi
Resumen del contenido incluido en la página 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