Tuning Networks.docx
《Tuning Networks.docx》由会员分享,可在线阅读,更多相关《Tuning Networks.docx(16页珍藏版)》请在冰豆网上搜索。
TuningNetworks
TuningNetworks
Thischapterdescribesdifferentconnectionmodelsandintroducesnetworkingissuesthataffecttuning.
Thischaptercontainsthefollowingsections:
∙UnderstandingConnectionModels
∙DetectingNetworkProblems
∙SolvingNetworkProblems
UnderstandingConnectionModels
Thetechniquesusedtodeterminethesourceofproblemsvarydependingontheconfiguration.Youcanhaveasharedserverconfigurationoradedicatedserverconfiguration.
∙Ifyouhaveasharedserverconfiguration,thenLSNRCTLserviceslistsdispatchers.
∙Ifyouhaveadedicatedserverconfiguration,thenLSNRCTLserviceslistsdedicatedservers.
Itispossibletoconnecttodedicatedserverwithadatabaseconfiguredforsharedserversbyplacingtheparameter(SERVER=DEDICATED)intheconnectdescriptor.
SharedServerConfiguration
Thissectiondiscussesthesetupsforthesharedserverconfiguration.
RegisteringtheDispatchers
TheLSNRCTLcontrolutility'sservicesstatementlistseverydispatcherregisteredwithit.ThislistincludesthedispatchersprocessID.Youcancheckthealertlogtoconfirmthatthedispatchershavebeenstartedsuccessfully.
Note:
RememberthatPMONcantakeaminutetoregisterthedispatcherwiththelistener.
LSNRCTL>services
Connectingto
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=helios)(PORT=1521)))
ServicesSummary...
Service""has1instance(s).
Instance"sales",statusREADY,has3handler(s)forthisservice...
Handler(s):
"DEDICATED"established:
0refused:
0state:
ready
LOCALSERVER
"D000"established:
0refused:
0current:
0max:
10000state:
ready
DISPATCHERhelios,pid:
1689>
(ADDRESS=(PROTOCOL=tcp)(HOST=helios)(PORT=52414))
"D001"established:
0refused:
0current:
0max:
10000state:
ready
DISPATCHERhelios,pid:
1691>
(ADDRESS=(PROTOCOL=tcp)(HOST=helios)(PORT=52415))
Thecommandcompletedsuccessfully.
SeeAlso:
OracleNetServicesAdministrator'sGuideforinformationonsettingtheoutputmode
ConfiguringInitializationParametersforSharedServers
Thefollowinglistprovidesinformationonconfiguringinitializationparametersforsharedservers.
∙MakesurethattheDISPATCHERSlineiscorrectlyset.Forexample:
∙DISPATCHERS="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
∙(HOST=hostname)(PORT=1492)(queuesize=32)))
∙(DISPATCHERS=1)
∙(LISTENER=alias)
∙(SERVICE=servicename)
∙(SESSIONS=1000)
∙(CONNECTIONS=1000)
∙(MULTIPLEX=ON)
∙(POOL=ON)
∙(TICK=5)"
∙
One,andonlyone,ofthefollowingattributesisrequired:
∙PROTOCOL
∙ADDRESS
∙DESCRIPTION
ADDRESSandDESCRIPTIONprovidesupportforthespecificationofadditionalnetworkattributesbeyondPROTOCOL.Inthepreviousexample,theentireDISPATCHERSlinecanbe(PROTOCOL=TCP).TheattributesDISPATCHERS,LISTENER,SERVICE,SESSIONS,CONNECTIONS,MULTIPLEX,POOL,andTICKSarealloptional.
MakesurethattheoptionalMAX_DISPATCHERSlineiscorrectlyset.Forexample:
MAX_DISPATCHERS=4
Thislineshouldreflectthetotalnumberofdispatchersyouwanttostart.
MakesurethattheoptionalMAX_SHARED_SERVERSlineiscorrectlyset.Forexample:
MAX_SHARED_SERVERS=5
ThislinesetstheupperboundonthetotalnumberofsharedserversPMONcancreate,basedonthepeakloadofthesystem.Thisshouldbesethighenoughsothatallrequestscanbeserviced,butnotsohighthatthesystemswapsiftheyarereached.Thepurposeofthisparameteristopreventtheserverfromswapping.Runthefollowingscripttoseewhatthehighwatermarkisforthenumberofserversrunning,andthensetMAX_SHARED_SERVERStomorethenthis.
SELECTmaximum_connections"MAXCONN",servers_started"STARTED",servers_
terminated"TERMINATED",servers_highwater"HIGHWATER"FROMV$SHARED_SERVER_
MONITOR;
∙MakesurethattheoptionalSHARED_SERVERSlineiscorrectlyset.Forexample:
∙SHARED_SERVERS=5
∙
Thisisthetotalnumberofsharedserversstartedwhenthedatabaseisstarted.ItalsorepresentsthetotalnumberofsharedserversPMONtriestokeep.Itshouldbethetotalnumberofserversexpectedtobeusedwhenthedatabaseisactive.MAX_SHARED_SERVERSisintendedtohandlepeakload.
CheckingtheConnections
UsetheLSNRCTLcontrolutility'sservicescommandtoseeifthereareexcessiveconnectionrefusals.Checkthelistener'slogfiletoseeifthisisaconnectionproblem.Forexample:
LSNRCTL>services
Connectingto
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=helios)(PORT=1521)))
ServicesSummary...
Service""has1instance(s).
Instance"sales",statusREADY,has2handler(s)forthisservice...
Handler(s):
"DEDICATED"established:
11refused:
0state:
ready
LOCALSERVER
"D000"established:
565refused:
4current:
155max:
10000state:
ready
DISPATCHERhelios,pid:
5673>
(ADDRESS=(PROTOCOL=tcp)(HOST=helios)(PORT=38411))
Thecommandcompletedsuccessfully.
Undernormalconditions,thenumberrefusedshouldbezero.Shutdownthelistenerandrestartittoerasethesestatistics.Iftherefusedcountisincreasingafterthelistenerrestarts,thentheconnectionsarebeingrefused.Iftherefusedcountstaysatzero,andiftheproblemyouaretroubleshootingisoccurring,thenyourproblemisnotwiththeconnectionsbeingrefused.
CheckingtheConnect/SecondRate
Connectionrefusalscanoccurformanyreasons.Examinethelistenerlogtoseewhattheconnectrateis.Runthelistenerloganalyzerscripttocheck.
Thelistenerisaqueue-basedprocess.Itreceivesconnectrequestsfromthelowerlevelprotocolstack.Ithasalimitedqueuestackwhichisconfigurabletotheoperatingsystemmaximum.Itcanonlyprocessoneconnectionatatime,andthereisalimittothenumberofconnectionsasecondtheprocesscanhandle.
Iftherateatwhichtheconnectrequestsarriveexceedsthatlimit,thentherequestsarequeued.Thequeuestackisalsolimited,butyoucanconfigureit.Iftherearemorelistenerprocesses,thentherequestsmadeagainsteachindividualprocessarefewerandarehandledmorequickly.
Increasingthelistenerqueueisdoneinthelistener.orafile.Thelistener.orafilecancontainmanylisteners,eachbyadifferentname.Itisassumedthatonlyoneofthoselistedishavingaproblem.Ifnot,thenapplythismethodtoallapplicablelisteners.Toincreasethelistenerqueue,add(queuesize=number)tothelistener.orafile.Forexample:
listener=
(address=
(protocol=tcp)
(host=sales-pc)
(port=1521)
(queuesize=20)
)
SeeAlso:
OracleNetServicesAdministrator'sGuide
Stopandrestartthelistenertoinitializethisnewparameter.Ifyouarenotcurrentlyrunningasharedserverconfiguration,thenconsiderdoingso.Itisfasterforthelistenertohandleaclientrequestinasharedserverconfigurationthanitisinadedicatedserverconfiguration.
Note:
Sharedserverdispatchersalsoreceiveconnectrequestsandcanalsobenefitfromtuningthequeuesize.
Themaximumqueuesizeissubjecttothemaximumsizepossibleforaparticularoperatingsystem.
DetectingNetworkProblems
Thissectionencompasseslocalareanetwork(LAN)andwideareanetwork(WAN)troubleshootingmethods.
UsingDynamicPerformanceViewsforNetworkPerformance
Networksentailoverheadthataddsacertainamountofdelaytoprocessing.Tooptimizeperformance,youmustensurethatyournetworkthroughputisfast,andyoushouldtrytoreducethenumberofmessagesthatmustbesentoverthenetwork.Itcanbedifficulttomeasurethedelaythenetworkadds.
Threedynamicperformanceviewsareusefulformeasuringthenetworkdelay:
∙V$SESSION_EVENT
∙V$SESSION_WAIT
∙V$SESSTAT
InV$SESSION_EVENT,theAVERAGE_WAITcolumnindicatestheamountoftimethatOraclewaitsbetweenmessages.Youcanusethisstatisticasayardsticktoevaluatetheeffectivenessofthenetwork.
InV$SESSION_WAIT,theEVENTcolumnliststheeventsforwhichactivesessionsarewaiting.The"sqlnetmessagefromclient"waiteventindicatesthatthesharedorforegroundprocessiswaitingforamessagefromaclient.Ifthiswaiteventhasoccurred,thenyoucanchecktoseewhetherthemessagehasbeensentbytheuserorreceivedbyOracle.
Youcaninvestigatehang-upsbylookingatV$SESSION_WAITtoseewhatthesessionsarewaitingfor.Ifaclienthassentamessage,thenyoucandeterminewhetherOracleisrespondingtoitorisstillwaitingforit.
InV$SESSTATyoucanseethenumberofbytesthathavebeenreceivedfromtheclient,thenumberofbytessenttotheclient,andthenumberofcallstheclienthasmade.
UnderstandingLatencyandBandwidth
Themostcriticalaspectsofanetworkthatcontributetoperformancearelatencyandbandwidth.
∙Latencyreferstoatimedelay;forexample,thegapbetweenthetimeadevicerequestsaccesstoanetworkandthetimeitreceivespermissiontotransmit.
∙Bandwidthisthethroughputcapacityofanetworkmediumorprotocol.Variationsinthenetworksignalscancausedegradationonthenetwork.Sourcesofdegradationcanbecablesthataretoolongorwrongcabletype.Externalnoisesources,suchaselevators,airhandlers,orflorescentlights,canalsocauseproblems.
CommonNetworkTopologies
LocalAreaNetworkTopologies:
∙Ethernet
∙FastEthernet
∙1GigabitEthernet
∙TokenRing
∙FDDI
∙ATM
WideAreaNetworkTopologies:
∙DSL
∙ISDN
∙FrameRelay
∙T-1,T-3,E-1,E-3
∙ATM
∙SONAT
Table 11-1liststhemostcommonratingsforvarioustopologies.
Table11-1 BandwidthRatings
TopologyorCarrier
Bandwidth
Ethernet
10Megabits/second
FastEthernet
100Megabits/second
1GigabitEthernet
1Gigabits/second
TokenRing
16Megabits/second
FDDI
100Megabits/second
AT