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