Accelerating SAP upgrades: Mastering Parallelism for Efficiency
Prashanth Raja
??Senior Technical Lead | SAP S4HANA & Basis Expert | Cloud Architect ?? | Database Management Pro ?? | Certified Scrum Master ?? | Innovator & Problem Solver ??
"Unlocking Efficiency: Simplifying parameters calculation in SAP SUM's INITSUBST phase"
What is Parallelism in SAP upgrades ?
1. ABAP PROCESSES
ABAP Processes influences all job-run phases, including long runtime ones like DBCLONE (in update scenarios), ACT_UPG and PARDIST in uptime, and XPRAs in downtime.
ATTENTION! the parameter rdisp/wp_no_btc (Number of work processes of type batch - background processing) holds back the number of parallel processes! Please ensure you have at least an equal number of background processes available, otherwise parallelism will not be obtained. You might also notice the following warning on the logs:
"2WETQ399 Cannot run 10 batch processes, system has only 1!"
2. SQL PROCESSES
3. R3TRANS PROCESSES
Where can we check the number of physical CPU?
Transaction ST06 --> "CPU " --> Number of CPUs
If the CPU is a multi-core one, SAP System will consider them as a physical, available CPU.
Example:
In this case, 16 is to be entered for both UPTIME and DOWNTIME R3TRANS Processes fields.
4. R3LOAD PROCESSES
Technical aspects of tp/R3trans parallelism in SUM
What is SYNCMARK?
For example: a?TP process starts new parallel R3trans jobs for every transport request in the buffer up to a SYNCMARK entry;?at this point, TP will wait until the last of the started R3trans jobs has finished before starting the next R3trans (for a transport request after the current SYNCMARK).
Example:
领英推荐
The value of parameter?mainimp_proc?sets the number of parallel tps, responsible for handling the packages.
The value of parameter parallel?sets the number of parallel R3trans, responsible for handling the objects inside each package
what if the size of the packages vary in each block?
The below example illustrate what happens (using the first block of packages from the example above, but) with a bigger package 1 (represented below by <TR1>) and smaller packages from 2 - 6:
(the horizontal green bar means the time to import each package)
On this case, SUM could have improved the import of this groups of packages by setting up 2 tp parallel process (mainimp_proc = 2) and using up to 3 parallel R3trans process (parallel = 3), speeding up the total import time of the block by a factor of 3.
IMPORTANT INFORMATION: The formula that SUM uses to calculate the parallel process is the following:
nrosprocs = 1 + mainimp_proc + (mainimp_proc * parallel)
where
nrosprocs --> number of total parallel process running on the OS level (tps + R3trans)
mainimp_proc --> number of tps running in parallel process on the OS level
parallel -->?number of R3trans running in parallel process on the OS level
As per the formula, there is always 1 tp process starting to process the buffer. It then starts the "mainimp_proc" processes (depending on each block of packages), which, by their turn, starts the "parallel" R3trans managed processes.
This also leads, in some cases, to a slightly different total number of parallel processes, as seen on the below example:
(example taken from the?TABIM_UPG phase, where "R3TRANS PROCESSES" was set to 8)?
>> ? START OF PHASE MAIN_NEWBAS/TABIM_UPG?Running /usr/sap/SAP/T95/exe/tp pf=/usr/sap/T95/SUM/abap/var/DEFAULT.TPP checkimpdp?T90??Importing for group 1/44: Setting stop mark at 'SAPK-701DRINSAPBASIS'.Running /usr/sap/SAP/T95/exe/tp pf=/usr/sap/T95/SUM/abap/var/TABIMUPG.TPP put T90 -Dmainimp_proc=1-Dparallel=8??Importing for group 2/44: Setting stop mark at 'SAPK-701DFINPIBASIS'.Running /usr/sap/SAP/T95/exe/tp pf=/usr/sap/T95/SUM/abap/var/TABIMUPG.TPP put?T90 -Dmainimp_proc=2-Dparallel=4??Importing for group 3/44: Setting stop mark at 'SAPKITLRD5'.Running /usr/sap/SAP/T95/exe/tp pf=/usr/sap/T95/SUM/abap/var/TABIMUPG.TPP put?T90 -Dmainimp_proc=3-Dparallel=3??Importing for group 4/44: Setting stop mark at 'SAPK-701DRINSAPBW'.Running /usr/sap/SAP/T95/exe/tp pf=/usr/sap/T95/SUM/abap/var/TABIMUPG.TPP put?T90 -Dmainimp_proc=1-Dparallel=8??Importing for group 5/44: Setting stop mark at 'SAPKE60028'.Running /usr/sap/SAP/T95/exe/tp pf=/usr/sap/T95/SUM/abap/var/TABIMUPG.TPP put?T90 -Dmainimp_proc=2-Dparallel=4??Importing for group 6/44: Setting stop mark at 'SAPK-603DFINEAAPPL'.Running /usr/sap/SAP/T95/exe/tp pf=/usr/sap/T95/SUM/abap/var/TABIMUPG.TPP put?T90 -Dmainimp_proc=1-Dparallel=8??Importing for group 7/44: Setting stop mark at 'SAPKGPFD07'.Running /usr/sap/SAP/T95/exe/tp pf=/usr/sap/T95/SUM/abap/var/TABIMUPG.TPP put?T90 -Dmainimp_proc=3-Dparallel=3c
?Note that, for some groups, there is 9 parallel processes (3 mainimp_proc x 3 parallel).?Such minor differences are expected as SUM is always looking for the most optimal combination.
How many R3trans process are forked during the import?
Looking in the correspondent import log files, it is possible to identify how many R3trans processes were forked during the import. For this,?search for the message for the?phrase?"child processes forked". If?the message is not found, no parallelism was done.
…/abap/log/SAPHB70105.CPT
1 ETP153 DICTIONARY IMPORT
4 ETW000 > parallel 3??<-- calculated dynamically
4 ETW000 3 child processes forked? <--number of R3trans child executed in parallel
…/abap/log/SAPKB70105.CPT
1 ETP187 R3TRANS SHADOW IMPORT
4 ETW000 > parallel 3????<-- no parallelism done?if there?is no message?“child processes forked”
?Tips & tricks:
In order to avoid the?error message?"===> HALT: creation of child process for parallel import failed. Please contact the SAP support." during the parallel import, make sure the UNIX system is set as unlimited and the parameter MAXUPROC (Maximum users processes)?is large enough, it is?normal?during the parallelism the user <SID>adm starts a very high number of?processes;
Engineer III at Amex ----Roles: Backend Developer || Go Developer || Web API Developer || Full Stack Developer || AWS Machine learning speciality
1 年Good to know about it.
Impressive insights on SAP upgrade optimization, Prashanth – the focus on parallelism certainly seems like a game-changer for efficiency!