SAP Knowledge Base Article - Public

2980435 - Performance optimization of Run Revenue Recognition application - technical details

Symptom

The customer is interested in technical details related to scheduling options that are available for Run Revenue Recognition apps and especially in the impact those options might have with regards to performance and runtime. Run Revenue Recognition apps in Event Based Revenue Recognition area are further referred to as EBRR Jobs. 

This article, which is primarily intended for technical users and system administrators, focuses on performance aspects. It provides insight into technical details so that technical team may better support business users in scheduling of EBRR Jobs.

Basic guidance for business users can be found in KBA 3794579 - Performance optimization of Run Revenue Recognition application.

EBRR Jobs, implemented as application jobs, allow for both single-thread and parallel processing. These application jobs trigger background processing on the respective application server. Then, application-specific logic is processed, which in turn leverages other techniques and frameworks, meaning that other process types (beyond background processes) may be involved in runtime.

The main focus of this article is on parallel processing, internally orchestrated by technical component SHDB Parallelization Framework.

Used terms:

  • PFW – SHDB Parallelization Framework
  • BTC WP – Work process of type Background
  • DIA WP – Work process of type Dialog
  • AS – Application server (also called application instance)
  • aRFC – asynchronous RFC

Environment

SAP S/4HANA Cloud Public Edition

Cause

PFW is a complex toolset that allows for parallel processing and comprises package management, resource control, and dispatching of data packets to be processed in parallel. Various system resources (CPU utilization, memory usage, delta rows, etc.) of all AS of the system are continuously monitored, so that the system can decide, for each packet, whether and where it can be dispatched for processing.
Note: PFW is not publicly available for use in customer development.

To support parallel processing in EBRR Jobs, there are two extra parameters available on top of general selection parameters:

  • Parallel Processing
  • Max. Number of Parallel Tasks

Parallel Processing:

  • OFF: Parallel processing does not take place

  • ON (together with Max. Number of Parallel Tasks: 2-5): Parallel processing may take place

    • If the data set (determined based on selection criteria) does not qualify for parallel processing due to the small number of items to be processed, the parallel processing does not take place even if switched ON and if number of required parallel tasks was specified. This evaluation is performed internally by the program and cannot be affected by the user.

Resolution

There are various tasks related to internal orchestration of PFW. This small overhead can be neglected as PFW is a centrally running component, serving many other applications as well. Here, the resources are not allocated per-app, so the overhead is constant, no matter whether EBRR Job is scheduled and running or not. Let us consider PFW part of the running system.

One BTC WP is started per EBRR Job. This process in turn triggers the data set processing via PFW with the number of tasks as requested (1: single-thread processing or 2-5: parallel processing). Eventually, BTC WP collects and merges partial results of PFW-processed data and reports the result back to the application job log. The application job status is set based on the overall processing result.

PFW, triggered within the BTC WP and serving as an orchestrator, starts packaging and processing the data, based on resource availability, which is continuously monitored. Each data packet is processed via aRFC in a separate DIA WP. The number of allocated and simultaneously active DIA WPs at any moment during a running EBRR Job can be less than or equal to the number of requested parallel tasks as specified in EBRR Job schedule.

When the next data packet is to be processed, PFW starts its processing as aRFC. This forms a new request for a DIA WP. In general, DIA WPs are assigned to requests based on request priority. Each request for WP to be assigned is of priority high, normal, or low. The aRFC requests triggered by PFW are low-prio requests.

There are several system parameters in place to prevent over-allocation of system-critical resources by non-critical tasks. One of these parameters sets the quota for number of DIA WPs (as a percentage of all configured DIA WPs on a particular AS) to be assigned to low-prio requests. Actual number of allocated DIA WPs is then monitored by PFW to check whether the next low-prio request can be satisfied according to quota and therefore can be assigned a free DIA WP and processed, or whether it has to wait (in case the quota has been reached). There are also other technical settings affecting the dispatching priorities etc., but the quota is the most critical factor here.

There is an important difference between a low-prio request processed via aRFC in DIA WP and a normal (interactive user) high-prio request processed in DIA WP:

  • the maximum runtime of a high-prio request is finite
  • the maximum runtime of a low-prio request is unlimited. This perfectly fits EBRR Jobs as there might be a packet which takes more than predefined maximum (high-prio) runtime to process. That would be a limiting factor otherwise.

All other low-prio requests running on the same AS at the same time contribute to quota consumption, too.

The default quota for low-prio requests (system parameter) is 70%. This parameter is maintained at AS level. The requests are distributed across all available AS (default behaviour) or within a specific server group (see below). That being said, the maximum number of DIA WPs potentially available for aRFC requests is calculated as follows:

( quota_as_1 * no_of_dia_wp_as_1 ) + ( quota_as_2 * no_of_dia_wp_as_2 ) + ...

The quota-based number of available DIA WPs for a particular AS is always checked when the DIA WP is to be allocated to serve aRFC request on that server.

  • Example 1:
    • AS_1, 100 DIA WPs, low-prio quota = 70%, DIA WP for low-prio requests = 0.7 * 100 = 70
    • Quota-based theoretical max # of DIA WPs: 70
    • 3 EBRR Jobs running at the same time on AS_1, each with 5 parallel tasks
    • Used WPs: 3 BTC WPs + 3 * 5 DIA WPs
    • 15 DIA WPs < 70, therefore no wait times caused by resource constraints (assuming there are no other contributing low-prio tasks)
  • Example 2:
    • AS_1: 30 DIA WPs, low-prio quota = 50%, DIA WP for low-prio requests = 0.5 * 30 = 15
    • AS_2: 50 DIA WPs, low-prio quota = 70%, DIA WP for low-prio requests = 0.7 * 50 = 35
    • Quota-based theoretical max # of DIA WPs: 15 + 35 = 50
    • 8 EBRR Jobs running at the same time on AS_1, each with 5 parallel tasks:
    • Used WPs: 8 BTC WPs (AS_1) + 8 * 5 DIA WPs (AS_1, AS_2)
    • When distributing 40 DIA WPs, PFW reflects and respects local low-prio quotas: AS_1 (15), AS_2 (35)
    • 8 * 5 = 40 DIA WPs < 50, therefore no wait times caused by resource constraints (assuming there are no other low-prio tasks contributing)
    • assumption: value of 50% quota for AS_1 (deviating from default value of 70%) was maintained by SAP Operations

In exceptional cases, specific PFW applications (e.g., Run Revenue Recognition - Projects) can be configured so that they are exclusively processed via a dedicated server group. To do so, please raise support tickets:

  • for component XX-S4C-OPR-INC to get new server group configured
  • for component CO-PC-OBJ-EBR-2CL to get the particular application job configured to use new server group

See Also

KBA 3794579 - Performance optimization of Run Revenue Recognition application

Keywords

Run Revenue Recognition, performance, background job, general performance, Parallel Processing, performance, revenue recognition. , KBA , CO-PC-OBJ-EBR-2CL , Event-Based Revenue Recognition (Public Cloud) , CO-PC-OBJ-EBR , Event-Based Revenue Recognition , How To

Product

SAP S/4HANA Cloud Public Edition all versions