Accelerating SAP upgrades: Mastering Parallelism for Efficiency

Accelerating SAP upgrades: Mastering Parallelism for Efficiency

"Unlocking Efficiency: Simplifying parameters calculation in SAP SUM's INITSUBST phase"

What is Parallelism in SAP upgrades ?

  1. The import of more than one package or more than one object of a package at the same time by the transport tools (tp and R3trans)
  2. The execution of more than one background jobs on the batch phases (both dialog and batch)
  3. The execution of more than one SQL process on the database level
  4. The execution of more than one R3load processes on the EU_IMPORT phase (loading data from DVDs in release upgrades) and on the migration of data in DMO scenarios (data migration option)
  5. The execution of more than one phase at same time, during the UPTIME portion of the upgrade

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.

Limitation of Parallel processing in different phases

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

  • SQL processes defines number of parallel SQL statements to be run on the database at the same time
  • Useful for the DDL-phases (data definition language), like MVNTAB and PARCONV, where the "create table", "alter table", "create index" and other commands take place. Also the phases that create aliases/synonyms of the shadow system use this parameter (SCEXEC_GRANT + SCEXEC_ALIAS), but to a less extend
  • The recommended value is the total number of physical CPUs

3. R3TRANS PROCESSES

  • R3TRANS PROCESSES, is used for tp and R3trans transport tools in parallel, on the phases where import of support packages take place (DDIC_UPG, SHADOW_IMPORT* and TABIM_UPG)
  • This is the setting that brings the most benefits in terms of overall performance in upgrades because of the number and size of the packages imported at different stages
  • The recommended value is the same number of physical CPUs available on the server, to follow the "1 parallel import process per CPU". The maximum recommended number of parallel processes is 50

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

  • Tells the upgrade tool how many R3load processes will be triggered during phases EU_IMPORT*?(in system releases upgrade) and in DMO (data migration option) scenarios, to move the data from the old database into the new HANA one
  • Since R3load utilizes small CPU processing, we can safely enter a significant number for this parameter: 3 to 5 times the number of CPUs, being "5" the theoretical top limit


Technical aspects of tp/R3trans parallelism in SUM

  • The SUM tool takes into account the information entered in field "R3TRANS PROCESSES" and optimizes the import stages according to the number of packages to be imported and according to their sequence on the import buffer file, where they are split by the?SYNCMARK entries
  • SUM then calculates the number of parallel tp and R3trans processes for each group, where each tp will read the packages, one by one, and each R3trans will write objects from that package into the database, also one by one
  • Depending on the distribution of the packages, the tool will balance the number of parallel tp??and R3trans?processes, looking for the most optimal import procedure for that particular batch of packages

What is SYNCMARK?

  • SYNCMARK are entries present on the system buffer, that divide the number of packages that can be imported at same time by the upgrade/update tools
  • These entries are only needed when TP is allowed to import several transport requests (or packages)?in parallel, and it's used to avoid that two transport requests?that contain the same?object?are?imported in parallel
  • Only the group of transport request not separated by a "SYNCMARK" will be imported in parallel

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:

  • On this example, the import buffer has divided the packages into groups that vary from 1 to 6 in between SYNCMARK entries
  • For this example a value of 6 was given on the field "R3TRANS PROCESSES", so SUM will calculate dynamically the best combination for each block
  • On the first block, composed of 6 packages, SUM set the parameter mainimp_proc to 6 and parallel to 1, which means 6 tp processes and 1 R3trans process (probably because the packages are small and contain a reduced number of objects
  • Each tp + R3trans import will finish quickly and there is no sense in having more R3trans working in parallel
  • The overwall execution is optimized by having a higher number of packages processed at same time, each one by one tp process)
  • Now for the second group, there are 2 packages in between SYNCMARK entries. SUM sets mainimp_proc to 2 and parallel to 3, meaning 2 tp?processes at the most, at same time, and up to 3 R3trans processes per tp. Probably those 2 packages are bigger and contain more objects, so having a high number of R3trans processes speed up the processing of each package
  • For the last 3 groups, which are made of only 1 package in between SYNCMARK entries, there is no need to have more than 1 tp, so all resources are allocated to R3trans via the "parallel" parameter

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;

  • Before starting the upgrade, make sure the database is optimized, updating statistics and?parameters. In additional use the latest?version of?TP and R3trans
  • Avoid to use NFS in the upgrade directory, it should be a local filesystem, due the high?I/O?volume

SaanjeevKumar K R

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!

要查看或添加评论,请登录

Prashanth Raja的更多文章

  • SAP Signavio Process Insights - Configuration & administration

    SAP Signavio Process Insights - Configuration & administration

    Subscribing to the Application in SAP BTP The process of subscribing to the application can be broken down into the…

    10 条评论
  • SAP HANA Cloud Storage Options

    SAP HANA Cloud Storage Options

    Data Tiering Options in SAP HANA Cloud Data tiering in SAP HANA Cloud gives a cost-effective storage solution, which…

社区洞察

其他会员也浏览了