You are on page 1of 112

RFC Monitoring

Best Practice for Solution Management


VersionDate:01.02.2008

Contents
1 Introduction .............................................................................................................................3 Applicability,Goals,andRequirements...............................................................................3 BestPracticeProcedure.....................................................................................................5 1.2.1 MotivationforInterfaceMonitoring.............................................................................5 1.2.2 PreliminaryTasks.......................................................................................................5 1.2.3 InterfaceMonitoringconcept ......................................................................................5 1.2.4 Legend......................................................................................................................5 GeneralOverviewofRFCandRFCtypes ...............................................................................6 2.1.1 RemoteFunctionCall.................................................................................................6 2.1.2 GeneralOverviewofRFCTypes ................................................................................7 2.1.3 DependenciesandConvergenceofTechnologies ....................................................29 2.1.4 AutomaticSwitchingfromqRFCtotRFC..................................................................32 Aspect:ErrorMonitoring........................................................................................................33 3.1 ManualErrorMonitoring ...................................................................................................34 3.2 AutomatedErrorMonitoring..............................................................................................40 3.3 Troubleshooting:Errorexamplesandsolutions.................................................................42 3.3.1 ErrorCALL_FUNCTION_REMOTE_ERROR.........................................................42 3.3.2 ExternalProgramnotregisteredonGateway ...........................................................43 3.3.3 ExternalProgramtimeoutonGateway .....................................................................44 3.3.4 Timeoutduringconnectionsetup..............................................................................45 3.3.5 Activeconnectiontableisfull...................................................................................46 3.3.6 SQLerror60whenaccessingtableARFCSSTATE...................................................47 3.3.7 CPICTimeoutsduringconnectiontoExternalprogram.............................................48 3.3.8 Sockettoolarge.......................................................................................................51 Aspect:BacklogMonitoring ...................................................................................................52 4.1 ManualBacklogMonitoring ..............................................................................................52 4.2 AutomatedBacklogMonitoring .........................................................................................53 Aspect:PerformanceMonitoring............................................................................................55 5.1 ManualPerformanceMonitoring.......................................................................................55 5.1.1 OverviewofAvailableToolsforRFCPerformanceAnalysis ......................................57 1.1 1.2

BestPractice:RFCMonitoring 5.1.2 ActivationofPerformanceMonitoringWithTransactionST03N................................65 5.2 AutomatedPerformanceMonitoring.................................................................................78 Aspect:ResourceMonitoring.................................................................................................79 6.1 ManualResourceMonitoring............................................................................................80 6.2 AutomatedResourceMonitoring.......................................................................................84 Aspect:DataManagement ....................................................................................................85 7.1 ClassicqRFC ...................................................................................................................85 7.2 BackgroundRFC..............................................................................................................86 7.3 ManualDataVolumeMonitoring.......................................................................................87 7.4 AutomatedDataVolumeMonitoring..................................................................................87 SetupProcedureforanAutomatedInterfaceMonitoring ........................................................88 8.1 AutomatedqRFCMonitoring ............................................................................................89 8.2 AutomatedtRFCMonitoring .............................................................................................90 8.3 AutomatedbgRFCPerformanceMonitoring......................................................................92 8.4 AutomatedRFCPerformanceMonitoring .........................................................................92 8.5 AutomatedRFCConnectionMonitoring............................................................................96 GenericPart..........................................................................................................................99 9.1 PerformanceMonitoring ...................................................................................................99 9.2 Generalinformation..........................................................................................................99 9.2.1 Procedure ..............................................................................................................100 9.2.2 TransactionST03N ................................................................................................101 9.2.3 TransactionSTAD..................................................................................................102 9.2.4 TransactionST05...................................................................................................106 9.2.5 TransactionSE30..................................................................................................106 9.2.6 TransactionST12...................................................................................................107 9.3 GeneralMonitoringGuidelinesforaSAPSystem ...........................................................108 FurtherInformation.............................................................................................................. 111

10

2008SAPAG

1 Introduction
1.1 Applicability, Goals, and Requirements
ToensurethatthisBestPracticeistheoneyouneed,considerthefollowinggoalsandrequirements.

GoalofUsingthisService
ThisBestPracticehelpsyousetupanInterfaceMonitoringconceptwiththefocusonRFCMonitoring foryourSAPsolution.ThisdocumentoutlinespossibilitiesonhowbesttomonitorRFCbased interfacesmanually,aswellasautomatically,byusingSAPSolutionManager.Bothmonitoring approachesaimtodetectanyirregularitiesordeviationsortodetecterrorsituationsatanearlystage. Theseproceduresintendtoensurethattheinterfaceprocessingmeetstherequirementsforstability, performanceandcompletenessaswellasasmoothandreliableflowofthecorebusinessprocesses sothatyourbusinessrequirementsaremet.

AlternativePractices
YoucanhaveSAPexpertsdeliverthisBestPracticeonsitebyorderingaSolutionManagement Optimization(SMO)serviceforSAPInterfaceManagementorSAPBusinessProcessManagement. TheseservicesareexclusivelyavailablewithinanSAPSupportEngagement,thatis,SAP MaxAttention,SAPSafeguardingorSAPPremiumSupport.

StaffandSkillsRequirements
ToimplementthisBestPractice,yourequirethefollowingteams: ApplicationManagementTeam Thisteamprovidestheinformationonthebusinessbackgroundoftheinterfacesusedandknowsthe necessarybusinessrequirementsfortheinterfaces: Businessdepartment Solutionsupportorganization(forexample,theBasisSupportortheApplicationSupport) Implementationprojectteam

BusinessProcessOperationsTeam TheBusinessProcessOperationsteamwillberesponsibleforapplyingtheresultingprocedures, derivedfromimplementingthisbestpractice.Theyincludethefollowinggroups: Personsdesignatedtoperformbusinessprocessorientedmonitoringandensurethatthe processrunssmoothly(forexample,theBusinessProcessChampionforeachbusiness process) AllpartiesinyourSolutionSupportOrganizationandITdepartmentinvolvedinmonitoring focusedontheapplicationaspects(ApplicationSupport,DevelopmentSupport,Job SchedulingManagement) SAPTechnologyOperationsTeam AllpartiesinyourSolutionSupportOrganizationandITdepartment,whoareinvolvedin monitoringfocusedonthesystemadministrationside(ProgramSchedulingManagement, SoftwareMonitoringTeam,SystemAdministrationTeamincludingtheSystemAdministrator) BusinessProcessChampion TheBusinessProcessChampionisthepersoninthebusinessdepartmentwhois responsibleforthesuccessfulexecutionofthebusinessprocess.He/shecoordinatesall activitiesnecessaryforthebusinessprocess.Therefore,he/sheisusuallyresponsibleforthe escalationpathsincaseofproblems.TheBusinessProcessChampionisoftenasecond levelintheescalationprocedure,iftheapplicationmonitoringteamneedstoescalatean issue.

BestPractice:RFCMonitoring

NecessaryorUsefulTrainings
q q q q

BIT300InterfaceTechnologyOverview SMO610BPMtrainingcourse ADM105AdvancedR/3SystemAdministration ADM315 WorkloadAnalysis

SystemRequirements
TosetupautomatedRFCmonitoringontheSAPSolutionManager,theaddonsSTPI(ofany release)andSTA/PI(asofrelease01H)havetobeinstalledontheconnectedsatellitesystems.

DurationandTiming
Duration CreatinganInterfaceMonitoringconceptdependsverymuchonthecomplexityofyourinterface landscapeandcouldtakearoundoneweekforabout10interfaces. Timing ThebesttimetoapplythisBestPracticeisduringtheplanningphaseorduringtheimplementation phaseofyourSAPsolution.

HowtousethisBestPractice
Thisdocumentgivesyouanoverviewoninterfacemonitoringtoolsandproceduresforthedifferent RFCtypes.Theaimisnottonameallavailablemonitorsandtoolsbuttofocusonthemore suitablemonitorsandtoolsforeachoftheaspectsdiscussed. Havinggotageneralideaofthemonitoringpossibilities,youshouldevaluatewhicharethecritical errorsituationsinyoursystemlandscapeanddecidewhichmonitoringprocedureissuitableinyour case.Wedonotrecommendsettingupafullblownmonitoring,butconcentratingonselectivealert situationsthatwillinformyouinexceptionalcases. Inthenextstep,youcanfollowthesetupprocedureandimplementthemonitoringonyour systems.Inthecaseofbusinessprocessrelatedmonitoringobjects,youhavethepossibilityto setupamonitoringconcept, focusedonbusinessprocessmonitoringandinvolveyourapplication teamsinmonitoringanderrorresolutionactivities. Forabetterunderstandingofwhatshouldbemonitored,itisessentialtounderstandtheRFC techniquesandtheirdependencies.Thefirstsectionwillgiveyouageneraloverviewofthe differentRFCs.ThesecondonewillguideyouthroughthesetupoftheautomatedRFCmonitoring possibilitieswithinSAPSolutionManager. Sections3to8listmonitoringobjects,bothformanualaswellasautomatedmonitoring procedures,concentratingonthefivemajorareas:ResourceMonitoring,ErrorMonitoring, BacklogMonitoring,PerformanceMonitoringandDataManagement. Themonitoringobjecttableslistthefollowinginformation: o Monitoringobject o Monitoringtransactionortool o Monitoringfrequency o Indicatorforanissueorerror o Monitoringactivityorerrorhandlingprocedure o Responsibility o EscalationProcedure ThelastSection,GenericPartincludesinformationonscenarioindependenttools,forexample, performancemonitoring.

2008SAPAG

BestPractice:RFCMonitoring

1.2 Best Practice Procedure


1.2.1 MotivationforInterfaceMonitoring
Todayssystemlandscapesareoftendecentralizedandcanconsistofvariousinterfaces.Different SAPsystems,legacyenvironmentsandbusinessentitiesareintegratedusingdifferentinterface technologies.Allthoseinterfacesneedtobemonitoredintermsofresourceavailability,processing errors,backlogsituationsandperformance. ITOperationreliescompletelyon100%dataconsistency.Withanincreasedcomplexityofsystem landscapes,wefaceanincreasedriskofdatainconsistencies.Fortheirearlydetectionspecificdata consistencyreportshavetobeexecutedonaregularbasisanddetailederrorhandlinganddisaster recoveryproceduresneedtobedefined.Proactiveinterfacemonitoringhelpstoidentifyandavoid inconsistencies.

1.2.2 PreliminaryTasks
BeforeperformingthisBestPractice,ensurethatyouperformthefollowingpreliminarytasksor checksinthesystem: Completeallinstallationandpostinstallationactionsandproceduresincludingcustomizing Ensurethattheinitialdownloadhasbeensuccessfullyexecuted ApplyallSAPrecommendationsfromSAPServiceSessionsandanySAPrecommendations resultingfromcustomerproblemmessages ImplementallcurrentSAPSupportPackagesuponavailability

1.2.3 InterfaceMonitoringconcept
ForasuccessfulandefficientInterfaceMonitoringconcept,aprocessfortheexecutionofthe monitoringconcepthastobedefined.Thisincludesthedefinitionoftherolesandresponsibilities involved.Youneedtodefinewhoissupposedtocarryoutwhichactivityandhowisthe communicationbetweenthedifferentroleswithinthesupportorganizationsupposedtotakeplace. AnInterfaceMonitoringconceptmustbetightlyintegratedwiththesupportorganization.Thisincludes theintegrationwiththeIncident/ProblemManagementprocessandtheChangeManagementprocess. Theseprocesseshavetobeadjustedsothatcommunicationandescalationprocedurescontained withintheseprocessesareadequatetosupporttheInterfaceMonitoringconcept.Thisincludesthe finalcommunicationofopenalertstoSAP. WherevercommunicationconnectedwithInterfaceMonitoringhappensoutsidethesesupport processes,separatecommunicationandescalationpathsandprocedureshavetobedefined.

PleaseseetheseparateBestPracticeforGeneralBusinessProcessManagementforfurtherdetails navigatingtohttp://service.sap.com/solutionmanagerbp>Topicarea>GeneralBusinessProcess Management.

1.2.4 Legend
Thissymbolindicatesaparagraphfromwhereyoucannavigatetoanothersectionorother documents formoredetailedinformationonatopic.

Thissymbolindicatesyouaparagraphfromwhereyoucannavigatetoanotherdocument withintheSAPServiceMarketplaceformoredetailedinformationonatopic.

2008SAPAG

BestPractice:RFCMonitoring

2 General Overview of RFC and RFC types


2.1.1 RemoteFunctionCall
TheRFCinterfacesystemisthestandardSAPinterfaceforcommunicationbetweenapplicationsof differentsystemsintheSAPenvironment,whichincludesconnectionsbetweenSAPsystemsaswell asbetweenSAPsystemsandnonSAPsystems. Aremotefunctioncall(RFC)isthecallofaremoteenabledfunctionmodule(RFM)thatrunsina partnersystem.AlthoughitisalsopossibletocallafunctionmoduleinthesamesystemasanRFC, RFCsarenormallyusedwhenthecallerandthecalledfunctionmodulerunindifferentsystems.The callingsystemistheRFCclientandthecalledpartnersystemistheRFCserver.RFCisbasedonthe wellknownremoteprocedurecall(RPC)modelfromtheUNIXTCP/IPenvironment.RFCintheSAP environmentisbasedonaCPICinterfaceimplementedbySAP. TheRFCcommunicationprocessbeginswithanapplicationissuingthecommandCALLFUNCTION <function>DESTINATION<dest>(where<function>representsaremoteenabledfunctionmodule inthetargetsystemwhichisdefinedby<dest>),thisgeneratesanRFCrequestwithinaworkprocess intheRFCclient(thatis,adialogorbackgroundworkprocessinitiatedbytheapplication).TheRFC requestisserializedintheworkprocessfortransmissionoverthenetworkandpassedtothetarget system.TheRFCrequestcanincludevariousparameters: Connectionparameters:Thehostname,portnumber,logoninformation,ofthetargetsystem.This informationismaintainedviatransactionSM59. Runtimedata:Thisisthenameoftheremotefunctionmoduleaswellasanyspecifiedinput parameters(Thatis,importing,exporting,changingtableparameters). ThelocalgatewayontheRFCclientopensaTCP/IPconnectiononthetargetgateway(RFCserver) andtransmitstherequesttoit.Thetargetgatewaythenallocatesataskatthetargetdispatcherwhich identifiesanavailabledialogworkprocesstoprocesstherequest.Theworkprocessonthetarget systemthendeserializesandexecutestherequestandreturnstheresultfollowingthesame sequenceinreverse(dispatcher>gateway>dispatcher,andsoon).RFCsessioncontextdatais rolledinandoutduringtheprocess(whentheclientiswaitingforaresponseandaftertheserverhas issueditsresponse),thusfreeingupresources(memoryandworkprocesses).

Figur e1 RFCpr ocesscommunicationcycle 2008SAPAG 6

BestPractice:RFCMonitoring

2.1.2 GeneralOverviewofRFCTypes
TherearefivebasictypesofRemoteFunctionCalls: o o o o o SynchronousRFC(sRFC) AsynchronousRFC(aRFC) TransactionalRFC(tRFC) QueuedRFC(qRFC) BackgroundRFC(bgRFC)

Inthefollowingsections,wewillexplaintheuniquerolesofeachRFCtypeandhoweachRFCtypeis created.

2.1.2.1SynchronousRFC(sRFC)
SynchronousRFCinvolvesexecutingfunctioncallsbasedonsynchronouscommunication,which meansthatthesystemsinvolved(RFCClientandRFCServer)mustbothbeavailableatthetimethe RFCcallismade.AsRFCismadebycallingafunctionviatheCALLFUNCTIONstatementwith extensionDESTINATION,whichidentifiesthetargetsystem.

Figur e2 Pr ocessflowSynchr onousRFC WhentheRFCclientmakesthecalltotheRFCserver,processingstopsinthecallingprogram.While waitingfortheconnectiontotheRFCserver,noCPUisconsumedandtheworkprocessisnot availableforotherrequests.AfterestablishingtheconnectionandwhiletheRFCisrunningonthe RFCserver,thesenderprogramcontextrollsoutofitsdialogworkprocess.Theworkprocessisthen freeforotherrequests.WhentheRFCserverprogramreturnsresultstothesenderprogramonthe RFCclient,thesenderprogramcontextisrolledinagainandtheRFCclientcallingprogramcontinues processing.

2008SAPAG

BestPractice:RFCMonitoring Synchronousscenarioshavehigherrequirementsforsystemavailabilityandperformanceandthey alsorequirecomplexerrorhandling,thatis,iftheRFCclientisusingsynchronousinterfacesto manipulatedataintheRFCserversystem,youareforcedtoimplementyourowntransactionalID handlingtoguaranteethatthedataisnotsentandprocessedtwice.Therefore,thereceiving applicationhastocheckifthesamedatahasalreadybeenreceived(andprocessed).Therefore,the programmingonthesenderandthereceiverisquitecomplexandrequiresthoroughprogramming withregardtoerrorproofprocessing. Forthesereasons,SynchronousRFCcallsarepreferablyusedforreadonlyaccessestoremote systems,forexampleforanavailabilitycheck formaterial.

2.1.2.2AsynchronousRFC(aRFC)
AsynchronousRFCisanasynchronouscommunicationmethodthatexecutesthecalledfunction moduleintheRFCserver.Youcanuseasynchronousremotefunctioncallswheneveryouneedto establishcommunicationwitharemotesystem,butdonotwanttowaitforthefunctionsresultbefore continuingprocessingthecallingprogram. TheABAPcodetoenableasynchronouscommunicationdiffersfromsynchronousonlyintheaddition ofthekeywordsSTARTINGNEWTASK<taskName>whereby<taskName>canbeanyunique characterstring.

Figur e3 Pr ocessflowAsynchr onousRFC InanasynchronousRFC,thecalledremotefunctionisstartedimmediatelyinthecallingprogramand then continues processing on its own, independent of the calling program.With aRFC you have the optiontomaketheaRFCnothandle(aRFCwithoutresponse)ortohandle(aRFCwithresponse)the remotefunctionoutput.

2.1.2.2.1AsynchronousRFCwithoutResponse
InthecaseofRFCwithoutresponse,theRFCconnectionclosesimmediatelyafterthesuccessful checkforavailabilityoftheRFMmeaning,ifanyerrorsoccuraftertheconnectioncloses,forexample iftheRFCauthoritycheckwhichverifiesiftheRFCuserisabletoexecutetheRFMfailstheRFC clientcallingprogramisnotnotified.Fromaperformancepointofview,closingtheconnectionso quicklyisnotoptimal,especiallyifitisrequiredtomakemultipleRFCcallstothesamedestination.It isimportanttoconsiderthiswhenimplementingaRFC.

2008SAPAG

BestPractice:RFCMonitoring

Figur e4 aRFCwithoutr esponse

2.1.2.2.2AsynchronousRFCwithresponse
WithaRFCwithresponse,youcanreceiveresultsfromtheremotefunctionmodule.Inorderto implementaRFCwithresponse,theABAPstatementPERFORMING<subroutine>ONENDOF TASKisused,wherethespecifiedsubroutinemustexistinthecallingprogram(RFCclient).The ABAPcodetospecifyasubroutinetakestheformat:

FORM<subroutineName>USING<taskName>. RECEIVERESULTSFROMFUNCTION<remoteFunctionName>

TheRFCclientcallingprogramstartstheremotefunctionanditcontinuesprocessingonitsown, independentofthecallingprogram.Thecallingprogramcontinuestoasynchronizationpoint,thatis,a WAITUNTILstatementisreached,theconditionsspecifiedarechecked.Ifthestatementisfulfilled, theprogramprocessingcontinuesdirectlyaftertheWAITUNTILstatement.OtherwisetheRFCclient waitsinrolloutstatusfortheoutputfromtheremotefunctionmodules.

Whentheremotefunctionmodulefinishesprocessingthespecifiedsubroutineiscalledautomatically andtheremotefunctionmoduleoutputisretrievedusingtheRECEIVERESULTSFROMFUNCTION statement.ThekeywordUSING<taskname> isimportantwhenthesubroutineiscalled<taskname> receivesthetasknameofthecallingprogram(specifiedbySTARTINGNEWTASKinthecalling program).ThisparameterletsyouseewhichaRFCcalljustended. Whenthesubroutinehasbeen executed,RFCconnectionsareclosedandcontrolissentbacktotheWAITUNTILstatementinthe callingprogram.Thischeck/waitprocedurerepeatsuntiltheWAITconditionsarefulfilled,oruntilthere arenomoreopenRFCconnections.

2008SAPAG

BestPractice:RFCMonitoring

Figur e5 aRFCwithr esponse TheadditionKEEPINGTASKwiththeRECEIVEstatementcausesthefunctiongroupcontextthat wasloadedremotelytowaituntilthecallingprogramhasended.Thisletsyouusethesameremote contextforlateraRFCswiththesametasknameanddestination.

Figur e6 aRFCwithr esponse(additionofkeepingtask)

2.1.2.2.3AsynchronousRFCLoadDistribution
AsynchronousRFCisdesignedforparallelprocessing,thatis,theRFCclientmakescallstotheRFC serverstartstheremotefunctionmodule,controlispassedbacktotheRFCclientwhichcanthen makeadditionalaRFCs.AsynchronousRFCdoesnotassesstheloadontheRFCserver.When makingalargenumberofaRFCcalls,theSAPservercangetoverloaded,afterallaRFCinvolves askingthesystemtoinitiateandmanageRFCcallswhilecontinuingtomanagethemainprogramand 2008SAPAG 10

BestPractice:RFCMonitoring perhapsqueuingupothersessionstoexecuteatthesametime.ItispossiblethattheRFCServer runsoutofresources,thatis,memory,CPU,workprocesses.IftheaRFCcallsaremadewithinthe samelogicalSAPsystem,thereisawaytoavertthisoverloadingoftheRFCserver.Whencallinga functionmodule,youcanspecifyapredefinedRFCgroup(insteadofasingleserver)usingthe additionDESTINATIONINGROUP<RFCgroup>(maintainedintransactionRZ12orSAPRFC).This additionselectsthenextfreeserverinthegrouptoexecutethefunctionmodule.Thisisachievedby specifyingtheadditionDESTINATIONINGROUPafterSTARTINGNEWTASK.Youcanonlyusethis additionwithinthesamelogicalsystem.YoucannotspecifyaremoteDESTINATION.Insteadof specifyingaspecificRFCgroup,youcanalsoenterthewordDEFAULT.Theserverisselectedfrom alltheapplicationserversoftheR/3System.Ifalltheserversofthespecifiedgroupareoverloaded, theexceptionRESOURCE_FAILUREistriggeredandthiscanbehandledbytheRFCclientcalling program. RefertosectionMaintenanceofRFCservergroupsformoreinformation.

2.1.2.3TransactionalRFC(tRFC)
TransactionalRFCisanasynchronouscommunicationmethodthatexecutesthecalledfunction moduleintheRFCserveronlyonce(exactlyonceexecution(EO)).Thereceivingsystemneednotbe availableatthetimewhentheRFCclientprogramisexecutingatRFC.Incasethereceivingsystem isnotavailableorincaseofcommunicationerrors,systemerrorsorapplicationerrors,thetRFC componentstoresthecalledRFCfunction,togetherwiththecorrespondingdata,intheSAPdatabase underauniquetransactionID(TID).Then,abackgroundjob,RSARFCEX,canbescheduledto restartthetRFC.Inaddition,incaseofanerrortheinvolvedsystemscancheckforduplicatedelivery usingtheTID.ThisisincontrasttosRFCandaRFCwhereyouhavetohandleerrorsexplicitlyand youhavetobuildyourownmechanismforreissuingcallsatalatertime. YoucanusetRFCifyouinserttheadditionINBACKGROUNDTASKbeforetheDESTINATION statement.IfyouspecifyaCOMMITWORKstatement,allRFCsinthecallingprogramarebundled intoaLUWandareexecutedontheRFCserverifthespecifiedfunctionshavethesamedestination theyformoneLUW,ifthespecifieddestinationsdiffereachisexecutedinaseparateLUW.

Figur e7 Pr ocessflowtr ansactional RFC

2008SAPAG

11

BestPractice:RFCMonitoring Onatechnicalleveltheprocessworksasillustratedbelow:

Figur e8 tRFCmechanism ThetRFCqueueconsistsoftablesARFCSSTATEandARFCSDATAonthesendersideand ARFCRSTATEonthereceiverside.TheSTATEtablescontainstatusinformationaboutthetRFCcall ontherespectivesideswhiletheDATAtablescontainthelistoffunctionmodulestobecalledtogether withtheirparametervalues. l Step1:TheRFCfunctiontobecalledtogetherwithitsparametervaluesiscopiedintothe tRFCqueue(ARFCtables).ThisistriggeredbytheCOMMITstatementinthesenderLUW. l Step2:Thedata(functionmoduleanditsparameters)istransferredbyasynchronousRFCof theinternalfunctionARFC_DEST_SHIP.OnthereceiversidethedataisstoredinthetRFC queuefirst.ThisstepisnottriggereduntiltheV1updateassociatedwiththeCOMMIT statementonthesendersidehassuccessfullycompleted. l Step3:Thefunctionmoduleisexecutedinadialogworkprocessonthereceiverside. l Step4:ARFC_DEST_SHIPreturnsthestatus(success,systemfailure,communication failure)oftheexecutionofthefunctionmoduletothesender. l Step5:IfthestatusreturnedbyARFC_DEST_SHIPis'successor'systemfailure',thesender callsinternalfunctionARFC_DEST_CONFIRMviasRFC.Ifthestatusreturnedby ARFC_DEST_SHIPis'communicationfailure',thesenderdoesnotknowtheprocessing statusonthereceiverside.Inthiscase,thesendercanrepeatthetRFCcallatalatertime. l Step6:TheexecutionofARFC_DEST_CONFIRMdeletesthecorrespondingentriesfromthe tRFCqueueonthereceiverside. l Step7:OnreturnofARFC_DEST_CONFIRM,thesenderdeletesthetRFCentriesfromthe sendertRFCqueue.

tRFCisalwaysusedifafunctionisexecutedasaLogicalUnitofWork(LUW).WithinaLUW,allcalls are 1. Executedintheorderinwhichtheyarecalled 2. Executedinthesameprogramcontextinthetargetsystem 3. Runasasingletransaction:theyareeithercommittedorrolledbackasaunit. ImplementationoftRFCisrecommendedifyouwanttoguaranteethatthetransactionalorderofthe callsispreserved. 2008SAPAG 12

BestPractice:RFCMonitoring

Inthesourcesystem,youcanusetheadministrationtransactionSM58todisplay,execute,debugand deletetRFCLUWs thatarehanginginthecommunicationlayer.Entriesthatremainhanginginthe tRFCqueueshouldbeinvestigatedthecolumnstatustextdetailsthereasonforamessagehanging inthetRFCcommunicationlayer.

Called Function Modules

Target system

Error Message

TID

Figur e9 Administr ationandmonitor ingoftRFC

2.1.2.4QueuedRFC(qRFC)
WithtRFC,generatedLUWsareprocessedindependentlyofeachother.Therefore,theorderinwhich theyareprocessedisnotalwaystheorderinwhichtheyaregenerated.Toguaranteethatmultiple LUWsareprocessedintheorderspecifiedbytheapplication,tRFCcanbeserializedusingqueues (inboundandoutboundqueues).ThistypeofRFCiscalledqueuedRFC(qRFC).qRFCistherefore anextensionoftRFC.IttransfersaLUW(transaction)onlyifithasnopredecessors(inreferenceto thesequencedefinedindifferentapplicationprograms)intheparticipatingqueues.Implementationof qRFCisrecommendedifyouwanttoguaranteethatseveraltransactionsareprocessedina predefinedorder.

Figur e10 qRFCpr ocessing YoucanuseqRFCifyouinserttheadditionalABAPstatements TRFC_SET_QUEUE_NAME(touse outboundqueues)orTRFC_SET_QIN_PROPERTIES (touseinboundqueuesandoutboundqueues) beforetheregulartRFCstyleCALLFUNCTIONstatement.Thecalltofunction TRFC_SET_QUEUE_NAME/TRFC_SET_QIN_PROPERTIEStellsthesystemintowhichqueuesto insertthenextRFCcall 2008SAPAG 13

BestPractice:RFCMonitoring

Figur e11 qRFCusingoutboundqueues

Figur e12 qRFCusinginboundqueues

2.1.2.4.1QueueMonitoring/Administration
IntheSAPenvironment, inboundandoutboundqueuesaremonitored/administeredusingthequeue administrationtransactionsSMQ1(outboundqueues)andSMQ2(inbound).Thefollowingfunctions areavailable. Listqueues DisplayqueueswithalistofaccompanyingLUWsandfunctionmodulesincludinginputdata Start/stoptransmittingthequeues Deletequeuesorqueueentries

2008SAPAG

14

BestPractice:RFCMonitoring

Figur e13 SMQ1qRFCmonitor for outboundqueues

Figur e14 SMQ2qRFCmonitor for inboundqueues

2008SAPAG

15

BestPractice:RFCMonitoring

2.1.2.4.2OutboundandInboundSchedulers
qRFCmakesuseoftwoschedulersanOutboundSchedulerandanInboundScheduler.The schedulersareintendedtodistributetheloadovertheavailablesystemresourcesbothschedulers comeasSAPstandard.

2.1.2.4.3OutboundScheduler
Ontheoutboundside,theloadimposedonthereceivingsystemislimitedbythenumberofqueues.If alargenumberofqueuescanbefilledsimultaneously,queuesdonotsufficientlycontrolresourceson thereceivingsystem.TheOutboundScheduler(transactionSMQS)providesmoreexactcontrolover resourcesonthereceivingsystem.Youcanconfiguretheoutboundschedulertolimitthenumberof requestssentatthesametimetoanRFCdestinationeitherviaqRFCorviatRFC.

Figur e15 Tr ansactionSMQS Outboundscheduler configur ation Normally,theOutboundSchedulerdoesnotworkcontinuously,therefore,itsstatusonqueuelevelis usuallyshownasINACTIVE.Itonlystartsworkingifnewentriesarestoredinanoutboundqueueor ifatRFCissenttoadestination.TheOutboundSchedulerismonitoredandconfiguredusing transactionSMQS.Youcanmonitortheschedulerstatusandregisternewdestinations.Inorderto registeradestination,choosethebuttonRegistration. Someimportantparameterswhichcanbesetusingtheoutboundschedulerarelistedbelow: MAXCONN: Max.connectionsforadestination(max.DIALOGworkprocessesinsending andreceivingsystem).Defaultis1fordestinationoftypeT(nonSAP)and10fordestination oftype3(SAPsystem). MAXTIME: Max.runtimeforadestination.Defaultis60seconds(shouldnotbeset lower).Definesthetimehowlongtheprocessingofthisspecificqueueisdoneuntilentriesof thenextqueuesareprocessed.

MaintenanceofRFCServerGroups: AgroupofapplicationserverscanbedefinedviaRZ12andassignedwithinSMQStoadestination. ToassignanRFCservergroupfortheoutboundschedulerthatwillprocesstherequeststobesent, chooseEditChangeASgroup.Thisallowsallrequeststothedestinationtobeprocessedinthis servergrouponly.ThemaximumnumberofdialogworkprocessesusedbytheOutboundScheduler canalsobedefinedviaRZ12.(SeeSAPNote74141:ResourcesManagementforaRFC/tRFC/qRFC) Inaddition,adestinationcanalsobeexcludedfrombeinghandledthroughtheOutboundScheduler, thiscanbedonebyregisteringthedestinationinSMQSandthenselectingthedestinationand choosingEditExclude.ThedestinationthenappearsastypeN,likedestinationPRDinthe exampleabove.IfadestinationisexcludedfromtheScheduler,thetransmissionisexecutedas before(immediatelyandasynchronouslytotheapplication).Bearinmindthatthismaycause resourcebottleneckproblemsinconnectionwithupdates.SeeSAPNote484753,regardinga descriptionofthedifferenttypesofOutboundSchedulerregistration.TheOutboundSchedulerruns withtheservergroupDEFAULTasapresetting.Thismeansthatallapplicationserversofthelocal SAPsystemareusedtoactivatealltheregisteredqueues.TheservergroupDEFAULTdoesnotneed 2008SAPAG 16

BestPractice:RFCMonitoring tobecreatedanditisnotvisibleintransactionRZ12. Theservergroupdefaultshouldnotbeusedin highvolumesystemsasitcanleadtosystemresourceoverload.

Figur e16 tr ansactionRZ12 RFCser ver gr oupmaintenance

Figur e17 AssignmentofanRFCser vergr ouptotheoutboundscheduler TheQOUTSchedulerisespeciallyadvantageous,whenmanytRFCsarecreatedwithinashorttime ormanydifferentqueuestoasingledestinationareused.Inthesecases,youcanbalancethe workloadbylimitingtheamountofparalleltasksperdestination.OnlytRFCs/qRFCsusing destinationsthatareregisteredinSMQSareprocessedbytheOutboundScheduler.

2.1.2.4.4InboundScheduler
Wheninboundqueuesareused,allLUWsaretransferredtotheinboundqueuebeforebeing processed.Normally,noneoftheLUWswrittenintheinboundqueueareautomaticallyexecuted. EachapplicationcanactivatethesequeuesusingAPIs(viacallingFMTRFC_QIN_ACTIVATEor QIWK_REGISTER).ToavoideachapplicationhavingtowriteaspecificinboundschedulerqRFC supportsageneralinboundscheduler(transactionSMQR).TheInboundSchedulerisconfiguredon thebasisofqueuenames.Ifnewqueuenamesareused,theymustberegisteredusingtransaction SMQR>>RegistrationorviaFMQIWK_REGISTERotherwisetheirentrieswillnotbeprocessed. LiketheOutboundScheduler,theInboundSchedulerdoesnotworkcontinuously.Itsstatusisusually shownasINACTIVE.Itonlystartsworkingifnewentriesarestoredinaninboundqueue. The InboundSchedulerdoesnotprocesstheLUWsbuttriggerstheirprocessinginasynchronouslystarted workprocesses.FortheInboundScheduler,itisalsopossibletocreate(transactionRZ12)andto assign(SMQR>>EDIT>>ChangeASGroup)anRFCservergrouptolimittheresourcesavailable forprocessing.TheInboundSchedulerrunswiththeservergroupDEFAULTasapresettingandin highvolumesystemstheDEFAULTservergroupshouldnotbeusedduetopotentialforsystem resourceoverload.

2008SAPAG

17

BestPractice:RFCMonitoring

Figur e18 Tr ansactionSMQR InboundScheduler configur ation SomeimportantparameterswhichcanbesetwhileusingtheInboundSchedulerarelistedbelow EXEMODE:Dfordialog,Bforbackground,dependingonthetypeoftheworkprocessthat shouldbeusedforprocessingqueueentries. MAXTIME:Timespentbytheinboundschedulerforworkingonthequeue.Ifthistimelimitis exceeded,butaLUWofaqueueisstillrunningtheschedulercompletedthisLUWandthen afterwards,theLUWsofotherregisteredqueuesaredistributedtoworkprocessesbythe inboundscheduler. USERDEST:Logicaldestination(definedintransactionSM59)forprocessingLUWsinthis queue.Thisenablesyoutochangetheclient,user,andlanguageforallqRFCLUWs. NRETRY:Numberofretries TDELAY:Delaybetweenretries

SeealsoSAPNote369007forconfigurationoftheinboundscheduler

2.1.2.5BackgroundRFC(bgRFC)
2.1.2.5.1IntroductiontothebgRFC
ThebackgroundRFC(bgRFC)isofferedasareplacementfortheclassictRFCandqRFC.Itis availablewithSAPNetWeaver2004s(SAPBasis7.00).WithSAPNetWeaver7.1(SAPBasis7.10) therearesomechangesregardingtheconfigurationandmonitoring.Thisdocumentisbasedonthe 7.10version. bgRFCisasuperordinatetermforthenewversionoftRFCandqRFC.Aparallelrunofclassic tRFC/qRFCandbgRFCispossible. ThebackgroundRFCworksonthebasisofunitsandperformsbettercomparedtotheclassictRFC andqRFCversions.ItcomeswithanewAPIanddatamodel.

2008SAPAG

18

BestPractice:RFCMonitoring Terminology: Theterm"unit"forthebgRFCcanbecomparedwiththeterm"LUW" forclassictRFC/qRFC. o Soaunitisarecordedsequenceofcollectedfunctioncallstobeperformedremotely. o TherecordedunitdataispersistedinthedatabaseatCOMMITWORK. Theterm"destination"forabgRFCunitdefineseitheraremotesystemforoutbound scenarios,oradistinctnameforanapplicationinaninboundscenario. o OutbounddestinationsaremaintainedviathestandardtransactionSM59 o InbounddestinationsaremaintainedviathespecifictransactionSBGRFCCONF ThebgRFCisbasedonaschedulerdrivenqueuingframework.Thismeansthatremotefunctioncalls arerecorded,andexecutiontakesplaceatalaterpointintime,whichiscontrolledautomaticallybya schedulerprocess.SeveralschedulerscanbestartedtoprocessbgRFCunits. Itsupportsthefollowingscenarios: Processingonaremotesystem(outboundscenario) o Usecase:Asynchronoustransactionalprocessingoffunctioncallsinaremote systemprocessingiscontrolledbythecallersystem(intersystemcommunicationfor SAPtoSAPandSAPtononSAP) Processingremotelybytheinboundscheduler(outboundinboundscenario) o Usecase:Asynchronoustransactionalprocessingoffunctioncallsinaremote systemprocessingiscontrolledbythereceiversystem(intersystemcommunication forSAPtoSAP) Processingonthesamesystem(inboundscenario) o Usecase:Asynchronoustransactionalprocessingoffunctioncallsinthesame system(intrasystemcommunication=samesystemandsameclient)

OutboundScenario

OutboundInbound Scenario

OutboundScheduler InboundScheduler Inbound Scenario

Figur e19 Over viewonthebgRFCscenar ios Inaddition,thereisasuccessortotheqRFC's"NoSend"scenario,whereoutboundcallsare recorded,butnotsentbytheoutboundscheduler(pullprinciple).Instead,thereceivingsystemis supposedtofetchitsRFCrecordsitself.InthebgRFCcontextthisiscalledLocalDataQueue(LDQ). ThebgRFCprovidestwoqualitiesofservice(QoS)forremotefunctioncalls(asynchronous transactionalsystemtosystemcommunication):

exactlyonce(EO)=>transactionalunits(liketheclassictRFC)
o Eachunitisanindependentthread

exactlyonceinorder(EOIO)=>queueunits(liketheclassicqRFC)
o Unitswithsequencedependencies

2008SAPAG

19

BestPractice:RFCMonitoring ValidCombinationsofQoSandScenario: QoS tRFC(EO) qRFC(EOIO) Inbound X X Outbound X X Outboundto Inbound X (NoSend) X

2.1.2.5.2AdvantagesofthebgRFC
TheprimarygoalofthebgRFCprojectistoimprovetheruntimebehaviorofqRFCwhileremaining compatiblewiththeqRFCsexistingprotocolandavoidingdowntimeinaffectedsystemswhen customersupgradetothenewversion.Theimproveddesignprocesseslargeamountsofhighly sequentialdata,suchasthedatafoundinSCMscenarios,muchmoreefficiently.ThenewbgRFCis availablealongsideqRFC.Itisnotpossibletomixthenewprocedurewiththeclassicfunctions.Itis possible,however,tousebothproceduresinparallel.Sincethereisnooverlapbetweenthetwo procedures,andinanefforttopreventerrors,youspecifywhichprocedureistobeusedforoutbound processingatthedestination.Thatmeansthatalltransactionsthatdefinedependenciesbetweentheir qRFCcallshavetoeitherswitchtothenewbgRFCprocedure,orhavetosticktotheexisting procedure.SynchronousandasynchronousRFCarenotaffected. TheclassicqRFCmodeldetectsthedependenciesamongtheindividualunitsonlywhenthedatais processedbytheRFCscheduler.Foreachdestination,theoutboundschedulerstartsadestination schedulerthatprocessesthedataforaspecificdestination.Thedestinationschedulersrunoneach destinationonlyforalimitedperiodoftime,tobalancetheloadbetweenalldestinations.Beforeeach destinationisprocessed,theorderofthedestinationsmustbedeterminedagainbythedestination scheduler. ThenewbgRFCdesigntakescareofthisproblembydetectingthedependenciesatthetimethedata isstored.Indoingso,theRFCschedulercanfindallunitsthatcanbeexecutedinstantlywith minimumeffortandalldependenciesaredetectedonlyonce.Theadditionaleffortwhenstoringthe dataiscompensatedtoalargeextentbyefficientalgorithmsandoptimizationsinthedatabasedesign. Foreachclient,anumberofoutboundschedulersarestartedthatsharetheworkload.ThenewRFC schedulersreactmoresensitivelytotheloadinthetargetsystems.Inthepreviousmodel,theload balancingwasbasedontheconceptofthelogongroups.Thismeansthattheinformationaboutthe loadinthedestinationsystemsavailableatruntimecouldbeuptofiveminutesold.Thisinformationis updatedatmuchshorterintervalsintheimprovedbgRFCdesign. Thegateways,anotherpotentialsourceofbottlenecks,havealsobeenoptimized.Thenewconcept regulatesthemaximumnumberofoutboundschedulersthatareallowedtorunatthesametimeon anapplicationserver,andthemaximumnumberofconnectionsthatallRFCschedulersareallowedto use.Thislimitationpreventsthelocalgatewayfrombecomingoverloaded.Thegatewaysofthe destinationsarealsoprotectedfromoverloadbymakingthenumberofparalleloutboundschedulers foreachsendingsystemandtheirmaximumnumberofconnectionsconfigurable. Importantdifference: ForthebgRFCthereisnoregistrationofqueuenames.IncontrasttoqRFCinboundyoucannot registerorderegisterqueues,inordertocontrolwhetherrequestshouldbeprocessedautomatically bytheschedulerornot.ThepropertywhetherabgRFCunitshallbeprocessedautomaticallyor manuallyviathemonitors,mustbesetforeachparticularunitatthetimeofcreation.

2.1.2.5.3BasicsyntaxforthebgRFC
Thenewsyntaxforcallingafunctionmoduleforbackgroundprocessing(previouslydoneusingper syntaxINBACKGROUNDTASK)isasfollows: CALL FUNCTION 'function_name' IN BACKGROUND UNIT unit EXPORTING TABLES Theobjectreferenceunit pointstoanobjectofthetypeIF_BGRFC_UNIT.Thisobjectcontainsall informationthatisneededtorunthefunctionmoduleinthebackground.Thisinformationiscomprised of,forexample,theexecutiondestination,thedistinctionbetweenqRFCortRFC,andprobablythe 2008SAPAG 20

BestPractice:RFCMonitoring numberofqueuesacrosswhichtheunitisspread.Ifthesameunitobjectisusedwithmultiple functionmodulecalls,thenallthesefunctionmodulesareexecutedinoneunit.Itispossibletouse multipleunitobjects,inparallel,withinasingleapplicationLUW.Consequently,multiplebackground unitscanbecreatedinparallelwithinanapplicationLUW.Inthepreviousversion,thiswaspossible usingtheASSEPARATEUNITsyntaxaddition.Theadvantageofthenewsolutionisthatmultiple backgroundunitscanacceptmultiplefunctionmodules.Intheeventofaninvalidunitobject,the exceptionCX_BGRFC_INVALID_UNITisraised. Adestinationobjectisrequiredtosendaunit.Thedestinationobjectrepresentsoneexecution destinationorasetofexecutiondestinations.Destinationobjectscanberequestedusingtheclass methodsfromtheclassCL_BGRFC_DESTINATION_OUTBOUNDfortheoutboundqueueandthe classCL_BGRFC_DESTINATION_INBOUNDfortheinboundqueue.Thedestinationfortheoutbound queuemustbemaintainedinthetransactionSM59andrepresentsanexecutiondestinationforthe outboundbgRFCtypetandtypeq.Thedestinationfortheinboundqueuemustbemaintainedinthe transactionSBGRFCCONF.Ifthedestinationisnotvalid,theexception CX_BGRFC_INVALID_DESTINATIONisproduced. Pleasenotethatintheactualremotefunctioncall(CALLFUNCTIONINBACKGROUNDUNIT) thereisnoDESTINATIONkeywordanymore. ProgrammingexampleofatransactionaloutboundbgRFC: DATA: my_dest TYPE REF TO if_bgrfc_destination_outbound, my_unit TYPE REF TO if_trfc_unit_outbound. my_dest = cl_bgrfc_destination_outbound=>create( 'MY_DEST' ). my_unit = my_dest->create_trfc_unit( ). CALL FUNCTION 'MY_RFC_FUNCTION' IN BACKGROUND UNIT my_unit. COMMIT WORK. ThiswouldcreateatransactionalbgRFCcalloffunctionmoduleMY_RFC_FUNCTIONtowardsthe outbounddestinationMY_DEST.

2.1.2.5.4ConfigurationofthebgRFC
BasicsettingsintransactionSBGRFCCONF: CreationofasupervisordestinationintransactionSM59,todefinetheuserunderwhichthe schedulerisrunning.Withoutthissupervisordestination,theschedulerscannotbestarted. ThecreatedsupervisordestinationisenteredintotransactionSBGRFCCONFandis afterwardslockedinSM59.

2008SAPAG

21

BestPractice:RFCMonitoring

Transaction SM59

Transaction SBGRFCCONF

Figur e20 Tr ansactionSBGRFCCONF Creationofseparateinbounddestinationsforeachapplicationtodistributetheload. o Assignmentofexistingqueueprefixes foraclassicqRFCtoaninbounddestination, o Maintainlogonservergroupstoaninbounddestinationforloaddistribution.They mustbedefinedintransactionRZ12orSMLG.

Figur e21 Tr ansactionSBGRFCCONF:Loaddistr ibution CustomizingofthebgRFCschedulerintransactionSBGRFCCONF: TooptimizethebgRFCfunctionintermsofsystemperformanceyoucanmakevarioussettingsforthe bgRFCschedulers.Thiscanbedoneonthreelevels: System Applicationservers Destinations

Thisallowsaspecificconfigurationfordifferentserversinaheterogenoussystemlandscape,toreach optimumthroughput.ThereisIndependentcustomizingfortheoutboundandtheinboundscheduler. Systemspecificsettingsdefineparameterslikenumberofmessagesperlogandlifetimeof logentries,compressionsettingsanddeletiontimeforunits(fortheasynchronousphysical

2008SAPAG

22

BestPractice:RFCMonitoring deletion).

Applicationserverspecificsettingsdefineparameterslikenumberofoutboundorinbound schedulersperapplicationserver,maximumnumberofconnectionsanddestinationsper server,percentageofavailablegatewayresources,scheduleridletimeandmaximumlifetime ofloadbalancingentries

Figur e22 Tr ansactionSBGRFCCONF:Loaddistr ibution o Settingsfor"SchedulerCount"(NumberofrunningbgRFCschedulers): 1:Thenumberofschedulersisdeterminedmethodically 0:Applicationserver/destinationislockedforbgRFC >0:Maximumnumberofrunningschedulersforapplicationserver/destination

2008SAPAG

23

BestPractice:RFCMonitoring Destinationspecificsettingsdefineparameterslikenumberofschedulersfordestination, maximumnumberofautomaticretriesperunit,waittimeperunitanddestination,maximum processingtimeforadestinationandnumberofopenconnectionsperdestination

Figur e23 Tr ansactionSBGRFCCONF:Loaddistr ibution

2.1.2.5.5bgRFCMonitoring
FeaturesofthemonitoringtransactionSBGRFCMON: Theselectionscreenallowsfilteringoninboundand/oroutboundunitsoftypetransactional and/orqueued,aswellasadditionalcriterialikestatus,destinationname,queuename, usernameorprogram/transactionname. Hierarchicalrepresentationofdestinations,queuesandunits o Detailsforeachunit,e.g.administrativedata,queuenameorlistoffunction modulenames Setorremovelocksondestinations,queuesorunits Deletingqueuesorunits Directaccesstocustomizing,destinationmaintenanceandsupportabilitytools AccesstoSupportabilitytools: o DebuggingofabgRFCunit o Runtimeanalysisforaunit o Tracingaunit o Showingunithistory=>callingtransactionSBGRFCHIST o bgRFCPerformanceMonitor=>transactionSBGRFCPERFMON

2008SAPAG

24

BestPractice:RFCMonitoring MonitoringtransactionalunitsintransactionSBGRFCMON:

MonitoringqueuedunitsintransactionSBGRFCMON:

Contextmenufordestination/queue:

2008SAPAG

25

BestPractice:RFCMonitoring Contextmenufordestination/queue:

2.1.2.5.6TroubleshootingforbgRFC
ShowingunithistoryintransactionSBGRFCHIST: Theunithistoryshowsthechronologicalorderofstatuschangesduringtheprocessinglifetimeofa bgRFCunit.

TheunithistorycanalsobecalledpertransactioncodeSBGRFCHISTdirectly.Inthiscase,youfirst getanoverviewaboutallbgRFCunitsperselectioncriteria.Thenyoucanchooseanindividualunitto seeitsstatushistory.

DisplayruntimeanalysisforabgRFCunit: TheprocessingofabgRFCunitcanbeexecutedwithanSE30runtimemeasurement.Itcanbe displayeddirectlyafterprocessingfromwithinthemonitoringtransactionSBGRFCMON.

2008SAPAG

26

BestPractice:RFCMonitoring

DisplaybgRFCunittrace: TheprocessingofabgRFCunitcanbeexecutedwithatrace.Thetracecanbedisplayed automaticallyafterprocessingfromwithinthemonitoringtransactionSBGRFCMON,ordirectlyper transactionST11(filtercolumn"filename"onstring"dev_bg*").

ApplicationlogforbgRFC: ThebgRFCwritesvariouslogentriesintotheapplicationlog.CalltransactionSLG1forlogobject "BGRFC"(thereareseveralsubobjectsavailable).

2008SAPAG

27

BestPractice:RFCMonitoring ExampleapplicationlogforcustomizingchangesintransactionSBGRFCCONF:

ExampleapplicationlogformanualactionsinmonitoringtransactionSBGRFCMON:

bgRFCperformancemonitor(transactionSBGRFCPERFMON):

2.1.2.5.7LDQMonitoring
ThemonitorfortheLDQ(LocalDataQueue)iscalledwithtransactionSLDQMON.Itprovidesa selectionscreenforfilteringonLDQapplicationand/orqueuename.Thelefthandsidetreecontrol showsallLDQapplicationswiththeircorrespondingqueuenames.Ontherighthandsideofthe screen,foreachqueuethereisalistofLDQunitswithinaqueue.ClickthebuttonContents toshowa popupwiththeunit'scharacterorbinaryformatcontent.

2008SAPAG

28

BestPractice:RFCMonitoring

2.1.3 DependenciesandConvergenceofTechnologies
2.1.3.1QueueDependenciesforqRFC
WhenqRFCisusedforserialization,dependenciesareestablishedbetweenfunctionmodules.Itis possibleformultiplefunctionmodulesofthesameLUWtobeprocessedinmultiplequeues.Thisis achievedusingthefollowingsyntax:

Figur e24 Pr ogr ammingLUWwithentr iesinmultiplequeues Intheexampleabove,thetwofunctionmodulesABCandXYZmakeuponeLUW.Eachfunction moduleisplacedinadifferentqueue,thatis,MyDependingQ1andMyDependingQ2.Allfunction modulesofthedifferentqueuesthatarepartofthesameLUWareprocessedatonceandareended withonedatabasecommit.Inordertoensurethatthesefunctionmodulesareprocessedinthecorrect orderonthereceivingsystem,theqRFCmanagersetsacounter(counteriscreatedautomaticallyon commitworkbytheqRFCManagertoserializetheprocessingofthoseLUWsthatextendover multiplequeues.Forthechangestobecommittedtogether,thefunctionmodulesofthedifferent queueswhicharepartofthisLUWmustbeatthefrontofallthesequeues.Inthefigurebelow,queue 2iscurrentlynotprocessedfurther,asitsfirstLUWextendsacrossqueue1,andthisLUWinqueue1 isprecededbyanotherunrelatedLUW.

2008SAPAG

29

BestPractice:RFCMonitoring

Figur e25 LUWsspanningacr ossmultiplequeues IntheSAPsystem,thesedependenciescanbemonitoredusingtheqRFCmonitor.Thefigurebelow shows3queuescontainingthefunctionmoduleentriesof2LUWs.ThefirstLUWextendsoverthe queuesMyDependingQ1andMyDependingQ2andthesecondLUWextendsoverMyDepending Q2andMyDependingQ3.Afterselectingallqueuesanddisplayingthem,youcanseefurtherdetails. Inthefollowingexample,theInboundqRFCMonitorshowsQ3waitingforQ2.Itiswaitingbecause thefirstLUWisnotyetprocessed.

Figur e26 Monitor ingdependenciesacr ossdiffer entqueuesI ItisalsopossibletodisplayallqueuesthatareinvolvedintheLUWsofonequeue.Thiscanbedone bydoubleclickingonthatqueueintheQueueMonitor(seefigurebelow).Doubleclickingonthe queueMyDependingQ2showsthatoneLUWhasfunctionmodulesinMyDependingQ1anda secondLUWhasfunctionmodulesinMyDependingQ3. 2008SAPAG 30

BestPractice:RFCMonitoring

Figur e27 Monitor ingdependenciesacr ossdiffer ent queuesII

2.1.3.2QueueDependenciesforbgRFC
AlsoforthebgRFCaqueuedunit(LUW)canbestoredacrossseveralqueues.Thisisreachedby handingoveralistofqueuenames(insteadofonequeuenameonly)totheunitobject.

TheexampleaboveshowsaqueuedbgRFCunitforfunctionmoduleRFC_PING.Itisspreadovertwo separatequeuescalledZ_TEST_QUEUE_1andZ_TEST_QUEUE_2.Thepopupshownonthe screenshotcanbecalledbychoosing"DisplayCorrespondingQueues"inthecontextmenuofthe bgRFCunit.ClickingincolumnQueueNamefocusesthecursorinthelefthandsidetreecontrol.

2.1.3.3MixedModeRFC
ThereisaspecialfeaturecalledmixedmodethatallowsqRFCcallswithsendqueueandnormal tRFCcallswiththesamedestinationtobeprocessedtogetherwithinoneLUW.If,withinanLUWin mixedmode,thefirstcallisanormaltRFCcall,thefunctionmoduleTRFC_QUEUE_INITIALIZEis calledfirst(seefigurebelow).ThisensuresthatthecurrentLUWisprocessedviaqRFCwithsend queue.If,withinanLUWinmixedmode,thefirstcallisaqRFCcall,thisinitializationisdoneby functionmoduleTRFC_SET_QUEUE_NAME.

2008SAPAG

31

BestPractice:RFCMonitoring

Figur e28 Syntaxforimplementingmixedmode Whenmixedmodeisimplemented,anytRFCsareprocessedasqRFCs.Monitoringcanbeperformed inSMQ1andalsointransactionSM58.TransactionSM58(tRFCmonitorfordisplayingandeditingthe tRFCtransactions),nowalsoallowsprocessingqRFCtransactions.IfyoudeleteatRFCentrywith thistransaction,thesystemautomaticallydeletesthecorrespondingentriesinthesendqueuetable,if theyexist.IfyoustartanLUW,thesystemdoesnotimmediatelytransferthisLUW,butchecks first whetherthisLUWneedsserializationorwhetheritmustwaitduetopredecessorsinthequeue.

2.1.4 AutomaticSwitchingfromqRFCtotRFC
IftheexecutionofaqRFCLUWisterminatedbytheerrorSYSTEM_FAILURE,thequeueisblocked thiscanresultinbacklogsinthequeues.IfyouwanttouseqRFCinsteadoftRFCforbettersystem performance,andnotforserialization,itispossibletosettheoptionalparameterTRFC_IF_SYSFAIL toXwhileyoucallthefunctionmoduleTRFC_SET_QUEUE_NAME.ThisresultsinallLUWswiththe errormessageSYSTEM_FAILUREbeingconvertedtotRFCLUWs,enablingtheqRFCManagerto executethenextLUWinthisqueue.TheLUWswhichareconvertedtotRFCcanthenbe administered/monitoredusingtransactionSM58.

Figure29 Syntaxfor implementingautomaticswitchingincaseofSYSFAIL

2008SAPAG

32

BestPractice:RFCMonitoring

3 Aspect: Error Monitoring


Fromtheprevioussections,youknowthegeneralRFCprocessingmechanism.Inthenextsections, individualaspectsofinterfacemonitoringarehandled. Thepossibilitiesforsettingupaselectiveand automatedRFCmonitoringwithintheSAPSolutionManagerareoutlinedinthesectionSetup ProcedureforanAutomatedInterfaceMonitoring. RFCerrormonitoringintendstodetectcriticalsituationsandexceptionalcasesduringinterface processing.Astheseincidentscanendangertheentiredataexchangebetweenthesystemsinvolved, theiridentificationcanbeextremelyimportantandtimecritical.Monitoringproceduresshould thereforeensureaclearvisualizationandprioritizationofincidentstosupporttheirfastandeffective resolution.ErrorMonitoringincludesthemonitoringofallerrorsituationsdocumentedwithinthe system.Errorsituationcanbeidentifiedbytheoccurrenceoferrormessagesorerrorstatuses. MonitoringRequirements: Aspreviouslydiscussed,RFCcommunicationprovides fivedifferenttechniqueswhichcanbeusedto meetdifferentbusinessrequirements.Inatypicalsolutionlandscape,acombinationofthevarious RFCtechnologiesareused.InordertomonitorthedifferentRFCtechnologies,SAPprovides various tools.ThebelowgraphicillustratesthevarioustechnologiesandtheSAPtoolsthatcanbeusedto monitorRFCscenarios manuallyinasolutionlandscape:

Figur e30 Standar dRFCmonitor ingtools

2008SAPAG

33

BestPractice:RFCMonitoring

3.1 Manual Error Monitoring


RFCcommunicationcaneitherfailonthesendersystemorthereceivingsystem,sothesenderand receiverwillrepresentourtwomonitoringperspectives. Thefollowingtabledocumentsthehandlingoferrorsonthesenderandreceiversystemsforthe5 typesofRFC. Monitoring Object Monit or TA/To ol SM50/ SM66 Monitoring Freq. Indicat oror Error RFCs not process ed. Multiple work process es remain instatus STOPP ED/HOL Dwith reason CPIC/R FC. MonitoringActivityor ErrorHandling Procedure Runtransaction SM50/SM66andmonitor workprocesses. Ifmanyworkprocessesin statusSTOPPED/HOLD andreasonCPIC/RFC checkworkprocesstrace filesforerrorsrelatingto CPIC/RFCbychoosingthe relevantworkprocessand usingtransactionSM50>> [Menu]Process>>Trace >>DisplayFile. Forfurtheranalysis, doubleclickonthework processintransaction SM50whenitisinstatus STOPPED/HOLDreason CPIC/RFCtodisplay conversationID.Next stepistoruntransaction SMGWtodisplayalistof activeconnectionsonthe gateway.Lookfor corresponding conversationID,double clickontheconversation IDtogetdetailsabout connection.Run transactionST11and searchinthedev_rdand dev_rfc<n>tracefilesfor conversationID examinereasonforerror. Increasetheindividual tracelevelsifnotenough detailisavailable.See SAPNote532918for furtherdetails. Respon sibility Escalation Procedure

RFCnotbeing processed (sender system).

Asrequired bybusiness andincase ofperform ance problems.

SAP Technology Operations Team.

SAP Technology Operations Team.

Thisproblemcanbethe resultofinsufficient resourcesinreceiver systemsoyoushouldalso checkresource configurationintarget


2008SAPAG 34

BestPractice:RFCMonitoring

systemusingtransaction SARFC.
Communicatio n/connection problem (sender system). SM59 Incaseof connection/ communicat ion problems. Commu nication error CPIC errors. RuntransactionSM59> chooseRFCdestination> [MENU]Test> Connection(totestifthe connectiontotarget systemisworking). Itisalsopossibletomake anauthorizationchecki.e. SM59>chooseRFC destination>[MENU]Test >Authorization(tocheck iftheuserisauthorizedin thetargetsystem). Ifanerroroccursdouble clickontheerrormessage togetfurtherdetails. InadditionRFCTracecan bedisplayedi.e.SM59 SAP Technology Operations Team. SAP Technology Operations Team.

[Menu]RFCDisplay Trace.Thiswillprovidea
Communicatio n/connection problem (sender system). greaterdetailofanyerror. RuntransactionSM21> Lookforoccurrenceof communicationCPIC errors.Doubleclickon errormessagetoget details.UseSAPNote 63347totranslatetheSAP andCPICreturncodes. ST11 Incaseof Commu RuntransactionST11to and communicat nication displayerrorlogfiles. AL11 ion/connecti error Communicationerrorsare >> on CPIC loggedforthefollowing work problems. errors. components:RFClayer (dev_rfc<n>),Gateway directo (dev_rd)andwork ry. processesdev_w<n> SM21 Daily/As requiredby business. Commu nication errors i.e.CPI C errors. SAP Technology Operations Team. SAP Technology Operations Team.

Communicatio n/connection error(sender system).

SAP Technology Operations Team.

SAP Technology Operations Team.

(where<n>isthework processthathandledthe RFCcall).


Theabovefilescanalso befoundusingthe followingmethods: UsingtransactionAL11 >navigatetowork directory. RFCTracecanalsobe displayedusing

SM59[Menu]RFC DisplayTrace.
GatewayTracecanalso bedisplayedusing 2008SAPAG 35

BestPractice:RFCMonitoring

SMGW[Menu]Goto TraceGateway Displayfile.


WorkprocessTracecan alsobedisplayedwith

SM50Selecta process[Menu]Process TraceDisplayfile.


Inerrorsituationsyoucan increasethetracelevelsin ordertogetmoredetail SeeNote532918.

(Tracelevelsshouldbe changedbacktodefault levelaftersolvingerror situationotherwise problemswithfilesystem spacecanarise).


Communicatio n/connection errorinvolving communicatio nwithexternal programs. SMG Wand SM59 Incaseof connection/ communicat ion problems. Commu nication error CPIC errors. RuntransactionSMGW> [Menu]GoTo>Trace> ExternalPrograms> Activate.Thiswill generateRFC(dev_rfc) andCPIC (CPICTRC<pid>)trace filesonallexternal programswhicharecalled. AlternativelyRFCand CPICtracefilescanbe generatedforaspecific externalprogram.Thisis doneusingtransaction SM59>SpecialOptions TAB,SettheRFCtrace flag.Thisispropagatedto theexternalprogramand theCPICandRFCtrace filesaregenerated.This canalsobeachievedby registeringthedestination intransactionSM54. SAP Technology Operations Team SAP Technology Operations Team

Forfurtherinformation includinglocationof generatedtracefiles reviewSAPNote47682.


Communicatio n/connection error N/A Incaseof Commu ActivateCPICtraceby connection/ nication includingtheparameter communicat errors. CPIC_TRACE=<tracelevel ion >inthesideinfofileorby problems. SettingtheCPIC_TRACE environmentvariableinthe externalclientsystem.The generatedCPICtracefile (CPICTRC<pid>)canbe foundinthedirectoryin whichtheexternalprogram SAP Technology Operations Team SAP Technology Operations Team

(communicatio nisstarted fromthe externalclient programnon SAPSystem).

2008SAPAG

36

BestPractice:RFCMonitoring wasstarted.Forfurther informationreviewSAP Note47682. Incaseof Commu ActivateRFCtraceby connection/ nication includingtheparameter communicat errors. RFC_TRACE=<tracelevel> ion inthesideinfofileorby problems. SettingtheRFC_TRACE environmentvariableinthe externalclientsystem.For furtherinformation includinglocationof generatedtracefiles reviewSAPNote532918. Daily/As Runtime RuntransactionST22and requiredby errors. selecttimeperiod.Look business. outforerrorsoftypeRFC*, CALL_FUNCTION*. Doubleclickondumpto obtaingreaterdetails. Daily/As Messag RuntransactionSM58to requiredby es checkstateofRFC business. Hangin communicationlayer. gorin Chooseatimeframein status ordertodisplayalistof Error. tRFCswhicharehanging orwhichareinstatus error.Togetmoredetails foreachtRFCdoubleclick. Daily/As requiredby business. Messag es buildup in queues and queue instatus error. RuntransactionSMQ1and choosevariousselection criteria.Lookoutfor queueswithmanyentries andorqueueswhichare static(entriesnotgetting processed).Selectqueue bydoubleclickingtoget queuestatus(seeSAP NoteNo.378903for descriptionofstatus codes),doubleclickagain togetstatusofindividual LUWwhichisresponsible forerrorstatusofqueue. Messag RuntransactionSMQ2and es choosevariousselection buildup criteria.Lookoutfor in queueswithmanyentries queue andorqueueswhichare and static(entriesnotgetting queue processed).Selectqueue instatus bydoubleclickingtoget error. queuestatus(seeSAP NoteNo.378903for descriptionofstatus codes),doubleclickagain togetstatusofindividual LUWwhichisresponsible forerrorstatusofqueue. Outbou RuntransactionSMQS

Communicatio n/connection error

N/A

(communicatio nisstarted fromthe externalclient programnon SAPSystem).


Runtimeerror ininterface (sender/Recei versystem). ST22

SAP Technology Operations Team

SAP Technology Operations Team

SAP Technology Operations Team

SAP Technology Operations Team

Transactional RFCsstuck (sender system).

SM58

SAP Technology Operations Team

SAP Technology Operations Team

qRFCnot processed (sender system).

SMQ1

SAP Technology Operations Team

SAP Technology Operations Team

qRFCnot processed (receiver system).

SMQ2

Daily/As requiredby business.

SAP Technology Operations Team

SAP Technology Operations Team

tRFC/qRFC 2008SAPAG

SMQS Asrequired

SAP

SAP 37

BestPractice:RFCMonitoring notprocessed (sender system). andcheckstatusof OutboundScheduler. Doubleclickonthestatus fordetailederror information.(Maybe necessarytocombinethis analysiswithanalysisof systemlog(SM21)andthe errorlogsi.e.dev_rfc*, dev_rd,dev_w*). SMQR Asrequired Inbound RuntransactionSMQR by Schedul andcheckstatusof business. erin InboundScheduler. status Doubleclickonthestatus CPICE fordetailederror ROR information.(Maybe SYSFAI necessarytocombinethis L. analysiswithanalysisof systemlog(SM21)andthe errorlogsi.e.dev_rfc*, dev_rd,dev_w*). SMQE Incaseof Errorin ActivateqRFClogandor communicat logfile. qRFCtracebyrunning ion transactionSMQE>> problems. [Menu]QRFC>>Trace>> Forerror ActivateTraceand analysis transactionSMQE>> only. [Menu]QRFC>>Log>> ActivateLog(thisshould onlybeperformedwhen analyzingerrorsbecause activatingthishasan overhead).Forfurther detailssee by business. nd Schedul erin status CPICE ROR SYSFAI L. Technology Operations Team Technology Operations Team

qRFCnot processed (receiver system).

SAP Technology Operations Team

SAP Technology Operations Team

qRFCnot processed (sender/receiv ersystem).

SAP Technology Operations Team

SAP Technology Operations Team

RFCnot processed

SM04 >>

http://help.sap.com/saphel p_sm32/helpdata/en/4f/e0 5f3ca2de8974e10000000a 114084/frameset.htm Incase Errorin RuntransactionSM04and communicat logfiles. selectuser>>[MENU] ionerrors USER>>Technical fora Information.Thisprovides specific detaileduserinformation. user. TakenoteofConversation ID. Nextstepistorun transactionSMGWto displayalistofactive connectionsonthe gateway.Lookfor corresponding conversationID,double clickontheconversation IDtogetdetailsabout connection.Run transactionST11and

2008SAPAG

38

BestPractice:RFCMonitoring searchinthedev_rdand dev_rfc<n>tracefilesfor conversationID examinereasonforerror. Increasetheindividual tracelevelsifnotenough detailisavailable.See SAPNote532918for furtherdetails. RFCnot processed (sender/receiv ersystem). SM04 >> Trace Incaseof error situations fora specific user Errorin logfile ActivatetheRFCtrace generationforaloggedon R/3userbyselectingthe userinquestionin TransactionSM04and choosingEdit>>Trace >>Traceon(inolder releases)or User>>Trace>>Activate. YoucanspecifytheR/3 componentsthat shouldwritetrace informationviathedisplay componentsinEdit>> Trace>>'Displaytrace' (olderreleases)orin User>Trace>>Display. FortheRFCtrace,atleast thetaskhandlerandthe ABAPprocessorshould alwaysbemarkedhere. Thisactivationhasthe effectthatalltheRFClinks oftheuserinquestionare documentedinthe correspondingtracefilesof theapplicationserver wheretheactivationvia SM04tookplace.Ifsucha userspecifictrace generationoccurs,the userishighlightedin yellowinSM04. Commu Usetransaction nication SBGRFCCONFtocheck errors, configurationofinbound queue schedulersandoutbound backlog destinations. Runtime Usemonitoringtransaction errors, SBGRFCMON.Check queue statusofdestinationsand backlog queues.Checkunithistory (transaction SBGRFCHIST)andtraces (transactionST11forfiles "dev_bgRFC*").Check applicationlog(transaction SLG1)forlogobject BGRFC. SAP Technology Operations Team SAP Technology Operations Team

bgRFCnot processed

SBGR FCCO NF

Ondemand

SAP Technology Operations Team SAP Technology Operations Team

SAP Technology Operations Team SAP Technology Operations Team

bgRFCnot processedor processing failed

SBGR Daily/As FCMO requiredby Nand business SBGR FCHIS T

2008SAPAG

39

BestPractice:RFCMonitoring

**Whenactivatingtraces,ensurethatthefollowingdynamicprofileparametersaresettothevalue"0" onallapplicationserversthatarenotrelevantfortracegenerationwhiletheproblemanalysisisbeing carriedout:gw/accept_remote_trace_levelandrdisp/accept_remote_trace_level.Forfurther informationseeSAPNoteNotes573800and558254.

3.2 Automated Error Monitoring


DifferenttypesoferrorscanoccurduringRFCprocessing,dependingontheprogramorfunction calledanditsexceptionhandling.Itcouldbeerrorswrittenintothesystemlog(/nSM21),ABAPdumps (/nST22)orapplicationlogentries(/nSLG1)thatareimportanttobemonitored. Foranautomatederrormonitoring,therecommendationwouldbetosetupaselectiveautomated monitoringforerrorsthatoccuroften. AutomatedMonitoringObjectswithSAPCCMSandSAPSolutionManager Monitoring Monitor Monit Indicatoror Monitoring Respon Object TA/Tool Freq. Error Activityor sibility Error Handling Procedure AllRFCtypes SystemLog Hourly Entriesforthe Analyzethe SAP (including (/nSM21)or monitored reason Technology bgRFC) ABAPDumps objectand startingfrom Operations (/nST22) subobject transactions Team Monitoringin (application /nSM21 SAPCCMS/ errorsin and/or System called /nST22 Monitoringin programs) SAPSolution Manager AllRFCtypes Application Hourly Entriesforthe Analyzethe Business Log monitored reason Process Monitoring objectand startingin Operations (/nSLG1)in subobject transaction Team Business (application /nSLG1 Process errorsin Monitoringin called SAPSolution programs) Manager bgRFC Application Hourly Specific Analyzethe SAP Log entriesforthe reason Technology Monitoring bgRFC startingin Operations (/nSLG1)in processing transaction Team Business withlog /nSLG1 Process object Monitoringin BGRFC SAPSolution (configuration Manager ,monitoring log,scheduler log) AllRFCtypes RFC Hourly Connection Analyzethe SAP connection problemsdue reasonin Technology Monitoringin tosystem transactions Operations SAPSolution unavailability SM59 Team Manageras outlinedin section Automated RFC Connection Monitoring 2008SAPAG

Escalation Procedure

Application Management Team/ Business Process Champion

Application Management Team/ Business Process Champion

Application Management Team

Application Management Team/ Business Process Champion

40

BestPractice:RFCMonitoring qRFC Numberof specified queuesin status blocked monitoredin SAPCCMS orSAP Solution Manager (referto section Automated qRFC Monitoring) Errorsin tRFC processing monitoredin SAPCCMS orSAP Solution Manager (referto section Automated tRFC Monitoring) Hourly Queuesin status blocked Analyzethe reasonin transactions /nSMQ1or /nSMQ2 Business Process Operations Team/ SAP Technology Operations Team Application Management Team/ Business Process Champion

tRFC

Hourly

CPICERR, SYSFAIL, SYSLOAD errors

Analyzethe reasonin transaction /nSM58

Business Process Operations Team/ SAP Technology Operations Team

Application Management Team/ Business Process Champion

Fordetailsonhowtosetuptheautomatedmonitoringoftheapplicationlog,refertothe generalBusinessProcessMonitoringsetupguide: http://service.sap.com/~sapidb/011000358700006137532006E FordetailsonhowtosetuptheautomatedmonitoringofthesystemlogortheABAPdumps, refertohttp://service.sap.com/solutionmanagerbp>TopicArea>SystemMonitoringwithin SAPSolutionManager FordetailsonhowtosetuptheautomatedqRFCortRFCerrormonitoring,refertosection SetupProcedureforanautomatedInterfaceMonitoring

2008SAPAG

41

BestPractice:RFCMonitoring

3.3 Troubleshooting: Error examples and solutions


3.3.1 ErrorCALL_FUNCTION_REMOTE_ERROR
IfyoufindtheABAPruntimeerror(ST22)CALL_FUNCTION_REMOTE_ERRORoccurringwithyour customprogramscheckifthedefaultexceptionsCOMMUNICATION_FAILUREand SYSTEM_FAILUREarehandledbythecustomprogram.Iftheseexceptionsarenothandledthisis anapplicationproblem,whichmustbeanalyzedandprocessedbytheresponsibleapplication departmentrefertoNote97522forfurtherdetails.

Figur e31 ST22CALL_FUNCTION_REMOTE_ERROR(ABAPr untimeer r orST22)

2008SAPAG

42

BestPractice:RFCMonitoring

3.3.2 ExternalProgramnotregisteredonGateway
Problem: AftertheupgradetoR/3Enterprise4.70,theconnectiontothearchivingsystemwasoften lost.Analysisshowedthefollowing: Problem during initiationof connection

Problem during initiationof connection

Problem during initiationof connection

Figur e32 Exter nalpr ogr amnotregisteredingateway(SM59,SM21anddevelopertr aces) Cause: Solution: Registertheprogramonthegateway. SeeNote63930and353597. Theexternalprogramisnotregisteredonthegateway.

2008SAPAG

43

BestPractice:RFCMonitoring

3.3.3 ExternalProgramtimeoutonGateway
Problem: IDocscouldnotbesentoutfromR/3tothe3rdpartyproductthoughtheincomingprocessto R/3hasnoproblem.Analysisshowedthefollowing:

Timeout when establishing connection

Timeout when establishing connection

Timeout when establishing connection

Figur e33 Exter nalpr ogr amtimeoutingateway(SM59anddeveloper tr aces) Cause: Theprogramisregisteredonthegatewayandiscurrentlybeingusedbyaprocess.Another processattemptstoaccesstheregisteredprogrambutcannotbecauseitisalreadyinuse. Thesystemwaitsacertainperiodoftime(gw/reg_timeout)andafterthisspecifiedtimeperiod ifitstillcannotaccesstheregisteredgatewayprogramitterminateswiththetimeoutduring allocateerror.

Solution: Checkifyoucanregistertheprogramonthegatewaymorethanonce,referringtoNote 353597. Otherwiseincreasetheparametergw/reg_timeoutintransactionRZ11. ReviewNote581509.

2008SAPAG

44

BestPractice:RFCMonitoring

3.3.4 Timeoutduringconnectionsetup
Problem:

Afterthemigrationtoanotheroperatingsystem,theRFCconnectionsfailed.

Figur e34 Timeoutdur ingconnectionsetup(developer tr ace) Cause: ThetargetsystemDEFwasnotreached.

Solution: TesttheRFCconnectionwithSM59andcheckiftheuserisauthorizedinthetargetsystem. Checkthatalltherelevantentries,servicesandhostsfiles,soallthehostnamesmustbeable toresolvetoIPaddresses.Thenamesfortheindividualhostsmustbeidentical(includingthe case)everywheretheyarestatedenvironmentalvariables,DEFAULT.PFL,theservicesand hostsfiles.

2008SAPAG

45

BestPractice:RFCMonitoring

3.3.5 Activeconnectiontableisfull
Problem: Thecentralinstancecommunicationtableis full,anddeallocatedconnectionscannotbe clearedout.

Figur e35 Activeconnectiontablefull(developer tr ace) Cause: Manyoldconnectionsremaininthecommunicationtable.

Solution: Displaythecommunicationtabletochecknumberofentries.(Thesizeofthetableorthe numberofentriesissetintheparameterrdisp/max_comm_entries.Thevalueshouldbeat leastasbigasthevalueofparameter gw/max_conn):

SM51SelectaserverGotoServerinformationCommunicationtable
Deletetheoldconnections: Loggedonclient: SMGWGotoLoggedonClientsDeleteClient. Normalgatewayconnection: SMGWGotoActiveConnectionsDelete

connection
Adjustthegatewayparameters,referringtothehelpdocument.

SMGWGotoParametersDisplay(tomakethemactive,maintaintheinstance profile)
gw/cpic_timeout gw/keepalive gw/cpic_timeout gw/gw_disconnect

2008SAPAG

46

BestPractice:RFCMonitoring

3.3.6 SQLerror60whenaccessingtableARFCSSTATE
Problem: ManyshortdumpsweregeneratedrelatingtoTableARFCSSTATEandARFCSDATAinthe productivesystem.

Figur e36 SQLErr or 60whenaccessingtableARFCSSTATE(ABAPr untimeer r or ST22) Cause: Oneuseristemporarilyblockingatablethatanotheruserwantstoaccess.

Solution: MakesurethatyouhaveappliedthelatestRFCenvironmentandcleandowntheRFCtables ARFCSSTATEandARFCSDATA,referringtoNote375566and324545topreventdeadlock situations.

2008SAPAG

47

BestPractice:RFCMonitoring

3.3.7 CPICTimeoutsduringconnectiontoExternalprogram
Problem:

Reportscouldnotbegeneratedsuccessfully,duetocommunicationfailurestothe3rdparty product.

ConversationID

Figur e37 CPICtimeoutsdur ingconnectiontoexter nalpr ogr am(developer tr aces)

2008SAPAG

48

BestPractice:RFCMonitoring

Conversation

2008SAPAG

49

BestPractice:RFCMonitoring

Figur e38 CPICtimeoutsdur ingconnectiontoexter nalpr ogr am(CPICtr ace)

Cause: Theconnectionsetuptoanexternalprogramdoesnotsucceedwithinthetimeperiod determinedbygw/cpic_timeout.TheGatewaythenterminatestheconnectionsetupand reportsanerror.SeeNote516073

Solution: Contactthe3rdpartyproductssupporttoinvestigatewhytheexternalprogramdidnot respondwithin20seconds. Adjusttheparametergw/cpic_timeout.

2008SAPAG

50

BestPractice:RFCMonitoring

3.3.8 Sockettoolarge
Problem: ThestandalonegatewaywhichhandlestheRFCcallstothe3rdpartyproductstopped.

Figur e39 Sockettolar ge(developer tr aces)

Analysis:UsingtransactionSMGWandtypingintheokcodefield"newg(togotoanothergateway formonitoring,thatis,standalonegatewayinstance).Itwasobservedthatthenumberofactive connectionsforthestandalonegatewaywasatitsmaximum,thatis, 2048. Cause: Uptorelease6.20,thegatewayisonlyabletodo2048connectionssimultaneously.Above, thesystemhasreachedthislimit. TheRFCconnectionisnotclosedinthecustomerprogramaftertheexternalprogram completesitstaskandthereisnoRFCtimeout.Therefore,moreandmoreRFCconnections areestablisheduntiltheyreachthelimitof2048connections.

Solution: RedesigntheexternalprogramsothatitwillclosetheRFCconnections.

2008SAPAG

51

BestPractice:RFCMonitoring

4 Aspect: Backlog Monitoring


Thebacklogmonitoringenablesyoutomonitorproactivelythenumberofmessagesthateitherare processedorhavenotbeenprocessedinadefinedtimewindow.Basedonthisinformationa reportingontheinterfacethroughputcanbesetup.Thismightserveasanindicatorofdelaysin businesscriticaldataflowsaswellasanindicatorforinteractingapplicationsincasethedatavolume processedexceedsorfallsbelowdefinedthresholdvalues.Thisgivesthecorresponding organizationalunitsthetimenecessarytoadapttheiroperationstotheupcomingincreaseor decreaseofunfilledworkitems. BacklogsituationsduringRFCprocessingcannegativelyaffecttheoverallsystemperformanceand delaytheunderlyingbusinessprocesses.

4.1 Manual Backlog Monitoring


MonitoringObjectsw/oSAPSolutionManager Monitoring Monitor Monit Indicator Object TA/Tool Freq. orError Transactional RFCsstuck (sender system). SM58 MonitoringActivityor ErrorHandling Procedure Daily/As Slow CalltransactionSM58 required processing. andspecifytimeframe. by Chooseexecute,look business. atnumberofentriesin table.Investigate reasonfortRFCsbeing stuckinthetRFC queue.Statustext Transactionrecorded indicateslackof resourcesinthetarget system. Ensurethat backgroundjob RSARFCEXis scheduledandrunning successfully(restarts messageswhichfail duetothefollowing reasons/status: Communicationerrors (CPIC),Recorded, Systemerror (SYSFAIL),Terminated duetooverload (LOAD),Temporary applicationerror (RETRY)orSerious applicationerror (NORETRY)). RuntransactionSMQ1 andchoosevarious selectioncriteria.Look outforqueueswith manyentriesandor queueswhicharestatic (entriesnotgetting processed).Select queuebydouble Respon sibility SAP Technology Operations Team Escalation Procedure SAP Technology Operations Team

qRFCnot processed (sender system).

SMQ1

Daily/As required by business.

Messages buildupin queueand queuein status error.

SAP Technology Operations Team

SAP Technology Operations Team

2008SAPAG

52

BestPractice:RFCMonitoring clickingtogetqueue status(seeSAPNote No.378903for descriptionofstatus codes),doubleclick againtogetstatusof individualLUWwhichis responsibleforqueue backlog. RuntransactionSMQ2 andchoosevarious selectioncriteria.Look outforqueueswith manyentriesandor queueswhicharestatic (entriesnotgetting processed).Select queuebydouble clickingtogetqueue status(seeSAPNote No.378903for descriptionofstatus codes),doubleclick againtogetstatusof individualLUWwhichis responsibleforqueue backlog. Runtransaction SBGRFCMON.Look fordestinationsand queueswithhigh numberofunprocessed units. Runtransaction SBGRFCCONFto checkthestatusof inboundschedulers andoutbound destinations.

qRFCnot processed (receiver system).

SMQ2

Daily/As required by business.

Messages buildupin queueand queue status error.

SAP Technology Operations Team

SAP Technology Operations Team

bgRFCnot processed (senderand receiver system)

SBGRF CMON/ SBGRF CCONF

Daily/As required by business

Messages buildupin queueand queue status error.

SAP Technology Operations Team

SAP Technology Operations Team

4.2 Automated Backlog Monitoring


TheSAPCCMSandBusinessProcessMonitoringwithintheSAPSolutionManagerprovidethe possibilityforbacklogmonitoringoftheqRFCprocessing.Youcanbundlequeuesthatlogicallybelong togethertoqueuegroups,andactivatethemonitoringonthenumberofentrieswithinthegroup.Ifthe numberofentriesofaqueuewouldexceedacertainvalueitmightbeanindicatorforabacklog situation. Incertaincasesyoumightneedtomonitoraqueueontheageoftheoldestentry.Incasethereare entriesolderthanaspecifiednumberofdays,thiscanalsoindicateabacklogsituation,althoughthe groupconsistsonlyofafewentries.

2008SAPAG

53

BestPractice:RFCMonitoring

AutomatedMonitoringObjectswithSAPSolutionManager Monitoring Monitor Monit Indicatoror Monitoring Object TA/Tool Freq. Error Activityor Error Handling Procedure qRFC SAPCCMS/ Hourly Toomany Analyzethe backlog SAPSolution entriesinthe reasonin monitoring Manager specified transactions bythe queuegroup /nSMQ1or numberof mightindicate /nSMQ2 entries abacklog situation qRFC backlog monitoring bytheageof entries SAPCCMS/ SAPSolution Manager Hourly Oldentriesin thequeue groupcan indicatea backlog situation

Respon sibility

Escalation Procedure

Business Process Operations Team/ SAP Technology Operations Team Analyzethe Business reasonin Process transactions Operations /nSMQ1or Team/ /nSMQ2 SAP Technology Operations Team

Application Management Team/ Business Process Champion

Application Management Team/ Business Process Champion

FordetailsonhowtosetuptheautomatedqRFCbacklogmonitoring,refertosection AutomatedqRFCmonitoring.

2008SAPAG

54

BestPractice:RFCMonitoring

5 Aspect: Performance Monitoring


Thissectionwillgiveyousomesuggestionshowtomonitoryoursystemsperformancewithregardto RFC.Thefirststepistounderstandthatweactuallyneedtolookattwosystems,dependingonthe landscapeandsolutionthesecanbeSAPsystemsorthirdpartysystems.Therefore,optimization stepsmayneedtobedoneintwosystems.TheperformanceofRFCdependsonmanyfactors(type ofbusinessprocess,numberofmessages,activitiesrunningonthedistributedsystems,hardware, andsoon). Performancemonitoringenablesyoutomonitorfortheinterfaceperformanceandcompareitwith predefinedkeyperformanceindicators.Proactivelyappliedperformancemonitoringnotifiesin situationsofreducedinterfacethroughput,whichinturncanavoidbacklogsituationsforperformance criticalinterfaces.Reactiveperformancemonitoringallowsforthedocumentationoftheservicelevel delivered. MonitoringRequirements: Thefirststepinperformancemeasuringistohaveabaselinetomeasureagainst.Therearedifferent waysofusingRFCthereisreallynosimplewaytodefinewhatisagoodperformanceorbad performance.Therefore,thefirststepisdefiningKPIs(keyperformanceindicators)forRFCinterfaces. Bydoingso,youdefinewhatminimumperformanceyourequire.Thisdependsonanumberoffactors andisbasedonyourbusinessneeds. AllpartiesintheprocessneedtoagreetotheseKPIsandtotheactionstobetakeniftheselimitsare exceeded.OnewaytofindtheseKPIsistouseyourqualityassurancesystem(orthefuture productivesystem)andmeasureit.ThesenumbersmightbeusefulindefiningtheKPIs.Another methodistoanalyzeyourbusinessprocess.Forexample,ifyouneedtorun3600RFCsperhour (eachprocessingthebusinessdataforonesalesorder)youneedtobeabletoprocessoneRFCper second.Inthefollowingsectionswearegoingtodescribesometechniqueswhichcanbeusedto measuretheperformanceoftheRFCprocessinginanSAPsystem.ThereisalsoanSAPcourse calledADM315WorkloadAnalysis,whichcoversthisandmanymoretopicsofperformance monitoringingreaterdetail.

5.1 Manual Performance Monitoring


MonitoringObjectsw/oSAPSolutionManager Monitoring Monitor Monit Indicator Object TA/Tool Freq. orError Monitoring Activityor ErrorHandling Procedure Respon sibility Escalation Procedure

Performance oftheRFC processing General Overview (Receiver system).

ST03N> Asreq Workload uired Overview bybus iness.

HighRFC processing times.

Forinformation onusingthe Workload Overviewsee sectionST03n Workload Overviewbelow fordetails. Reviewsection: Performance Monitoringof thisdocument onhowto further investigateany observed bottlenecks.

SAP Technology Operations Team

SAP Technology Operations Team

2008SAPAG

55

BestPractice:RFCMonitoring Slow processingof RFCs(sender system). ST03N> RFC Client Profile Asreq uired bybus iness. HighRFC processing times. Business Process Operations Team/ SAP Technology Operations Team SAP Technology Operations Team

Forinformation onusingRFC ClientProfile seesection ST03nRFC ClientProfile belowfor details.

Slow processingof RFCs (receiver system).

ST03N> RFC Server Profile

Asreq uired bybus iness

HighRFC processing times ForInformation onusingRFC ServerProfile seesection. ST03nRFC ServerProfile below. HighRFC processing times Forinformation onusingthe RFCClient Destinationtool toanalyze performance seesection RFCClientand Server Destinations below. HighRFC processing times Forinformation onusingthe RFCServer Destinationtool toanalyze performance seesection RFCClientand Server Destinationsin thisdocument. HighRFC processing times Forinformation onusingSingle Statistical Records (STAD)see sectionSingle Statistical Records(STAD) inthis document.

Business Process Operations Team/ SAP Technology Operations Team

SAP Technology Operations Team

Slow processingof RFCs (Sender system).

ST03n> RFC Client Destinatio n

Asreq uired bybus iness

Business Process Operations Team/ SAP Technology Operations Tea

SAP Technology Operations Team

Slow processingof RFCs (receiver system).

ST03N> RFC Server Destinatio n

Asre quired bybus iness

Business Process Operations Team/ SAP Technology Operations Tea

SAP Technology Operations Team

Slow STAD processingof RFCs (sender/receiv ersystem).

Asreq uired bybus iness

Business Process Operations Team/ SAP Technology Operations Tea

SAP Technology Operations Team

2008SAPAG

56

BestPractice:RFCMonitoring Slow processingof bgRFCunits (inboundor outbound) SBGRFC MON/ SBGRFC CONF/ SBGRFC PERFMO N Asreq uired bybus iness Backlogof unitsin queueand queue. Runtransaction SBGRFCMON. Lookfor destinationsand queueswith highnumberof unprocessed units. Runtransaction SBGRFCCONF tocheckthe statusof inbound schedulersand outbound destinations. Runtransaction SBGRFCPERF MONtocheck keyfiguresfor inboundand outbound scenario. SAP Technology Operations Team SAP Technology Operations Team

Alsosee section backlog monitoring.

5.1.1 OverviewofAvailableToolsforRFCPerformance Analysis


5.1.1.1ST03NWorkloadOverview
OncetheRFCStatisticshavebeenactivated,theycanbeusedtoanalyzeRFCcommunication performance.FordetailsongeneralusageofST03N,refertosection8.2.2ofthisdocument. Forageneraloverviewofhowaspecificserverisperforming,choosetherelevantserverthatyou wanttoanalyze,timeperiod,andthengotoAnalysisViews>>WorkloadOverview.Lookattasktype RFCforanoverviewofperformanceofRFC(NOTE:thisiswhenthisserveractedastheRFCserver). ThefollowingcalculationcanbeusedtofindouthowCPUintensiveRFCisoneachparticularserver:

((avg.CPU+avg.DB+avg.Load+Gen+avg.Rollin&Rollouttime)/1000)*NumberofSteps/ secondsoftheviewedperiod=numberofCPUsusedbyRFC
Ifmultipleinstancesareinuseandiftheresultofabovecalculationishighforthecentralinstancebut lowforotherapplicationservers,someimprovementmightbegainedbydistributingtheRFCload moreevenlyacrosstheservers.

2008SAPAG

57

BestPractice:RFCMonitoring

Figur e40 Wor kloadover viewwithST03N ForamoredetailedanalysisofRFCperformanceusetheRFCprofiles,selectaspecificserverof interest/orselectallservers(Totalasbelow)andchooseatimeperiodi.e.day,week,month.

Choosea specificser ver orallserver s (Total)

Choosea particularRFC profilei.e. Client,Server


Figur e41 RFCClientpr ofile listofcalledfunctionmodules

5.1.1.2ST03NRFCClientProfile
UsingtheRFCClientprofile(choose:Analysisviews>RFCprofiles>ChooseRFCprofile:RFC ClientProfile.)asillustratedabove,allowsanalysisofRFCcommunicationwhenthisparticularserver actsastheRFCclient.ChoosingthetabFunctionModuledisplaysalistofthecalledfunctionmodules fortheselectedserver/serversovertheselectedtimeperiod.AsthisistheRFCclient,weshouldbe lookingoutforlongconnectiontimesthiscanbeachievedbysortingbyCallTime(averageortotal, inSAPreleasesNW2004andNW2004sthesecolumnsiscalledTTimeandTime/RFC)toget thosefunctionmoduleswiththelongestprocessingtimesatthetopofthelist.Detailedanalysis(RFC trace)shouldbeperformedonthefunctionmoduleswhere,asaruleofthumb,thefollowingistrue: 2008SAPAG 58

BestPractice:RFCMonitoring

calltimeexecutiontime>20%(thatis,>20%processingtimeisspentonestablishingaconnection).
Possiblereasonsforlongconnectiontimesinclude: Establishmentoftheconnectiontakesalongtime,forexample,RFCserverisoverloadedor insufficientnumberofregistrationsbytheRFCServerprograms Datatransfertakestoolong,forexamplenetworkbandwidthoramountofdatatobe transferredtohigh

Itisalsopossibletodoubleclickoneachfunctionmoduletoaccessgreaterdetailaboutthecalled functionmoduleinformationavailableincludeslocaldestination,remotedestination,userwhocalled functionmodule,bytessent,bytesreceivedseefigurebelow.

Figur e42 Additionalinfor mationbydoubleclickingonfunctionmodule ChoosingtabTransactionallowsyoutoviewalistofallRFCspawningtransactions.Likeabove, abovedoubleclickingonthetransactionprovidesfurtherinformation.

2008SAPAG

59

BestPractice:RFCMonitoring

Figur e43 ListofRFCspawningtr ansactions

ChoosingtabUserallowsyoutoviewalistofallRFCspawningtransactions.Similartoabovedouble clickingonthetransactionprovidesfurtherinformation.

2008SAPAG

60

BestPractice:RFCMonitoring

Figur e44 ListofRFCuser s

5.1.1.3ST03NRFCServerProfile
UsingtheRFCServerprofile(Analysisviews>RFCprofiles>ChooseRFCprofile:RFCServer Profile.)asillustratedbelow,allowsanalysisofRFCcommunicationwhenthisparticularserveracts astheRFCserver.ChoosingthetabFunctionModuledisplaysalistofthecalledfunctionmodulesfor theselectedserver/serversovertheselectedtimeperiod.AsthisistheRFCserver,youshouldbe lookingoutforhighloadfunctionmodules,thatis,executedfrequentlyandlongrunningfunction modules.ThiscanbeachievedbysortingbyNumberofcallsandTotalexecutiontimetogetthose functionmoduleswhichimposemostloadontheRFCserver. SortbyNumberofRFCCalls: If, forexample,thenumberofcallsforafunctionmodulewithinacertaintimeframe,for example,24hoursindicatesthatitiscalledeverysecondorwithanevenhigherfrequency, itshouldbeanalyzedwhyitiscalledsooften. SortbyTotalexecutiontime: TogetthosefunctionmodulesthatcausethehighestRFCloadonthesystemthese shouldbeanalyzedindetailusinganRFCtrace.

2008SAPAG

61

BestPractice:RFCMonitoring

Figur e45 RFCSer verPr ofile listofcalledfunctionmodules Itisalsopossibletodoubleclickoneachfunctionmoduletoaccessgreaterdetailaboutthecalled functionmoduleinformationavailableincludeslocaldestination,remotedestination,userwhocalled functionmodule,bytessent,bytesreceived(seefigurebelow).

Figur e46 Fur therinfor mationonRFCser verfunctionmodule

Inadditiontotheabove,theRFCServerProfilealsoprovidestabswhichdisplayRFCspawning transactionsandalsotheRFCusersforthespecifiedperiod.

2008SAPAG

62

BestPractice:RFCMonitoring

5.1.1.4ST03NRFCClientDestinationsandServerDestinations
TheRFCProfilesalsoprovidetwootherusefulanalysistoolsRFCClientdestinationprofileandthe RFCServerdestinationprofile: TheRFCClientdestinationprofileliststhosetargets/SM59destinations,whichwerecalledbythe localsystem(RFCClient).AsthisistheRFCclient,weshouldbelookingoutforlongconnection timesthiscanbeachievedbysortingbyCallTime(averageortotal,inSAPreleasesNW2004and NW2004sthesecolumnsiscalledTTimeandTime/RFC)togetthosedestinationswiththe longestprocessingtimesatthetopofthelist. Detailedanalysisshouldbeperformedonthedestinationswhere,asaruleofthumb,thefollowingis true:calltimeexecutiontime>20%(i.e.>20%processingtimeisspentonestablishinga connection).Possiblereasonsforlongconnectiontimesinclude: Establishmentoftheconnectiontakestoolong,forexampleRFCserverisoverloadedor insufficientnumberofregistrationsbytheRFCServerprograms Datatransfertakestoolong,forexample,networkbandwidthoramountofdatatobe transferredtohigh

**Targetstab=SM59destinations

Figur e47 RFCClientdestinations Itisalsopossibletodoubleclickoneachdestinationtoaccessgreaterdetailaboutthecalled destinationinformationavailableincludestransaction/reportcalled,localdestination,remote destination,user,bytessent,bytesreceived(seefigurebelow).

2008SAPAG

63

BestPractice:RFCMonitoring

Figur e48 RFCClientdestination,additionalinfor mationbydoubleclickingonfunctionmodule RFCServerdestinationliststhosetargets/SM59destinations,whichcalledthelocalsystem(RFC Server).AsthisistheRFCserver,youshouldbelookingoutforhighloadparticulardestinationsplace onthisRFCserver,thatis,executedfrequentlyandhighexecutiontime.Thiscanbeachievedby sortingbyNumberofcallsandTotalexecutiontimetogetthosedestinationswhichimposemostload ontheRFCserver. **Targetstab=SM59destinations

Figur e49 RFCSer verdestinations Itisthenpossibletodoubleclickontheproblematicdestinationtogetfurtherdetailsonwhich transactions/reportsandwhichusersarecausingthehighloads(seefigurebelow).Further investigationshouldbecarriedoutbasedonthisinformation.

2008SAPAG

64

BestPractice:RFCMonitoring

Figur e50 RFCSer verdestinationsfur ther details

5.1.2 ActivationofPerformanceMonitoringWithTransaction ST03N


IntheworkloadmonitorST03N,youcandisplaytheworkloadcausedbyRFCs.BydisplayingtheRFC profiles,youcananswerthefollowingquestions: Whichtransaction,whichfunctionmodule,andwhichusercausedwhatworkloadthrough RFCcallsasanRFCclientoranRFCserver? Whatworkloaddothetransactions,functionmodules,oruserscauseinwhichlocalorremote RFCdestinations?

FortransactionstepswithRFC,thekernelwritessubrecordswithadditionalinformationaboutthe processingtime,thedestination,andthefunctionmoduleused.Theparameterstat/rfcrec(default: stat/rfcrec=5)specifiesthemaximumnumberofsubrecordsofeachtype(RFCclient,RFCserver, RFCclientdestination,andRFCserverdestination)thatthekernelwrites.IfmoreRFCsare performedduringatransactionstep,onlythefivecallswiththelongestexecutiontimearetherefore logged,whichissufficientforperformanceanalyses.Therestrictiontoamaximumoffiverecords representsacompromisebetweentherequiredaccuracyononesideandtheworkloadcreatedbythe performancecollectorontheotherside.Alargervalueforstat/rfcreccanleadtoperformance problemsinthecollector.TheRFCclientandRFCserverrecordscontaindatasuchasexecutiontime andcalledfunctionforindividualRFCs.TheRFCdestinationrecordscontainthetotalofallRFCcalls perdestinationandthereforenoadditionalinformationaboutthecalledfunctionmodules.

5.1.2.1ActivatingtheStatisticalCollectors
ItispossiblethatnoRFCstatisticsarestored,asitispossibletoturnthemoffinthesystem.The stepstoreactivatethemonitoringaredifferentfor4.x,NW2004,NW2004sversionsofSAP.Herewe willdescribethedifferentmethodsofactivation.Foreachsystemversionyouneedtoenter transactionST03N>>ExpertMode.

2008SAPAG

65

BestPractice:RFCMonitoring

a) ForSAP4.x:
InST03N,youneedtogointothecollectorbranch>workloadcollector>Collectorandreorg.

Figur e51 ActivationofRFCStatisticswithST03N Clickbutton:Modifyparameters.

Figur e52 activationofRFCStatisticswithST03N Inthisscreen,wesuggestthatyouactivateallthecheckboxesandoptions.AtleasttheCumulate RFCprofilesentryunderStatisticaldatatobecumulate&Controlsforthecollectorhastobeactive. Then,savethechoices.Inaddition,itishighlightedabovehowyoucanmodifytheresidencetimesfor statisticaldata.

2008SAPAG

66

BestPractice:RFCMonitoring

b) ForSAPNW2004:
CalltransactionST03N>>thenCollectorandPerformanceDB

Figur e53 ActivationofRFCStatisticswithST03N Inallthementionedsubscreens,youhavethechoicetousetheSAPDefaultsbutton.Thisoptionwill settheparameterstovalueswhicharesuggestedbySAP.Makesuretonotewhichparametersyou modifiedinthesystem,aseverythingyouhavesetmanuallywillbeerasedbythedefaults. ChoosePerformanceDatabase>Reorganizationhereyoucanmodifyallthesettingsrelatingtothe retentiontimesofperformancedata.

Figur e54 ST03nRetentiontimefor per for mancedata Next,chooseWorkloadCollector>>ControlData.Inthisscreen,youcanchoosehowmuchdatais storedonthelocalfilesystem.Beawarethatthereisnoexactinformationonhowlargethefilescan get,sopleasemakesurethatyouhaveenoughdiskspaceavailablefortheselogs.

2008SAPAG

67

BestPractice:RFCMonitoring

Figur e55 ST03NRetentionofstatisticfiles Next,chooseWorkloadCollectorDatabase>>StatisticstoBeCreated.Here,youcanchoosewhat dataisstoredinthesystem. Wesuggestactivatingallthechecks,buttheRFCstatisticsisthe minimumwhichshouldbeactivated.

Figur e56 ST03N Selectionofdatatocumulate

2008SAPAG

68

BestPractice:RFCMonitoring

c) ForSAPNetWeaver2004s:
CalltransactionST03N>>thenCollectorandPerformanceDB

Figur e57 ActivationofRFCStatisticswithST03N Inallthementionedsubscreens,youhavethechoicetousetheSAPDefaultsbutton.Thisoptionwill settheparameterstovalueswhicharesuggestedbySAP.Makesuretonotewhichparametersyou modifiedinthesystem,aseverythingyouhavesetmanuallywillbeerasedbythedefaults. ChoosePerformanceDatabase>Reorganizationhereyoucanmodifyallthesettingsrelatingtothe retentiontimesofperformancedata.

Figur e58 ST03NRetentiontimeforper for mancedata ChooseWorkloadCollectorDatabase>>Reorganization>Control.Here,youcanmodifyallthe settingsrelatingtotheretentiontimesofaggregatedperformancedata.

2008SAPAG

69

BestPractice:RFCMonitoring

Figur e59 ST03Nmaintenanceofcollectorpar ameter s(r etentionperiodsaggregateddata) ChooseWorkloadCollector>>InstanceCollector>Control.Here,youactivatecollectionof aggregatedperformancedataatinstancelevel.

Figur e60 ST03Nmaintenanceofcollectorpar ameter s(Instancestatisticsaggregation) ChooseWorkloadCollector>>TotalCollector>Control.Here,youactivatecollectionofaggregated performancedataatoverallsystemlevel.

2008SAPAG

70

BestPractice:RFCMonitoring

Figur e61 ST03Nmaintenanceofcollector par ameter s(Totalstatisticsaggr egation) Theparameterstat/rfcrec,whichcontrolsthenumberofRFCsubrecordstobegenerated,is configuredusingST03n(Expertmode)>>CollectorandPerformanceDB>>StatisticsRecordsand File>>OnlineParameters>>DialogStepStatistics.(Thisisthesameprocedureforallversionsof SAP)

Figur e62 Configur ingthenumber ofRFCsubr ecor ds

5.1.2.2SingleStatisticalRecords(STAD)
FordetailsongeneralusageofSTADrefertosection8.2.3ofthisdocument.Fromtheinitial STADselectionscreen,limittheselectiontoretrieverelevantrecordsandpressentertodisplay therelevantstatisticalrecords.Identifyrecordswiththelongestresponsetimeanddoubleclick ontherecordtodisplayfurtherdetails(seefigurebelow):

2008SAPAG

71

BestPractice:RFCMonitoring

Figur e63 SingleStatisticalRecor dsDetails ThefigurebelowshowsastatisticalrecordwithRFC. RFC+CPICtimeisthetimespentonRFC/CPIC handlinganditincludescommunicationtime,processingtimeontargetsystemandtherefore,Roll WaitTime.IfRFC+CPICtimeissignificantlygreaterthanRollwaittime(asitisabovei.e.approx1.5 seconds),thisindicatesaproblemduringthecommunicationbetweenthesystems.Inthiscase,check whetherthereasonisdueto: Aslownetworkconnection Noworkprocessavailableinthereceiversystem IfRFC+CPICtimeisequaltoRollwaittime,thisindicatesthatthecommunicationbetweenthe systemsisfast.IfthisisthecaseandyouhaveidentifiedanRFCcalltobeslow,youmayneedto performfurtherperformanceanalysisoftheRFCfunctionmoduleinthereceiversystem. InorderanalyzeRFCperformancefurther,youcanusetheRFCsubrecordsasshownbelow.Usethe RFCbuttonorscrolldowntogettothisparticularanalysistool.

2008SAPAG

72

BestPractice:RFCMonitoring

Figur e64 STAD RFCsubr ecor ds TheRFCsubrecordsshowthe5mostexpensiveRFCcallstotheparticulardestinationyoushould usethisinformationtocarryoutanindepthanalysisofRFCperformanceandidentifywheretimeis beingspent.SAPNoteNo.552845explainseachofthestatisticsavailableintheRFCsubrecords. DependingonfindingsyoumayneedtoexecuteanRFC,SQLorABAPtracefordetailedanalysisof problem.

2008SAPAG

73

BestPractice:RFCMonitoring

5.1.2.3PerformanceTrace(ST05)

YoucanalsogetInformationonRFCusinganST05trace.TheinformationissimilartoClientand Serversubrecords.FordetailsongeneralusageoftheperformancetraceST05,refertosection8.2.4 ofthisdocument.OntheinitialselectionscreenofST05,choosetheRFCtraceandactivatethetrace accordingly.Afteryouhavecapturedyouranalysisperiod,deactivatethetraceanddisplayit.Itshould looksomethinglikethefigurebelow(thefigurerepresentsanRFCtraceforRFCClient). Whenyougo tothedetailedstatement(doubleclickonRFCentry)ofanRFCentry,theIPaddressesofclientand serverarevisible.Inthiscase,thenamesoftheservercontaintheSAPsystemname:Clientand serverbelowisbothU68.ThenameoftheRFCdestinationisnotshown,therefore,thecorrect destinationwhichisdisplayedinSM59hastobedeterminedbytrialanderrormethod,usingthe informationofservernamesandIPaddresses.Thetransferreddatavolumesforsendingand receivingaregivenbelow.ThedurationisthetotalprocessingtimeoftheRFCforsendinguntil receivingthedata.TheRFCtimeinthedetailedstatementdocumentstheprocessingtimein microsecondsontheclientmachine(normallythecontributionofthisvalueissmall).Thenameofthe functionmoduleisalsodocumented(here:RFC_PING).

Figur e65 ST05RFCClientper for mancetr ace

Figur e66 ST05RFCClienttr acestatementdetailed 2008SAPAG 74

BestPractice:RFCMonitoring

Onserverside,incomingRFCsarealsorecordedbytheST05.TheRFCentryinST05hasthe operationmode=SERVER.ThedurationtimeisthetimeneededforexecutionofRFContheserver side. InthedetailsofanRFCentry(doubleclickontheRFCentry),anRFCtimeisgivenwhichindicates theinternalprocessinginmicroseconds.Thistimeshouldnotbeusedforperformanceanalysis,since itdescribesonlyasmallpartofthecompleteRFCprocessing.Thedatatransferforsendingand receivingisindicatedineachrow.

Figur e67 ST05RFCSer verper for mancetr ace

Figur e68 ST05RFCSer vertracestatementdetailed RFCtraceusingST05canbecombinedwithanSQLtraceandthiscanprovideveryuseful information.ThisisdoneusingtheselectioncriteriaontheST05initialscreenbychoosingboththe RFCandSQLtracesactivatethetraceaccordingly.Afteryouhavecapturedyouranalysisperiod, deactivatethetraceanddisplayit.Itshouldlooksomethinglikethefigurebelow:

2008SAPAG

75

BestPractice:RFCMonitoring

Figur e69 ST05tr acewithactiveSQLandRFCtr aceoptions TheaboveST05traceisshownwithactiveSQLandRFCtraceoptions.TheSQLtraceonserverside showsafulltablescanontableEINA(RED).TheincomingRFC(typeServer)showshowlongthe executionoftheRFCtook.ThetimestampoftheRFCdefinesthestarttimewheretheexecution starts.ThefirstSQLstatementsoccurshortlyafterthistimestamp.Fromthetimestampofthefirst SQLstatementuntilthelaststatementhasfinishedittook1.597msec.Thisisnearlythecomplete processingtimeoftheRFContheserverside.Hence, theperformanceproblemonserversideisan expensivestatementontableEINAduetowrongindex.

ST12canalsobeusedtoperformtheaboveperformancetracespleaseseesection8.2.6regarding usageofST12.

5.1.2.4UsingSM59totestconnectionperformance
InSM59,theRFCconnectioncanbetested.Thistoolisusefultotestiftheconnectionexistsand worksproperly.Forperformancetestsitcanonlybequalitative,asdescribedbelow. Thetestisperformedinseveralsteps:First,onlyaconnectiontotheserversystemisestablished. Thetimeforthelogonprocessisdisplayed.Inthenextsteps,datapackagesofdifferentsizesare sentandreceived.ThesizesofthepackagesareNOT10,20,30Kbytesasstatedintheconnection test.Thedataiscompressedanddatatypeconversioncantakeplace,whichdependsonthe operatingsystemsusedonsenderandreceiverside.Thelogontimedependsonthenumberof authorizationstheRFCuserhasgot.Auserwithlessauthorizationrightscanlogonfasterthanauser withmanyrights.Theprocessingtimeofthelogonprocessdependsontheactualsystemloadon serverside. Sinceseveraltableentriesofuserauthorizationswillbebufferedintablebuffers,theresponsecanbe significantlyslowerthefirsttimethanthefollowingtime.Ifthereisaconnectionproblem,anerror messageisdisplayed.

2008SAPAG

76

BestPractice:RFCMonitoring

Figur e70 SM59 testingconnectionper for mance

2008SAPAG

77

BestPractice:RFCMonitoring

5.2 Automated Performance Monitoring


UsingtheSAPSolutionManageranditsBusinessProcessMonitoringfunctionality,youcan automaticallymonitortheaverageresponsetimeofselectedprogramsorfunctions. FordetailsonRFCPerformanceMonitoringwithinSAPSolutionManagerrefertothesection AutomatedRFCPerformanceMonitoring. AutomatedMonitoringObjectswithSAPSolutionManager Monitoring Monitor Monit Indicatoror Monitoring Object TA/Tool Freq. Error Activityor Error Handling Procedure Totalresponse Business As Long Startthe timeoftheRFC Process needed response analysis processingfor Monitoring times using specific withinthe transaction programsand/ SAP /nSTADor orfunction Solution /nST03N modules Manager. (Refertothe section

Respon sibility

Escalation Procedure

SAP Technology Operations Team

SAP Technology Operations Team/ Application Management Team

Automated RFC Performance Monitoring)

2008SAPAG

78

BestPractice:RFCMonitoring

6 Aspect: Resource Monitoring


Resourcemonitoringincludesthemonitoringoftheavailabilityofinvolvedcomponentsaswellastheir resourceconsumption.Thissectionwillshowyouhowaresourcemonitoringforinterfacemonitoring withRFCscenarioscouldbedone.Inthefirstsubsection,youfindpossibilitiesonhowtodoamanual monitoringanderrorhandling.Thesecondsubsectionoutlinespossibilitiesforanautomated monitoring. MonitoringRequirements: Toenablethesuccessfulexecutionofinterfaces,itisimportantthatsufficientresourcesareavailable. Itisimportantthatthefollowingresourcesaremonitoredforavailabilitytoensureoptimalinterface performance. MonitoringObjects: Workprocesses Queues CPU Memory Buffers Database

Figur e71 Resour ceover viewinALEpr ocessing

2008SAPAG

79

BestPractice:RFCMonitoring

6.1 Manual Resource Monitoring


MonitoringObjectsw/oSAPSolutionManager
Monitoring Monitor Monitor Object TA/Tool Freq. Indicatoror Error MonitoringActivityor ErrorHandling Procedure Responsibility Escalation Procedure

SM50 Slow processing on sender/rec eiver systems

Hourly WPstatus,WP during utilization peak hoursand incaseof performan ce problems orerror messages

Monitorcurrentstateof individualwork processes.Ensurethat enoughworkprocess capacityisavailableat peaktimes. Ifmultiplework processesonsender systemareinStatus Stopped,Reason CPICand Action/Reason CMINIT.This represents communication initializationandshould lastonlyafew milliseconds.Ifahigh numberofthesetypes ofentriesarevisibleit indicatesthatthe receiversystemis overloadedinwhich casetargetsystem resourcesshouldbe checked. Thereferencederror canalsooccurifmultiple userswanttouse functionalityofan externalRFCprogram whichisonlystartedand registeredoncein gateway,thegateway queuesalluserrequest tobeprocessesfirstin firstout.Ifthewaiting timeexceedsthevalue ofgw/reg_timeout parameter(default:60 seconds),thecaller receivesa communicationerror (timeouterrorappearsin errorlogs).Possible overloadshouldbe addressedwithexternal softwareprovider.If possible,external programshouldbe registeredmultipletimes

SAP Technology Operations Team

SAP Technology Operations Team

2008SAPAG

80

BestPractice:RFCMonitoring
Monitoring Monitor Monitor Object TA/Tool Freq. Indicatoror Error MonitoringActivityor ErrorHandling Procedure Responsibility Escalation Procedure

SM66 Slow processing sender/ receiver systems

Hourly WPstatus,long SimilartoSM50butfor during runningjobs systemwidestatistics. peak hoursand incaseof performan ce problems orerror messages Numberof aRFCresources currently availablefor asynchronous RFCcalls RuntransactionSARFC andmonitorcurrent stateofindividualwork processes.Ensurethat enoughworkprocess capacityisavailablefor aRFCcommunicationat peaktimes. Ifanapplicationusesa lotoftransactionalor asynchronousRFC,itis possiblethatthiscan overloadthe participatingapplication servers.Itisimportant thatenoughwork processesareavailable forbothDialogusers andforRFC communication. ResourceusagebyRFC canbecontrolledusing variousprofile parameters.SeeSAP Note74141fortuning hintsregardingresource configurationforRFC

SAP Technology Operations Team

SAP Technology Operations Team

SARFC Hourly Slow processing during peak sender/ hoursand receiver incaseof systems performan ce problems orerror messages

SAP Technology Operations Team

SAP Technology Operations Team

SM58 Slow processing Sender system

Hourlyin caseof performan ce problems orerror messages

StatusText shows Transaction recorded

RuntransactionSM58 lookoutforstatustext Transactionrecorded. ThisIndicateslackof resourcesinthetarget systemCheckresources inthetargetsystem. RuntransactionSMQS andcheckforstatus Waiting.Ifstatus waitingisfoundit indicatesthatsender systemisexperiencinga workprocessshortage. CheckfurtherinSMQS >>Goto>>QRFC

SAP Technology Operations Team

SAP Technology Operations Team

qRFCnot SMQS HourlyIn Statusshows processed caseof Waiting onsender performan system ce problems orerror messages

2008SAPAG

81

BestPractice:RFCMonitoring
Monitoring Monitor Monitor Object TA/Tool Freq. Indicatoror Error MonitoringActivityor ErrorHandling Procedure Responsibility Escalation Procedure

resources.(seeSAP Note527481). SMQS HourlyIn Slow processing caseof insender performan system ce problems orerror messages Statusofthe destination shows WAITCONN indicateslackof rfcresourcesin sendingsystem assignedtothis rfcdestination Checkthenumberof workprocesses configuredforthis particulardestination usingtransactionSMQS >checkthevalue specifiedincolumn Max.Connforthe destination. Checktheconfigured numberofresources dedicatedtoRFC againstthenumberof availablework processesonsender systembyusing transactionsSARFC. andSM50. Decideifenoughwork processesare configuredfor destination qRFCnot SMQR processed onreceiver system Status WAITINGin SMQR RuntransactionSMQR andcheckforstatus WAITING.Ifstatus WAITINGisfoundit indicatesthatreceiving systemisexperiencinga workprocessshortage. CheckfurtherinSMQR >>Goto>>QRFC resources.(seeSAP Notes527481and 369007forfurther details) Runtransaction SMQ1/SMQ2.Ifentries inaqueuearenot processedandqueue remainsinacertain statusformorethan 30mins.RefertoSAP Note378903 IncasebgRFCunitsdo notgetprocessed, checkstatusofthe bgRFCschedulers SAP Technology Operations Team SAP Technology Operations Team SAP Technology Operations Team SAP Technology Operations Team

qRFCsnot SMQ1/ HourlyIn processed SMQ2 caseof sender/rec performan eiver ce system problems orerror messages

Statusof queues,if entriesina queuearenot processedand queueremains inacertain statusformore than30mins StatusofbgRFC queuesand bgRFC schedulers

bgRFCs SBGR On not FCCO demand processed NF& SBGR FCMO N System SMGW During

SAP Technology Operations Team

SAP Technology Operations Team

Errormessages Review

SAP

SAP 82

2008SAPAG

BestPractice:RFCMonitoring
Monitoring Monitor Monitor Object TA/Tool Freq. Indicatoror Error MonitoringActivityor ErrorHandling Procedure Responsibility Escalation Procedure

parameter &ST11 periodsof sforahigh veryhigh interface ALE/RFC load loadand or performan ce problems

in recommendationsas perSAPNote384971 thegateway traceorother developertraces regarding terminationsi.e. SAPRC=672, R3_LOGIN_FAI LED,Nowp_ca blockreceived, Nofreeblock foundintheWP Communication Area, MAX_CPIC_CLI ENTS, CONN_EXCEE DED,

Technology Operations Team

Technology Operations Team

Operating system monitor

ST06

Hourly Highpagingrate RuntransactionST06 (dependin andCPU andmonitortheCPU gonthe utilization andmemory business consumption.A process) hardwarebottleneckcan andin haveanegativeimpact caseof ontheoverallresponse performan timeaswellasthe ce responsetimeofan problems individualbusiness transaction. Especiallymonitor hardwareloadduring highRFCtransmission times. HourlyIn Occurrenceof caseof swaps performan ce problems orerror messages Monitormemory resourceusagefor specificR/3application servers Toensureoptimal performancecheckthat theR/3parametersare setcorrectlywith transactionST02. IncorrectlysizedR/3 buffersormemory allocationcanresultin poorperformance.One suchexamplewouldbe whenaworkprocess enterPRIVmode. Ensurethatthedata qualityissufficient,that therearenomissing indexes,andthatthere issufficientspace available.

SAP Technology Operations Team

SAP Technology Operations Team

ST02 R/3 System buffer monitor sender/rec eiver system

SAP Technology Operations Team

SAP Technology Operations Team

Database DB02 perform ance monitor sender/rec eiver 2008SAPAG

Weekly andin caseof performan ce problems

Tablesizes, tableindicesfor tRFCandaRFC tables

SAP Technology Operations Team

SAP Technology Operations Team

83

BestPractice:RFCMonitoring
Monitoring Monitor Monitor Object TA/Tool Freq. Indicatoror Error MonitoringActivityor ErrorHandling Procedure Responsibility Escalation Procedure

system

Ingeneraliftablesizes arelargerthan500MB, reorganizethetableand decreaseitssize. SeeSAPNote375566. Monitorthegrowingof tablesandindices, especiallyontRFCand qRFCtables (ARFCSSTATE ARFCSDATA ARFCRSTATE)Since thetRFCandqRFC tablesshrinkand expandconstantly,the storagequalityofthe indexesforthesetables mightbeinadequate. Thishasanegative impactonthe performance.

6.2 Automated Resource Monitoring


Manyofthemanualmonitoringobjectsforthegeneralsystemavailability,performanceandstability areavailablewithinSAPCCMSandSAPSolutionManager. ThecompletetechnicalsystemresourcemonitoringcanbeperformedautomaticallywithintheSystem MonitoringpartoftheSAPSolutionManagerindividuallypersystemandinstance. AutomatedMonitoringObjectswithSAPSolutionManager
Monitoring Object Monitor TA/Tool Monit Freq. Indicatoror Error Monitoring Activityor Error Handling Procedure Respon sibility Escalation Procedure

SAPSystem resources numberoffree workprocesses, dialogsteps perminute CPUutilization Memoryusage DBkeyfigures etc.)

SAP CCMS/ SAP Solution Managers System Monitoring part

15 Resource minutes shortage

Analyzethe system stabilityand performance

SAP technology operations team

SAP Technology Operations Team

ForfurtherdetailsonSystemMonitoringwithinSAPSolutionManager,referto http://service.sap.com/solutionmanager>Functionsindetail>SolutionMonitoring>System Monitoring.

2008SAPAG

84

BestPractice:RFCMonitoring

7 Aspect: Data Management


MonitoringRequirements: TheRFCrelevanttablesthatarelistedbelowhaveadirectimpactonperformancethesetablesgrow veryquickly,andifnotmanagedcorrectlycauseinterface(s)toexecuteslowly. MonitoringObjects: AdatamanagementstrategyshouldbesetupforthefollowingRFCrelevanttables.

7.1 Classic qRFC


RFCrelatedtables DBTableName TableDescription ARFCSSTATE ARFCSDATA TRFCQOUT ARFCRSTATE TRFCQDATA TRFCQSTATE TRFCQIN ARFCCallStatus(Sender) ARFCCallData(Sender) tRFCQueue(outbound) StatusofARFCCallsonReceiverSide qRFC(inboundqueue) qRFCCallConditions(InboundQueue) tRFCQueue(InboundQueue)

ForRFCtables,suchas,ARFCSSTATE,ARFCRSTATE,ARFCSDATA,TRFCQOUT,TRFCQDATA, TRFCQSTATEandTRFCQIN,performanceproblemsoftenoccurasaresultofalargenumberof blocksallocatedforthesetables,outdatedstatisticsandpoorstoragequality. Recommendation: Ifyoufindthetablestobelarge/havepoorstoragequalityyoucanimproveperformanceby reorganizingthesetables.Oncethatiscomplete,followtheregularmaintenancestepsbelow: ThefollowingreportsareusedfordeletingentriesfromtheRFCtables: RSARFCDL:DeletestRFCEntriesfromLogFile.Thisreportdeletestheerrorlogof theARFCinthebackground. RSARFC01:tRFCReorganization. RSTRFCES:DeletesARFCSSTATE,ARFCSDATA,TRFCQOUTentries. RSARFCER:DeletestRFCinreferencetothestatus

RefertoSAPNote324545and375566foradditionaldetails. Thesetablesareconsideredvolatile,andstatisticsshouldnotbecollected.Also,duetothehigh volumeofdata,andfrequentchanges,theindexesforthesetablesshouldbereorganizedona regularbasis. Inthefollowingbestpracticedocumentyouwillfindstandardrecommendationsonthetopic datamanagementandspecificrecommendationsfordifferentDBtablesincludingtheRFC interfacerelatedDBtables:http://service.sap.com/~sapidb/011000358700005044382000Eor visitquicklinkhttp://service.sap.com/ilm.

2008SAPAG

85

BestPractice:RFCMonitoring

7.2 Background RFC


OverviewonbgRFCrelateddatabasetables Direction all all all inbound outbound inbound inbound outbound outbound inbound inbound inbound inbound inbound inbound outbound outbound outbound outbound outbound outbound inbound inbound inbound inbound inbound inbound inbound outbound outbound outbound outbound outbound outbound outbound outbound outinb. nosend nosend nosend Qual.of service all all all all all all all all all transact. transact. transact. transact. transact. transact. transact. transact. transact. transact. transact. transact. queued queued queued queued queued queued queued queued queued queued queued queued queued queued queued queued queued queued queued Tablename BGRFC_UNIT_TIME BGRFC_LOCK_TIME BGRFC_UTASK_KEY BGRFC_IUNIT_HIST BGRFC_OUNIT_HIST BGRFC_I_DESTLOCK BGRFC_I_RUNNABLE BGRFC_O_DESTLOCK BGRFC_O_RUNNABLE TRFC_I_DEST TRFC_I_SDATA TRFC_I_UNIT TRFC_I_UNIT_LOCK TRFC_I_ERR_STATE TRFC_I_EXE_STATE TRFC_O_DEST TRFC_O_SDATA TRFC_O_UNIT TRFC_O_UNIT_LOCK TRFC_O_ERR_STATE TRFC_O_EXE_STATE QRFC_I_QIN QRFC_I_QIN_TOP QRFC_I_SDATA QRFC_I_UNIT QRFC_I_UNIT_LOCK QRFC_I_ERR_STATE QRFC_I_EXE_STATE QRFC_O_QOUT QRFC_O_QOUT_TOP QRFC_O_SDATA QRFC_O_UNIT QRFC_O_UNIT_LOCK QRFC_O_REF_UNIT QRFC_O_ERR_STATE QRFC_O_EXE_STATE QRFC_O_QIN LDQ_DATA LDQ_PROGRESS LDQ_STATE TableDescription TimestampwhenbgRFCsCompleted TimestampwhenbgRFCLocksRemoved AssignmentofUpdateKeystoUnitLocks HistoryofInboundbgRFCUnit HistoryofOutboundbgRFCUnit InboundtRFC/qRFC:DestinationLocks InboundtRFC/qRFC:ExecutableUnits OutboundtRFC/qRFC:DestinationLocks OutboundtRFC/qRFC:ExecutableUnits InboundtRFC:ClientandDestination InboundtRFC:UnitPayload InboundtRFC:UnitHeader InboundtRFC:UnitLocks InboundtRFC:UnitErrorState InboundtRFC:UnitExecutionState OutboundtRFC:ClientandDestination OutboundtRFC:UnitPayload OutboundtRFC:UnitHeader OutboundtRFC:UnitLocks OutboundtRFC:UnitErrorState OutboundtRFC:UnitExecutionState InboundqRFC:QueueOrder InboundqRFC:Queue(TopUnit) InboundqRFC:UnitPayload InboundqRFC:UnitHeader InboundqRFC:UnitLocks InboundqRFC:UnitErrorState InboundqRFC:UnitExecutionState OutboundqRFC:QueueOrder OutboundqRFC:Queue(TopUnit) OutboundqRFC:UnitPayload OutboundqRFC:UnitHeader OutboundqRFC:UnitLocks OutboundqRFC:UnitReference OutboundqRFC:UnitErrorState OutboundqRFC:UnitExecutionState Outbound/inboundqRFC:QueueOrder LDQ:ApplicationDataofUnit LDQ:PointerTable(Start,Progress,End) LDQ:StatusValues HV x o

x x x o x x x x o x x o x x o x x o x x o

x x X x X

Column"HV"triestoshowthepotentialriskofhighdatavolumeinthecorrespondingdatabasetable. Notethatthisisjustanestimation,because,atthemoment,thereislittlepracticalexperience. X PotentialhighriskincasetheLocalDataQueuescenarioisused x Potentialmediumrisk o Potentialmediumriskincasethelockingordelayfunctionalityisused Recommendations: Ifyoufindthattheabovementionedtablesarelargeand/orhaveapoorstoragequality,youcan improveperformancebyreorganizingthesetables. 2008SAPAG 86

BestPractice:RFCMonitoring

Thesetablesareconsideredvolatile,andthereforestatisticsshouldnotbecollected. Instead,runreportRS_QRFC_STATISTIConce(forORACLEdatabasesonly).Itsimulatesa temporaryloadsituationbyfillingthebgRFCtableswithdummyunits.Thensuitablestatistics arecreated.Afterwardsthequeueentriesaredeletedagain.ThetableDBSTATCismodified inordertopreventtheautomaticupdateofstatistics. Also,duetothepotentialhighvolumeofdata,andfrequentchanges,theindexesforthesetables shouldbereorganizedregularly.

7.3 Manual Data Volume Monitoring


MonitoringObjectsw/oSAPSolutionManager Monitoring Monitor Monit Indicator Object TA/Tool Freq. orError Monitoring Activityor ErrorHandling Procedure Tablesizes Analyzethe andfreeDB reasonsforthe space DBgrowthin transactions DB02,DB15. Specificallylook outforRFC tableslisted above. Respon sibility Escalation Procedure

TableGrowth

DB02, DB15

Daily

SAP Technology Operations Team

SAP Technology Operations Team

7.4 Automated Data Volume Monitoring


AutomatedMonitoringObjectswithSAPSolutionManager Monitoring Monitor Monit Indicator Monitoring Respon Object TA/Tool Freq. orError Activityor sibility Error Handling Procedure DBgrowth SAPCCMS/ Daily FreeDB Analyzethe SAP (/nRZ20>DB SAPSolution space reasonsfor Technology administration> Managers theDB Operations Dataarchiving) System growthin Team Monitoring transaction DB15, DB01 Escalation Procedure

SAP Technology Operations Team/ Application Management Team

2008SAPAG

87

BestPractice:RFCMonitoring

8 Setup Procedure for an Automated Interface Monitoring


Theaimofthissectionistooutlinethesetupprocedureforaselectiveinterfacemonitoring,whichcan bedoneinthecontextoftheunderlyingbusinessprocesses.Thesetupprocedureisdifferentforthe differentRFCtypesandmonitoringaspects.Thefollowingsectionsoutlinethefullscopefor automatedRFCmonitoring,whichispossibleforerrormonitoringofs/a/q/tRFCs,thebacklog monitoringofqRFCsandspecificperformancemonitoringbasedonthetotalresponsetimeof selectiveRFCs. Forsomemonitoringactivities,itispossibletouseatoolforautomatedmonitoring.Thisisalso possiblewithinterfacemonitoring.Suchautomatedmonitoringisoptimallyimplementedusing BusinessProcessMonitoringorSystemMonitoringinSAPSolutionManager. BusinessProcessMonitoring(BPMon)withinSAPSolutionManageristheproactiveandprocess orientedmonitoringofthecorebusinessprocessesofyourcompany.Itincludestheobservationofall technicalandbusinessapplicationspecificfunctionsthatarerequiredforasmoothandreliableflowof thebusinessprocesses. BusinessProcessMonitoring(BPMon)revealsevenslightdeviationsfromapredefined, ideal businessprocessstate,whichwouldotherwiseremainundetecteduntiltheflowoftheprocesswould beseriouslyimpacted.Itgivesautomatedalerts,includingthepossibilitytonotifytheseviavarious communicationmeanslikeemail,SMSetc.Typesoferrorsthatcanbemonitoredare,forexample, errorsfromlogs(systemlog,applicationlogetc),throughputandbacklogKPIsforvarious applications,dialogperformance,updateerrors,andsoon.Thepossibilitytokeepthealertsfora definedtimeallowstoevaluateakindofhistoryandtoidentifytrendsinthealertoccurrenceatan earlystate. AsaresultBPMonoffersyouthepossibilitytobettervisualizetheinterfacemonitoringwiththecontext oftheunderlyingbusinessprocesses.Intheexamplebelow,youseeanSAPCRMOutbound TelesalesbusinessprocessthatcommunicateswiththeSAPECCsystem,usingqRFCtechnology. Fromthebusinessprocessgraphic,youcoulddrilldowntothealertsoftheunderlyingbusiness processstepsorinterfacesandperformfurtheralerthandling.

ForfurtherdetailsonBusinessProcessMonitoringwithinSAPSolutionManager,referto http://service.sap.com/bpm. ForfurtherdetailsonSystemMonitoringwithinSAPSolutionManager,referto http://service.sap.com/solutionmanager>Functionsindetail>SolutionMonitoring> SystemMonitoring

2008SAPAG

88

BestPractice:RFCMonitoring

qRFCqueue

Figur e72 BusinessPr ocessMonitor ingwithinSAPSolutionManager

8.1 Automated qRFC Monitoring


TheqRFCmonitoringallowsmonitoringtheqRFCprocessinganditsindividualqueuesforstatusand backlog.Thiswayyoucanbenotifiedifthenumberofqueueentriesishigherthanexpected,theage oftheoldestentryofthequeueistoohighaswellasthecombinations.

2008SAPAG

89

BestPractice:RFCMonitoring

ThefollowingkeyfiguresareavailablewiththeaddonSTA/PI01K: Type* Description Backlog Numberofindividualqueuesingroup Backlog Totalnumberofentriesinallqueuesingroup Backlog Averagenumberofentriesperqueueingroup Backlog Maximumnumberofentriesperqueueingroup Backlog Age(inminutes)ofoldestentryingroup Backlog CombinationofTotalentriesandOldestage Status Numberofentrieswithcriticalstateingroup Status Age(inminutes)ofoldestcriticalstateentryingroup Status CombinationofEntriesandAgeincriticalstate Status Numberofentrieswithinterimstateingroup Status Age(minutes)ofoldestinterimstateentryingroup Status CombinationofEntriesandAgeininterimstate Age AgeofqRFCdatacollection FinddetailedinformationontheabovekeyfiguresandthesetupintheInterface MonitoringSetupGuideon http://service.sap.com/bpm>MediaLibrary >Technical Information >SetupGuideInterfaceMonitoring.

8.2 Automated tRFC Monitoring


FortRFCInterfaces,itisjustpossibletomonitorCPICERR,SYSLOADandSYSFAILerrors generically.ItisnotpossibletodistinguishbetweendifferentRFCdestinations.TherequiredMTEs existwithintheSAPCCMSbydefault.

Figur e73 tRFCMonitor ingTreeElementsinSAPCCMS InordertointegratethetRFCMonitorsavailableintheSAPCCMSofthesatellitesystemintotheSAP SolutionManager,youhavetonavigatetotransaction/nDSWPandthentoOperationsSetup> SolutionMonitoring>BusinessProcessMonitoring>SetupBusinessProcessMonitoring. IncaseaninterfaceisselectedformonitoringintheSAPSolutionManagerwiththeinterface techniquetRFC,asubnodeappearsInterface<NameoftheInterface>(tRFC).Underthissubnode anothernodeAlertMonitorsappears.There,clickthebutton:ReloadCCMS:tRFCAlerts.Allthree defaulttRFCmonitoringobjectsonthesatellitesystems(OutboundobjectsonSendersideand InboundobjectsonReceiverside)areloadedintothesession.Totransferalltheautomaticallyloaded thresholdvaluesatonce,selectCopyAll.Itisalsopossibletochangethethresholdvaluesforthe alertsmanually.

2008SAPAG

90

BestPractice:RFCMonitoring

Figur e74 Configur etRFCMonitor inginSAPSolutionManager Afterdefiningthemonitoringcustomizing,youhavetogenerateandactivatethemonitoring.Assoon astheprogramsand/orfunctionsthataremeasuredhavebeenexecutedandthedatacollectorhas run,youshouldseealertsifthethresholdvalueshavebeenmet.

FordetailsonBPMonrefertohttp://service.sap.com/bpmornavigatedirectlytothesetupguide http://service.sap.com/~sapidb/011000358700006137532006E.

2008SAPAG

91

BestPractice:RFCMonitoring

8.3 Automated bgRFC Performance Monitoring


SAPCCMSprovidesthefunctionalityforautomatedbgRFCmonitoring.TherequiredMTEsexist withintheSAPCCMSbydefault. Thefollowingmonitoringkeyfiguresareavailable: bgRFCinboundandbgRFCoutboundperdestination 1. NumberofTasksBeingUsed 2. CommunicationErrorRate 3. AverageDataRate bgRFCinboundschedulerandbgRFCoutboundscheduler 1. MemoryAllocation 2. CurrentThroughput 3. AverageThroughput

Figur e75 bgRFCPer for manceMonitor inginSAPCCMS

8.4 Automated RFC Performance Monitoring


AsoftheaddonreleaseSTA/PI01H,itispossibletomonitorDialogPerformanceonprogramname and/orfunctionmodulelevel.Therefore,thestatisticalrecordsthathavebeenwrittensincethelast collectorruncanbeevaluatedandanalertcanbetriggered,ifthemeasuredvaluedexceedstheset thresholdvalue.ThismonitoringisonlypossiblefortheserverRFCsthathavebeenexecutedonthe monitoredsystemandnottheonescalledfromthemonitoredsystem. FindhereanexampleforstatisticalrecordsoftypeRFCintransaction/nSTAD:

Figur e76 RFCPer for manceMonitor ing Findthestatisticalr ecor dsinSTAD

2008SAPAG

92

BestPractice:RFCMonitoring Bydoubleclickingononeoftheaboveentriesyoucanfindouttheprogramandfunctionnamethat havebeencalled.

Figur e77 RFCPer for manceMonitor ing Findthestatisticalr ecor dsinSTAD

2008SAPAG

93

BestPractice:RFCMonitoring

SetupprocedureintheSAPSolutionManager
Ifyoualreadyknowthenameoftheprogramand/orfunctionmodulethatneedstobemonitored,you canlogondirectlytoyourSAPSolutionManagerandperformthecustomizingthere.Navigateto transaction/nDSWP>OperationsSetup>SolutionMonitoring>BusinessProcessMonitoringand clickonSetupBusinessProcessMonitoring.Selectthebusinessprocessstepthatyouwanttomap themonitoringkeyfigureto.InordertosetuptheDialogPerformanceMonitoryouneedtoselectthe ApplicationMonitor.

Figur e78 RFCPer for manceMonitor ing HowtoincludeitintoBusinessPr ocessMonitor ing1 Asubnodeisnowcreatedwiththepossibilitytoloadavailableapplicationmonitoringobjectsfromthe involvedsatellitesystemviathebutton<SID>:ReloadAppMonObjects.Afterwards,allavailable monitoringobjectsaredisplayedintableApplicationMonitoringObject.

Figur e79 RFCPer for manceMonitor ing HowtoincludeitintoBusinessPr ocessMonitor ing2 2008SAPAG 94

BestPractice:RFCMonitoring

SelectDialogPerformanceMonitorandsave.Asaresult,asubnodewillbecreated. InnodeDialogPerformanceMonitor,youhavetwodifferenttabstrips.WithinthefirstoneKeyFigures youchoosethealerttypesyouwanttomonitor.Accordingtothealerttypesyouselected,newnodes arecreatedwhensavingyoursettingsoneforeachalerttype.

Figur e80 RFCPer for manceMonitor ing HowtoincludeitintoBusinessPr ocessMonitor ing3 ForDialogPerformanceMonitoringofRFCsonlytheTotalResponseTimecanbeevaluated.

Figur e81 RFCPer for manceMonitor ing HowtoincludeitintoBusinessPr ocessMonitor ing4 InthesecondtabstripDetailInformation,youspecifythedatacollectorperiodincolumnDCPeriod, thatis,howoftenthedatacollectorissupposedtorun.Thisisthetimewindowinwhichthe correspondingstatisticalrecordsaresummarizedandforwhichanaveragevalueiscalculated.The smallestpossiblevalueis5minutes,whichisusuallymostappropriatefortheDialogPerformance Monitor.Thedefaultvalueis60minutes. Ifyouwantthedatacollectortorunonlyonceaday,ataspecifictimeyoucanmaintainthecolumn DCStartTime. Ifthedatacollectorshouldonlyrunandevaluatecertaindaysduringtheweek,youcanflagthe correspondingweekday.Therefore,intheexampleabovenoalertswouldberaisedonSaturdayand Sunday. Onceyousaveyourentries,youcancustomizethedifferentalerttypesindividually. TheprogramnamecanbemaintainedincolumnValue1 andthefunctionmoduleincolumnValue2. Itispossibletomaintaineithercombinationsofprogramnameandfunctionmodule,orjustaprogram nameorfunctionmodule. Inourexample,itistheprogramSAPLIPC_V01withthefunctionmoduleEXTRACT_DATAand thecalltypeRforRFC.

2008SAPAG

95

BestPractice:RFCMonitoring

Figur e82 RFCPer for manceMonitor ing HowtoincludeitintoBusinessPr ocessMonitor ing5

ForRemoteFunctionCalls,onlythetotalresponsetimecanbemonitoredandonlyserver RFCsareconsidered. Foreachofthealerttypes,youcanspecifythefollowingcombinations: IftheprogramnameismaintainedincolumnValue1andawildcard*ismaintainedforthe functionmodulenameincolumnValue2,thenthedialogperformancefortheselected programwillbemonitoredforallfunctionmoduleswiththespecifiedcollectorperiod. IftheprogramnameismaintainedincolumnValue1andthecolumnValue2isleftblank,all statisticswillbeevaluatedwheretheprogramnamedoesmatchthecustomizedvalueandthe fieldforthefunctionmodulenameisblank.Allfunctionmoduleswhicharenotblankarenot evaluated. TheentriesmadeincolumnValue1andValue2shouldbewrittenincapitalletters.Otherwise,it mighthappenthatthecorrespondingMonitoringObjectcannotbefound. Afterdefiningthemonitoringcustomizing,youhavetogenerateandactivatethemonitoring.Assoon astheprogramsand/orfunctionsthataremeasuredhavebeenexecutedandthedatacollectorhas run,youshouldseealertsifthethresholdvalueshavebeenmet. FordetailsonBPMon,referto http://service.sap.com/bpmornavigatedirectlytothesetupguide http://service.sap.com/~sapidb/011000358700006137522006E.

8.5 Automated RFC Connection Monitoring


WithintheBusinessProcessMonitoringfunctionalityoftheSAPSolutionManager,anautomated RFCconnectiontestispossible.Thisway,anautomatedmonitoringforanyincidentsregardingthe systemconnectionandavailabilitycanbeestablished. Inordertosetupthisfunctionality,youhavetologontotheSAPSolutionManagersystemand navigatetotransaction/nDSWPandtheretoOperationsSetup>SolutionMonitoring>Business ProcessMonitoringandclickonSetupBusinessProcessMonitoring. a. Withinthesocalledsetupsessionyouhavetoselectabusinessprocessandabusinessprocess steponasystemforwhichyouwanttosetuptheRFCconnectionmonitoringfirst.

Figur e83 AutomatedRFCConnectionMonitor ingwithinBusinessPr ocessMonitor ing1 b. SelecttheApplicationMonitorentryandnavigatetothenextlevelontheleftnavigationmenu. 2008SAPAG 96

BestPractice:RFCMonitoring

Figur e84 AutomatedRFCConnectionMonitor ingwithinBusinessPr ocessMonitor ing2 c. ClickonLoadApp.MonitorsfromSIDtoretrievealistofmonitoringobjectsavailableonthe connectedsatellitesystemthatarepartoftheinstalledSTA/PIversion. d. ChoosetheF4HelpincolumnApplicationMonitorandtheentryBORFCCONfromthenextpop upscreen.

Figur e85 AutomatedRFCConnectionMonitor ingwithinBusinessPr ocessMonitor ing3 e. OntabKeyFiguresselectthekeyfigureAvailabilityofRFCconnectionandchoosethescheduling modeforthedatacollectoronthetabDetailInformation,followingthesetupproceduredescription onthetopofthescreen.

Figur e86 AutomatedRFCConnectionMonitor ingwithinBusinessPr ocessMonitor ing4 f. Onthenextlevel,youhavetoselecttheRFCdestinationthatneedstobemonitoredusingtheF4 helpofthecolumnRFCDestination.ChooseaMax.waittime[s],whichisthetimeforwhichthe connectiontestshouldbeperformeduntilanalert(definedincolumnYELLOWorRED?)would beraised.

2008SAPAG

97

BestPractice:RFCMonitoring

Figur e87 AutomatedRFCConnectionMonitor ingwithinBusinessPr ocessMonitor ing5 Aftergeneratingandactivatingthemonitoringcustomizing,theRFCconnectionmonitoringis scheduled.FordetailsonBPMon,referto http://service.sap.com/bpmornavigatedirectlytothe setupguidehttp://service.sap.com/~sapidb/011000358700006137532006E.

2008SAPAG

98

BestPractice:RFCMonitoring

9 Generic Part
IntheGenericPartofthisRFCMonitoringBestPractice,youwillfindinformationaboutcommon monitoringactivitiesthatarenotspecifictospecialbusinessprocesssteps.Thefollowingtopicsare covered: PerformanceMonitoring GeneralMonitoringGuidelinesforaSAPSystem Thesesectionsarereferencedinthecorrespondingbusinessprocessstepsofthescenariospecific partsabove.

9.1 Performance Monitoring


Inthissection,youwillfindthedescriptionofageneralprocedureforperformancemonitoringofyour SAPsystem.Thedifferenttransactionsthatarementionedintheprocedurearedescribedindetail below.Keepinmindthatthisisgeneralinformation. YoushouldalsoconsiderthetrainingBC315WorkloadAnalysis.Thiscoursecoverstopicslike workloadmonitor,statisticalrecords,expensiveSQLstatements,memorymanagement,database monitorandbufferanalysisamongothers.

9.2 General information


AspartofthedailymonitoringactivitiesofyourSAPsystem,youshouldnotonlywatchsystem availability,systemresourceconsumptionandmiddlewarequeues(amongothers),butalsothe performanceofyourSAPsystem.Thereareseveraltransactionsavailablewithwhichyoucanmonitor theaverageperformanceofthesystemandanalyzethecauseofbadperformance.Badperformance ofasystemisgenerallyequaltoextremelyhighresponsetimes.Thismayberelatedtolonglasting transactionssteps(dialogsteps),backgroundjobsrunningtoolong,andsoon. Theresponsetimeofatransactionstepisthedifferenceintimebetweenthepointwhentherequest arrivesintheSAPSystemandthepointwhentheSAPSystemcompletestheprocessing.Inaddition tothismeasurementoftime,otherdifferenttimessuchas,waitingtimesordatabasetimes,arestill measuredinSAP.Ifyousubtractthesecomponentsfromtheresponsetime,thisleavesthe processingtime,whichcannotbedirectlymeasured.ABAPprogrammingcodeisprocessedduring theprocessingtime. DefinitionsofthemostimportantcomponentsoftheResponsetime: Timeinworkprocess Time actually spentinthe workprocess (afterthe dispatcher hasfound a freeworkprocess) Waittime CPUtime DBtime Load/Generatingtime Rollintime Enqueuetime Processingtime Thedispatcheriswaitingforafreeworkprocess(=dispatcherqueue). Itisonlygivenasasumpertransactionstepintheworkloadstatistics Timefor accessing and waitingfor the database interface, and therefore fortheunderlyingdatabase Timeforloading/generatingscreens,ABAPprograms,andCUAelements (notforpresentation). Timeforrollingintherollareacontextofadialogstep Time forsettingalogicalSAPenqueue Thistimeiscalculatedasfollows: Processingtime=Responsetime WaittimeLoad/GeneratingtimeDB timeRollintimeEnqueuetime

Important: TheCPUtimeshouldnotbeaddedtotheabovelines,asitisatotal,consistingofpartsofthetimes listedabovethatcannotbecalculated.CPUtimeisreturnedbytheoperatingsystem.Theaccuracyof thereportedvaluedependsonthetimeroftheoperatingsystem(underUNIX,forexample,thetimer 2008SAPAG 99

BestPractice:RFCMonitoring workswith100HzsothattheCPUtimeisreportedasamultipleof10ms).Duetothisrough resolutionoftheCPUtime,itispossiblethataslightlylongerCPUtimeisdisplayedforadialogstep thanfortheresponsetime. TheRollOuttimeisnotpartoftheresponsetime,asitonlyoccursafterthedataistransferredtothe presentationserver. TheRollwaittimeisatimeinwhichaworkprocessiswaitingfortheresponseofanRFC.TheRoll waittimeisprocessedonaclient,whereastheusercontextisintherollarea.Therefore,neither resourceisusedupnordoesthebottleneckoccurhereforhighRollwaittime.HighRollwaittimes occurfrequently.ThismaybecausedbycallsofWindowsorotherexternalapplicationsfromwithin theR/3System.TheapplicationoftheRFCisstartedhere.Theusercontextenterstherollareasand rollwaittimeisprocesseduntiltheapplicationisexited,thatis,theRFCconnectioniscancelled. The transactionstepisonlyexitedatthispoint.TheyalsooccurwhentheR/3Systemcommunicateswith thefrontendcontrols.Whilethedataonthefrontendarebeingprocessed,theR/3contextisrolledout, thusreleasingtheworkprocess.Thiscanoccurseveraltimesduringatransactionstep.Iffrontend OfficeapplicationssuchasMicrosoftWordarestartedandclosedonlyafteralongtime(several minutes),averylongRollwaittimeoccursherealso.Rollwaitisnotpartoftheresponsetimefor transactionstepsoftasktypeRFC.Thereasonforthisisthatnoresourceuseoccursforthe applicationserver.

9.2.1 Procedure
Thefollowingtablegivesyouanoverviewofwhichtransactionyoucanuseforwhatpurposefor performancemonitoringandafirstanalysisofperformanceproblems. Transaction Workload monitor Workload/ statistical records Trans.Code ST03N Usefor Generalperformanceoverviewfor thedifferenttasktypesand analysisofsystemworkload Detailedperformancemonitoringof ashorttimeframe,asingleuseror aspecifictransactionorprogram SQLtraceofaspecificstep,short sequenceofstepsorpartofalong runningjob Gettinganoverviewoftheduration andperformanceofthesource code,fromindividualstatements uptocompletetransactions Getanoverviewonthetime distribution(DB,CPU,which FunctionModuleorSQLstatement etc.) Usewhen? Daily(e.g.3times)andupon performanceproblems Uponperformanceproblems

STAD

Performance ST05 trace ABAP runtime analysis Single Transaction Analysis

Uponperformanceproblems withhighDBtimes Uponperformanceproblems withhighCPUtimes

SE30

ST12

Uponperformanceproblems withhighDBorCPUtimes

Keyperformanceindicators
Performancemonitoringismostusefulifyouhavepreviouslydefinedkeyperformanceindicators. Generallyspeaking,KeyPerformanceIndicatorsarequantifiablemeasurements,agreedto beforehand,thatreflectthecriticalsuccessfactorsofanorganization.Inthiscase,werefertothe systemresponsetimeforsingledialogstepsofyourcorebusinessprocess(es),fortransactionsor backgroundjobs.Thekeyperformanceindicatorsshouldbeagreedonbythebusinessdepartments andthesystemsadministrators(happymediumbetweenisneededforbusinessreasonsandwhatis achievablefromsystemside).ItisalsoimportanttousetherightgranularityforKPIs.Thereisno needtodefineaKPIfortheresponsetimeofeachandeverystepintheprocess,butitimportantthat theyarenotdefinedtoogenerally(forexample,lessthan2secforeachdialogstep)asthismightbe tootightortoowideforspecificneeds.Furthermore,performancemonitoringshouldnotonlyrefer generallytoatasktype,butshouldrathergooneortwostepsfurthertosingletransactionsoreven steps. Forexample:CompanyABCisusingthecallcenterscenarioforinboundcallingandalsousingthe marketingscenariotocreatetargetgroupsviainfosetorBWqueries.Asthecallcenteragentsneed verygoodresponsetimesforbusinesspartnersearches,inordertoansweracallandthequeriesfor largetargetgroupsmaytakeseveralseconds,itisnotrecommendedthatcompanyABCjustmonitors theaverageresponsetimefordialogtransactions.Theyshouldinsteaddothemonitoringon transactionorevenondialogsteplevel. 2008SAPAG 100

BestPractice:RFCMonitoring

Dailymonitoringofsystemperformanceandthecomplianceoftheresponsetimestotheestablished KPIsshouldbedoneusingtheworkloadmonitor(transactionST03N).Thismonitorprovidesan overviewoftheresponsetimesandtheircomponents(CPUtime,DBtime,Waittime,andsoon).In caseofperformanceproblems,youshouldusethisandothertransactionsforadeeperanalysis: Ifasingleuserreportsproblems,usetransactionSTADtofindwhatpartoftheresponsetime isparticularlyhighinhiscase.Compareitwithotheruserstoseeifitisanisolatedproblem. Continuetheanalysisdependingontheresult. Ifasingledialogstep(onestepwithinatransaction)hasabadperformance,usetransaction STADtofindwhatpartoftheresponsetimeisparticularlyhighinthiscase.Continuethe analysisdependingontheresult. Ifyouhaveageneralperformanceproblem,usethesystemmonitorstocheckresource consumption.AlsousethetimeprofileoftransactionST03Ntocheckifperformancehasbeen decreasingovertimeoriftherearepeaks.Usetheuserprofileforacomparisonamong differentusersandusergroups,ifyoufollowausefulnamingconvention. Getaperformancetrace(transactionST05)ifyoufindthattheperformanceproblemsare relatedtohighDBtimes.GetanABAPruntimeanalysis(transactionSE30)ifyoufindthatthe performanceisrelatedtohighCPUorhighprocessingtimes. Ifyoucannotfindthecauseoftheperformanceproblemorneedfurtherassistanceforthe analysis,contactthenextsupportleveloropenanOSSmessageoncomponentXXSER TCC.

9.2.2 TransactionST03N
TransactionST03Nisaverypowerfultransactionwithseveralfuntions.Therefore,wecanonly mentionafewhere,concentratingonwhatcanbeimportantforperformancemonitoring.The workloadmonitorisusedtoanalyzestatisticaldatafromtheSAPkernel.Whenanalyzingthe performanceofasystem,youshouldnormallystartbyanalyzingtheworkloadoverview.Forexample, youcandisplaythetotalsforallinstancesandthencomparetheperformancesofindividualinstances overspecificperiodsoftime.Youcanquicklydeterminethesourceofpossibleperformanceproblems usingthelargenumberofanalysisviewsandthedetermineddata. Youcanusetheworkloadmonitortodisplaythe: NumberofconfiguredinstancesforeachSAPR/3System Numberofusersworkingonthedifferentinstances Distributionofresponsetimes Distributionofworkloadbytransactionsteps,transactions,packages,subapplications,and applications Transactionswiththehighestresponsetimeanddatabasetime Memoryusageforeachtransactionoreachuserperdialogstep WorkloadthroughRFC,listedbytransactions,functionmodulesanddestinations Numberandvolumeofspoolrequests Statisticsaboutresponsetimedistribution,withorwithouttheGUItime Workloadandtransactionsusedlistedbyusers,payrollnumber,andclient Workloadgeneratedbyrequestsfromexternalsystems Forallofthisdatayoucandisplaythedataforaparticularinstance(notonlytheonetowhichyouare loggedon)oroptionallytotaledforallinstances.Dependingonyourusermode,youcanchoosethe timeperiodforwhichyouwanttodisplaythedatabetweenday,weekandmonth(ordeterminethe lengthoftimeyourselfusingtheLastMinutesLoadfunction).Formostanalysisviews,youcan displayalloronlycertaintasktypes. Theworkloadmonitorhasaninterfacethatisdividedintotwoparts.Usethetreestructuresontheleft ofthescreentomakethefollowingsettings: Selecttheusermode Selectthetimeperiodforwhichyouwanttodisplaytheworkload Selectvariousfunctionsandanalysisviews(whichdatayouwanttodisplay). ThesystemthendisplaystheresultontherightofthescreeninastandardizedALVGridControl. Forgeneralperformancemonitoring,youcanusethefollowingoptions: Usermodechooseexpertmode 2008SAPAG 101

BestPractice:RFCMonitoring Workloadchoosetheinstanceandtimeframeyouareinterestedin.Selectionbetweenthe lastdays,thelastweeksandthelastmonthsispossible.Ifyouareinterestedinaparticular timewithinthelast24hours,chooseDetailedAnalysis,thanLastMinutesLoadandthanthe requiredtimeframeontheappropriateinstance. Inthefirstworkloadoverviewyouget,youfindtheresponsetimesanditscomponentsforthe differenttasktypes(Background,Dialog,HTTP,RFC,Update,etc).Youcannowgoto AnalysisViewsTransactionProfilesStandard.Hereyoucangetamoredetailedview, selectingforinstancethetasktypedialogandtheaggregationpertransaction.

ThefollowingscreenshotshowstransactionST03Nusingtheoptions:Expertmode,workloadfor serverus0306_Q4C_02,timeframefrom03.01.200509.01.2005,standardtransactionprofile, showingdialogtransactionssortedbyaverageresponsetime.

Figure88TransactionST03N

9.2.3 TransactionSTAD
IntheSTADrecordseverysteponSAPApplicationServerisrecorded.Therecordsforallinstancesof aSAPsystemaredisplayed.TheBusinessTransactionsAnalysis(transactionSTAD)calculatesthe systemresourceusageofindividualtransactionsforSAPR/3Systemsandprovidesadetailed analysisofatransactionandthedialogsteps.Theselectioncriteriaincludeuser,transaction,program, tasktype,startdate,andstarttime. TheanalyzedtimeperiodcanbelargerthantheintervaldefinedbyReadTime,asthesystem analyzescompletetransactionsasfaraspossible.However,itisnotalwayspossibletoperforma completeanalysisforlongrunningtransactions.Asthebusinesstransactionanalysisistime consuming,youshoulduseasshortanintervalaspossible(around10minutes). Theaimofthismonitoristoanalyzeindetailhowlongtheresponsetimesforparticular stepsina process(ortransaction)andaretheseresponsetimesdistributedamongtheircomponents(DBtime, CPUtime,Waittime,GUItime,etc)havebeen.

2008SAPAG

102

BestPractice:RFCMonitoring Ifyouwanttousethistransactiontoanalyzetheperformanceofthestepsdonebyaparticularuser proceedasfollows: Tellhimtoexecutetherelevantstepsonce,slowlyoneaftertheotherandwritedownthe exacttimeatwhichheexecutedthem. GotoSTADanddisplaythestatisticalrecordsrelatedtothissingleexecution(usetheuser nameandtheappropriatetimeframetodisplaythecorrectrecords). Formattheoutputlist(buttonSel.Fields),includingthefieldsGUItime,CUAreference programandCUAinternalcommand.Thetwolatterfieldscanhelpyoutoidentifythesingle stepsexecuted. Usethetimestampsofthestatisticalrecordsandtheexecutiontimesyouwrotedownto assignSTADrecordstothedialogstepsthatwereperformed. Checkwhichstepsareactuallyhavingabadresponsetimeandwhatpartiscontributingmost toit(DB,CPU,GUI,). Dependingontheresult,proceedwithadeeperanalysisoftheworststepsusing,for example,transactionST05(forlongDBtimes),transactionSE30(forlongCPUtimes)ora networkanalysis(notdescribedinthisdocument)incaseofhighGUItimes. Dependingonwhatyouareanalyzing,itmightbewisetolettheuserexecuteallstepstwice andusethesecondexecutionfortheanalysis.Thiswayyoumakesurethatallbuffers(for, example,programbuffers)arefilled.

Youcanalsousethistransactiontoseeindetailwhatwasgoingoninthesystemduringspecific hourswithbadperformance.Withthisanalysis,youcanseeiftherewhereafewusershaving particularlyhighresponsetimesoriftherewasageneralperformanceproblem. Procedure: GototransactionST03Nandsearchforthehourwiththeworstperformanceorthehighestworkload usingthetimeprofile CalltransactionSTADwiththefollowingselectioncriteria: Showallstatisticrecords,sortedbystarttimeChecked StartdateTodaysdate Readtime1hour Starttimestarttimeofhighworkload(fromST03N) User* Resp.time>=5000ms

TasktypeD(dialog)orB(batch)orR(RFC)or*(all) Beawarethatthisquerymaytakeseveralminutes. ThefollowingscreenshotsshowtheinitialscreenofSTADwiththeoptions:Showallstatisticrecords, sortedbystarttime,readingoftherecordsfor10minutesstartingfrom16:50hours,forallusers(*) thatexecuteddialogtransactionslastinglongerthan1000ms.

2008SAPAG

103

BestPractice:RFCMonitoring

Figure89TransactionSTAD Therearetwoscreenshotsbelowshowingtheresultofthisquery.Foreachtimestamp,youseewhat programwasexecutedwithinwhichtransactiononwhichserver.Foreachtheuser,responsetime, timeinworkprocess,CPUtime,DBtime,GUItime,CUAref.ProgramandCUAinternalcommandare displayed.Thesecolumnsarenotallpartofthefirststandardoutput.Theywereadjustedusingthe Selectoutputfieldsbutton(F9).

2008SAPAG

104

BestPractice:RFCMonitoring

Tomakethefollowingstepseasier,youmaywanttodownloadthelistwithspreadsheetformat.Make sureyouhavedisplayedallcolumnsyouneedbeforedownloading.Youalsoneedtobeawarethat theSTADrecordsareonlykeptinthesystemforalimitedperiod(normally24or48hours). Gothroughthelistoflonglastingdialogstepsandsearchforthosedialogstepsthatarelastinglong onaverage(thoseappearingseveraltimes).Youmayidentifywhichstepsbelongtogetherby comparingthetransaction,theprogram,theCUAreferenceprogramandtheCUAinternalcommand. Thecommandscanbedifferentinyoursystemdependingoncustomizingsettings,userexits, particularsystemusage,andsoon. Executethetypicalstepsofyourcorebusinessprocessesonce.Executethestepsslowly, oneaftertheotherandwritedowntheexacttimeatwhichyouexecutedthem.Thesteps shouldbeperformedbyakeyuser. GotoSTADanddisplaythestatisticalrecordsrelatedtothissingleexecution(usetheuser nameandtheappropriatetimeframetodisplaythecorrectrecords). Formattheoutputlist(buttonSel.Fields),includingthefieldsGUItime,CUAreference programandCUAinternalcommand. Usethetimestampsofthestatisticalrecordsandtheexecutiontimesyouwrotedownto assigntheCUAinternalcommandsortheCUAreferenceprogramtothedialogstepsthat wereperformed.

Usethisinformationtoidentifywhichdialogstepshaveextremelyhighresponsetimesduring yourpeakloadtime. Usethisinformationtoanalyseindetailwhatisharmingtheperformanceofthecorresponding transactionordialogstep. Alsousetheinformationonthedistributionoftheresponsetime(DBtime, CPUtime,GUItime)giveninthelist,toidentifythecauseoftheproblem.Dependingontheresult, proceedwithadeeperanalysisoftheworststepsusing,forexample,transactionST05(forlongDB times),transactionSE30(forlongCPUtimes)oranetworkanalysis(notdescribedinthisdocument) incaseofhighGUItimes. Additionally,searchforthosetakingparticularlylong(forexample,morethan10seconds).Contactthe responsibleusertofindoutwhathewasdoingatthattime,ifthedidsomeunusualstepsorifhe noticedabadresponsetime.Ifyoucannotidentifythecause,youmayusetheproceduredescribed fortransactionST05foradeeperanalysis.

FordetailsonthePerformancemonitoringonFunctionCodelevelandthemonitoringsetup procedures,usethefollowinglink http://service.sap.com/~sapidb/011000358700003081072005Eandnavigatetosection2.1.

2008SAPAG

105

BestPractice:RFCMonitoring

9.2.4 TransactionST05
Theperformancetracetoolcontainsarangeoftracefunctionsthatyoucanusetomonitorand analyzetheperformanceofthesystemindatabaseaccesses,locking,andremotecallsofreportsand transactions.Itallowsyoutorecorddatabaseaccess,lockingactivities,andremotecallsofreports andtransactionsinatracefileandtodisplaytheperformancelogasalist.Italsoprovidesextensive supportforanalyzingindividualtracerecords. Tousetheperformancetrace,youneedtheauthorizationtostarttransactionST05andthesystem authorizationsChangetraceswitches(authorizationSTOMforauthorizationobjectS_ADMI_FCD) andAnalyzetraces(authorizationSTOR,alsoforauthorizationobjectS_ADMI_FCD). Theperformancetracecontainsthefollowingtracingoptions: SQLTrace:Thisallowsyoutomonitorthedatabaseaccessofreportsandtransactions. EnqueueTrace:Thisallowsyoutomonitorthelockingsystem. RFCTrace:ThisprovidesinformationaboutRemoteFunctionCalls(RFCs)between instances. TheaimoftheproceduredescribedbelowistofindtheSQLstatementsthatarecausinghigh responsetimesintheSAPsystem.Ifyouidentifiedatransactionoraprocessstepthatistakingto long,youmayusetransactionST05,tofindoutifoneormoreSQLstatementsarecausingthe performanceproblem. Procedure: CalltransactionST05andmakesureyouareonthesameinstanceastheuseryouwanttotrace: ChecktheoptionSQLtrace(alsoEnqueueandRFCtraceifneeded) Activatethetracewithfilter Entertheusernameoftheuserthatwillperformthesteps Confirm Asktheusertoperformtherelevantsteps(andnothingelse) Deactivatethetrace Displaythetrace.Makesuretheusernameiscorrect.Writedownthedisplayedtimestamps (traceperiod)tobeabletofindthesametraceinthesystemlateron.Usetheextendedtrace listtodisplaythetimestampsforeachSQLstatement. Dependingonwhatyouareanalyzing,itmightbewisetolettheuserexecuteallstepstwice andusethesecondexecutionfortheanalysis.Thiswayyoumakesurethatallbuffers(e.g. programbuffers)arefilled.

Gotroughthetraceandsearchforthestatementswithahighduration(markedred).Usetheexplain functiontoseeifthecorrectindexisbeingusedforthatstatement. Ifyoucannotfindthecauseoftheperformanceproblemorneedfurtherassistancefortheanalysis, contactthenextsupportleveloropenanSAPmessageoncomponentSVBO.Attachthetracea detaileddescriptionoftheperformedstepsandtherelatedSTADrecordstothemessage.

9.2.5 TransactionSE30
Theruntimeanalysistoolallowsyoutoexaminetheperformanceofany ABAPprograms,suchas reports,subroutines,functionmodulesorclasses.Itsavesitsresultsinperformancedatafiles,which youcandisplayaslists.Youcanusetheseresultstoidentifyruntimeintensivestatements,tocombine tableaccesses,andshowthehierarchyofprogramcalls.Fromtheresultsoftheruntimeanalysis,you canidentify: Excessiveorunnecessaryuseofmodularizationunits CPUintensiveprogramfunctions UserspecificfunctionsthatcouldbereplacedwithABAPstatements Inefficientorredundantdatabaseaccess.

2008SAPAG

106

BestPractice:RFCMonitoring Dependingonthesizeoftheprogram,considerablevolumesofdatacanbegeneratedduringthe runtimeanalysis.Forthisreason,thistoolisdefaultedtoFullaggregation.Thismeansthatonlythe standardhitlistisgeneratedwithallcalls.ThestandardhitlistdoesnotincludeGrouphitlist,Hitlistof databasetables,Classhitlist,Instancehitlist,Methodhitlist,Eventhitlist,Hitlistofinternaltables, CallhierarchyandStatistics.Tocancelthisrestriction,switchoffaggregationbyreplacingthe standardvariantintheinitialscreenwithatemporaryvariant,forexample.Inthisvariant,youcanthen configurethemeasurementrestrictionsaccordingtotheselectedobjectstobemeasured. Theruntimeanalysisconsistsoftwoparts: Recordingperformancedata Analyzingtheperformancedata

Inthefirstpart,thesystemmeasuresthetransaction,program,orprocedure,andwritestheresulttoa performancedatafile.Youcanrestrictthemeasurementtocertainobjects.Youcanalsomeasureup totenexternalprocesses.Inthesecondpart,theperformancedataisanalyzed,andthesystem displaystheresultsinlistform.Formoreinformationonthistransactionanditsuse,seethe applicationhelp. TheruntimeanalysistoolmeasurestheCPUtimerequiredbythemeasurablecomponentsofa transaction,aprogram,oraprocedure.Theinformationisstoredinaperformancedatafile,whichyou cananalyzeeitherimmediatelyoratalaterdate.TheCPUtimerequiredtomeasuretheruntimeis subtractedfromthetotalCPUusage.Ifyoumeasuretheruntimeofaprogrammorethanonce,you areunlikelytogetthesameresultoneachoccasion.Therearevariousreasonswhyitisdifficultto obtainidenticalruntimes.Forexample,inthefirstmeasurement,thesystemmightreaddatarecords fromthetablebufferontheapplicationserver,butinasecondrun,itmayhavetoreadthemdirectly fromthedatabase.Runtimesalsodependontheoverallsystemornetworkload(forexample,the numberofjobsorsystemscurrentlyactiveinyourSAPSystem). Incaseyoucannotfindthecauseoftheperformanceproblemorneedfurtherassistanceforthe analysis,contactthenextsupportleveloropenanSAPmessageoncomponentSVBO.Attachthe runtimeanalyses,adetaileddescriptionoftheperformedstepsandtherelatedSTADrecordstothe message. FormoreinformationonautomatedperformancemonitoringviaCCMSandSAPSolution Manager,alsoreadthechapter2.1ofthedocumentApplicationMonitoringwithSAPSolution Manager.

9.2.6 TransactionST12
TheSingleTransactionAnalysistoolallowsyoutoexaminetheperformanceoftransactionor ABAP programs,suchasreports,subroutines,functionmodulesorclassesaswellonthecodingsidetracing the ABAP codeasonthedatabaseside(SQLtrace/performancetrace).Itsavesitsresultsin performancedatafiles,whichyoucandisplayaslists. Youcanusetheseresultstoidentifyruntimeintensivestatements,tocombinetableaccesses,and showthehierarchyofprogramcalls.Fromtheresultsoftheruntimeanalysis,youcanidentify: Excessiveorunnecessaryuseofmodularizationunits CPUintensiveprogramfunctions UserspecificfunctionsthatcouldbereplacedwithABAPstatements Inefficientorredundantdatabaseaccess.

ST12allowsyoutoaggregatetheABAPtracedatapermodularizationunit(subroutine,loop,function call)andoffersthepossibilitytoanalyzetheABAPtraceindifferentwayswithagraphicalaidto identifythecalltreestructuremoreeasilyfromdifferentperspectives.Theperformancetraceandthe ABAPtrace,ifdonefromwithinoneST12traceexecution,arekeptinonenamedversionandcanbe analyzedtogether. ST12comeswiththesupporttoolsaddonSTA/PIseenote69455fordetails.

2008SAPAG

107

BestPractice:RFCMonitoring NotethattheST12ABAPtracetransactionisnotofficiallydocumentedandisonlyreleasedforuseby SAPorcertifiedServiceconsultantsduringSAPServiceSessions(forexampleSAPGoingLiveCheck orSolutionManagementOptimizationServices).ST12isonlyavailableintwolanguages(EN/DE). STA/PIissmallanddoesnotinterferewithproductivecoding.Itcanbeimplementedanytimeand thereisnonecessitytologoffusers. FordetailsabouttheuseoftransactionST12seenote755977. Dependingonthesizeoftheprogram,considerablevolumesofdatacanbegeneratedduringthe runtimeanalysis.Forthisreason,thistoolisdefaultedtoaggregationpercallingposition.This reducesthevolumeofrecordsforalooptothenumberoccurrencesinthecodingofaloopinstead ofseparaterecordsforeachloopcycle.Note755977givesyoumoredetails. Theruntimeanalysisconsistsoftwoparts: Recordingperformancedata Analyzingtheperformancedata

Inthefirstpart,thesystemmeasuresthetransaction,program,orprocedure,andwritestheresulttoa performancedatafile.Youcanrestrictthemeasurementtocertainobjects.Youcanalsomeasureup totenexternalprocesses. Inthesecondpart,theperformancedataisanalyzed,andthesystem displaystheresultsinlistform.Formoreinformationonthistransactionanditsuse,seethe applicationhelp. TheruntimeanalysistoolmeasurestheCPUtimerequiredbythemeasurablecomponentsofa transaction,aprogram,oraprocedure.Theinformationisstoredinaperformancedatafile,whichyou cananalyzeeitherimmediatelyoratalaterdate.TheCPUtimerequiredtomeasuretheruntimeis subtractedfromthetotalCPUusage.Ifyoumeasuretheruntimeofaprogrammorethanonce,you areunlikelytogetthesameresultoneachoccasion.Therearevariousreasonswhyitisdifficultto obtainidenticalruntimes.Forexample,inthefirstmeasurement,thesystemmightreaddatarecords fromthetablebufferontheapplicationserver,butinasecondrun,itmayhavetoreadthemdirectly fromthedatabase.Runtimesalsodependontheoverallsystemornetworkload(forexample,the numberofjobsorsystemscurrentlyactiveinyourSAPSystem). Ifyoucannotfindthecauseoftheperformanceproblemorneedfurtherassistancefortheanalysis, contactthenextsupportleveloropenanSAPmessageoncomponentSVBO.Attachtheruntime analyses,adetaileddescriptionoftheperformedstepsandtherelatedSTADrecordstothemessage. FormoreinformationonautomatedperformancemonitoringviaCCMSandSAPSolution Manager,alsoreadthechapter2.1ofthedocumentApplicationMonitoringwithSAPSolution Manager.

9.3 General Monitoring Guidelines for a SAP System


FortheadministrationofanSAPR/3system,thereareanumberofmonitoringactivitieswestrongly recommendschedulingandsupervisingonaregularbasis.Thefollowinglistisnotcomplete, especiallyjobsandtasksforthedatabaseadministration(suchasbackups,archivingtransactionlogs, updatestatisticsforcostbaseoptimizerandsoon)arenotmentioned,howeveritgivesyouan impressionofwhatyouhavetodoinordertokeepasystemrunning.Ifyouhavefurtherquestionson thesesubjects,pleaserefertotheSolutionManagementOptimizationServiceSystem Administration. ThetablebelowliststransactionsusedforGeneralSystemChecks:

2008SAPAG

108

BestPractice:RFCMonitoring

Monitoring Monitor Monitor Monitor Indicatoror MonitoringActivityor Object TA/Tool Freq. Time Error ErrorHandlingProcedure R/3System ST03N workload analysis daily tbd Average dialog response time <1000ms

Responsibility

Reviewresponsetimesin Software comparisontosystemloadand monitoringteam performanceinfluencingchanges withinthesystemoftheanalyzed period. Identifyandimproveperfor manceofanytransactionwhose responsetimeexceedsthetimes definedintheServiceLevel Agreement(SLA),ifexisting. MonitorRFCresponsetime statisticsandDialogresponse timesforonlinetransactions.

Database perform ance Analysis

ST04

Weekly tbd andin caseof perform ance problem s Hourly tbd (depend ingon the busines s process )andin caseof perform ance problem s Weekly tbd andin caseof perform ance problem s

Increased database response time/ Expensive SQL statements Highpaging rateand CPU utilization

Monitordatabasestatistics. Software Monitorthebuffercachehitratio monitoringteam Checkformissingindices ensurethatthedataqualityis sufficient,andthatthereis sufficientspaceavailable. MonitortheCPUandmemory Software consumption. monitoringteam Ahardwarebottleneckcanhave anegativeimpactontheoverall responsetimeaswellasthe responsetimeofanindividual businesstransaction. Especiallymonitorhardwareload duringhighRFCtransmission times.

Operating system monitor

ST06

R/3System ST02 buffer monitor

Swaps

Monitormemoryresourceusage Software monitoringteam forspecificR/3application servers Toensureoptimalperformance checkthattheR/3parameters aresetcorrectlywithtransaction ST02. IncorrectlysizedR/3buffersor memoryallocationcanresultin poorperformance.Onesuch examplewouldbewhenawork processenterPRIVmode.

Localwork process overview

SM50

hourly tbd during peak hours andin caseof perform ance problem sor error messag es hourly during tbd

WPstatus, WP utilization

Monitorcurrentstateofindividual Software workprocesses. monitoringteam Ensurethatenoughwork processcapacityisavailableat peaktimes.

System widework

SM66

WPstatus, SimilartoSM50butforsystem longrunning widestatistics.

Software monitoringteam

2008SAPAG

109

BestPractice:RFCMonitoring
Monitoring Monitor Monitor Monitor Indicatoror MonitoringActivityor Object TA/Tool Freq. Time Error ErrorHandlingProcedure jobs process peak overview hours Database perform ance monitor DB02 Daily tbd andin caseof perform ance problem s Tablespace sizes,table indicesfor tRFCand aRFC Responsibility

Ensurethatthedataqualityis Software monitoringteam sufficient,thatthereareno missingindexes,andthatthereis sufficientspaceavailable. Ingeneraliftablesizesarelarger than500MB,reorganizethetable anddecreaseitssize. SeeSAPNote375566. Monitorthegrowingoftablesand indices,especiallyontRFCand qRFCtables(ARFCSSTATE ARFCSDATA ARFCRSTATE) Checkshortdumps,analyze Software abortedprograms. monitoringteam Selectaperiodandclickonthe Listbutton.Selectanerror,and thenchooseDisplaytoseethe shortdump. ForSAPdevelopedprograms thatexperiencefrequent terminations,investigateSAPNet forapossibleresolutionandif necessaryopenacustomer message.Forcustomer developedprogramscontactthe appropriatememberofthe developmentteam. Checkforgeneralsystem programerrorsandtablespace errorsortransactionsthat encountererrors. Maintaindate/timeandselect Rereadsystemlog.Position cursoronatime,andthen chooseDisplay. Software monitoringteam

ABAPdump ST22 analysis

daily andin caseof an errors

tbd

Dumps

Systemlog

SM21

daily andin caseof an errors

tbd

Entries

Update tasks

SM13

daily andin caseof an errors

tbd

Status

Checkforentriesthathave Software statusERR. monitoringteam Updaterecordsshouldbe monitoredregularlyandthe appropriateusershouldbe contactedimmediatelytoresolve anyoutstandingupdates. Togetherwiththeuser, determinewhethertheupdate requestcanberestartedorhas tobedeleted. Determinetheperformanceof singlestatisticalrecords Software monitoringteam

Display Statistical Record

Transac Incase tbd tion ofbad STAD perform ance

Status

2008SAPAG

110

10 Further Information
Troubleshooting
IfexecutingthisBestPracticedidnotproducethedesiredresults, SearchforrelatednotesinSAPNet. OpenanSAPCustomerMessagedescribingyourproblem(pleaseseetherespectivecomponent insectionErrorHandling,RestartabilityandEscalationofeverystep).

Literature
FordetailedinformationonhowtoadministeranSAPR/3system,seethebook: LianeWill,SAPR/3SystemAdministration,2003 Forinformationonhowtomonitorandtunethegeneralsystemperformance,seethebook: ThomasSchneider,SAPPerformanceOptimizationGuide,2006.

BestPractice:RFCMonitoring Copyright2007SAPAG.Allrightsreserved.
Nopartofthispublicationmaybereproducedortransmittedinanyformorforanypurposewithouttheexpress permissionofSAPAG.Theinformationcontainedhereinmaybechangedwithoutpriornotice. SomesoftwareproductsmarketedbySAPAGanditsdistributorscontainproprietarysoftwarecomponentsof othersoftwarevendors. Microsoft,Windows,Excel,Outlook,andPowerPointareregisteredtrademarksofMicrosoftCorporation. IBM,DB2,DB2UniversalDatabase,OS/2,ParallelSysplex,MVS/ESA,AIX,S/390,AS/400,OS/390,OS/400, iSeries,pSeries,xSeries,zSeries,Systemi,Systemi5,Systemp,Systemp5,Systemx,Systemz,Systemz9, z/OS,AFP,IntelligentMiner,WebSphere,Netfinity,Tivoli,Informix,i5/OS,POWER,POWER5,POWER5+, OpenPowerandPowerPCaretrademarksorregisteredtrademarksofIBMCorporation. Adobe,theAdobelogo,Acrobat,PostScript,andReaderareeithertrademarksorregisteredtrademarksofAdobe SystemsIncorporatedintheUnitedStatesand/orothercountries. OracleisaregisteredtrademarkofOracleCorporation. UNIX,X/Open,OSF/1,andMotifareregisteredtrademarksoftheOpenGroup. Citrix,ICA,ProgramNeighborhood,MetaFrame,WinFrame,VideoFrame,andMultiWinaretrademarksor registeredtrademarksofCitrixSystems,Inc. HTML,XML,XHTMLandW3CaretrademarksorregisteredtrademarksofW3C,WorldWideWebConsortium, MassachusettsInstituteofTechnology. JavaisaregisteredtrademarkofSunMicrosystems,Inc. JavaScriptisaregisteredtrademarkofSunMicrosystems,Inc.,usedunderlicensefortechnologyinventedand implementedbyNetscape. MaxDBisatrademarkofMySQLAB,Sweden. SAP,R/3,mySAP,mySAP.com,xApps,xApp,SAPNetWeaver,andotherSAPproductsandservicesmentioned hereinaswellastheirrespectivelogosaretrademarksorregisteredtrademarksofSAPAGinGermanyandin severalothercountriesallovertheworld.Allotherproductandservicenamesmentionedarethetrademarksof theirrespectivecompanies.Datacontainedinthisdocumentservesinformationalpurposesonly.Nationalproduct specificationsmayvary.

TheinformationinthisdocumentisproprietarytoSAP.Nopartofthisdocumentmaybereproduced,copied,or transmittedinanyformorforanypurposewithouttheexpresspriorwrittenpermissionofSAPAG. Thisdocumentisapreliminaryversionandnotsubjecttoyourlicenseagreementoranyotheragreementwith SAP.Thisdocumentcontainsonlyintendedstrategies,developments,andfunctionalitiesoftheSAPproduct andisnotintendedtobebindinguponSAPtoanyparticularcourseofbusiness,productstrategy,and/or development.PleasenotethatthisdocumentissubjecttochangeandmaybechangedbySAPatanytime withoutnotice. SAPassumesnoresponsibilityforerrorsoromissionsinthisdocument.SAPdoesnotwarranttheaccuracyor completenessoftheinformation,text,graphics,links,orotheritemscontainedwithinthismaterial.Thisdocument isprovidedwithoutawarrantyofanykind,eitherexpressorimplied,includingbutnotlimitedtotheimplied warrantiesofmerchantability,fitnessforaparticularpurpose,ornoninfringement. SAPshallhavenoliabilityfordamagesofanykindincludingwithoutlimitationdirect,special,indirect,or consequentialdamagesthatmayresultfromtheuseofthesematerials.Thislimitationshallnotapplyincasesof intentorgrossnegligence. Thestatutoryliabilityforpersonalinjuryanddefectiveproductsisnotaffected.SAPhasnocontroloverthe informationthatyoumayaccessthroughtheuseofhotlinkscontainedinthesematerialsanddoesnotendorse youruseofthirdpartyWebpagesnorprovideanywarrantywhatsoeverrelatingtothirdpartyWebpages.

2008SAPAG

112