Setting Up Operation Modes for Resource Configuration

Objectives

After completing this lesson, you will be able to:
  • Describe the concept of operation modes
  • Describe dynamic and reserved work processes
  • Set up operation modes
  • Switch operation modes
  • Outline the meaning of reserved and dynamic work processes
  • Explain the options to change the work processes distribution using operation mode switches
  • Describe the usage of consistency checks

Operation Modes

As the figure Concept of Operations Modes illustrates, the demands of users on the SAP system may vary over the course of the day. During the day, a large number of dialog users are working in the system. They want to be served with high performance by the system. Therefore, a large number of dialog work processes should be available for users during the day. During the night, however, only a small number of these dialog work processes are used, because less users are working. This frees the system resources to process background jobs.

The type and number of work processes for each instance is defined by profile parameters in the profiles. The distribution of work processes in the profiles is optimized for fast dialog response times, meaning, there are usually many dialog work processes and a small number of background work processes. This means that during the night, system resources, such as the main memory or the CPU, are still tied to the dialog work processes and cannot be fully utilized by the background processes. It would therefore be very practical, if the system could adjust different types and numbers of work processes to the different demands in the system. This can be achieved through the concept of operation modes.

As the figure Adjusting Instances to the Load Distribution shows, by using the operation modes, you can adjust the type and distribution of the work processes to the varying load distribution during the day. You can also adjust the distribution of the work processes to business requirements that only occur once. By defining operation modes, you can change not only the configurable number of work processes defined in the profiles, but also the type and distribution of the individual work process types within this configurable number. The switch between the work process types is performed dynamically during the runtime of the SAP system. The switch is triggered using a defined schedule. A reserved work process is not immediately terminated, but instead marked for switching. This means that certain delays may occur. This type change is recorded in the system log.

During the switch of the operation modes, neither the instance nor the affected work processes need to be restarted. As a result, the quality of the buffer of the SAP system is retained during an operation mode switch, and the work process finishes processing the current request. The individual work processes retain their process ID after the switch. You can observe this in the process overview (SM50).

Reserved, Standby, or Restricted Work Processes

In an SAP system, deadlocks can occur due to various reasons. Therefore, work processes can be reserved so that the system can free itself from deadlocks. That is why they are called reserved processes, also known as standby or restricted work processes.

The reserved work processes are always of type dialog. They can be defined via the rdisp/wp_no_restricted parameter. The default value of the parameter is o.

Reserved work processes are started during the system start and run in the system occupying system resources. However, they are not used in normal operation, even if all dialog work processes are occupied and further requests are waiting in the dialog queue to be processed. To avoid possible deadlocks, these reserved dialog work processes are used only when all normal dialog work processes are in Hold status. You can monitor it in transaction SM50.

When all dialog work processes are hold, the reserved work processes start working and try to resolve the deadlock. After at least one of the dialog work processes is not on Hold any longer, the reserved work processes become reserved again and are no longer working.

Hint

To prevent problems in the configuration of the operation mode switch, we recommend that you do not change the rdisp/wp_no_restricted=0 parameter. Instead, we recommend configuring dynamic work processes when setting up operation modes.

Dynamic Work Processes

Dynamic work processes enable a kind of adaptive computing on the one hand, and on the other hand, enable the SAP system to free itself from deadlocks – at least within certain boundaries. Dynamic work processes can be seen as a supplement to CCMS operation mode switching (changing the work process type).

Dynamic work processes are not used in normal operation. The ABAP dispatcher starts them when they are needed and they can have any type. When the dynamic work processes are no longer needed, they are stopped again and no longer occupy any system resources. Unlike the restricted work processes, the dynamic work processes are started when all work processes of all types (not only dialog) have the status Hold. You can see it in transaction SM50. This is done to avoid deadlocks. However, it takes some time for dynamic work processes to start and become available. This is what you have to consider.

The number of dynamic work processes can only be defined indirectly. The profile parameter rdisp/wp_max_no specifies the total number of all work processes, including the dynamic work processes.

As of kernel 7.42, the profile parameter rdisp/wp_max_no is set to the following formula:

$(RDISP/WP_NO_DIA) + $(RDISP/WP_NO_VB) + $(RDISP/WP_NO_VB2) + $(RDISP/WP_NO_ENQ) + $(RDISP/WP_NO_BTC) + $(RDISP/WP_NO_SPO) + MAX( $(RDISP/WP_NO_RESTRICTED), 5

The kernel default formula is a sum of all configured work processes and it defines the standard number of 5 work processes to be started dynamically.

This means each instance has five dynamic work processes, as long as no restricted, or standby, work processes are configured. If restricted work processes are configured, then there are fewer (or no) dynamic work processes, accordingly.

However, you can override the formula.

Hint

We recommend that you leave this parameter at the default setting. You can change the number of dynamic work processes conveniently using the operation mode switch.

However, if you set this parameter to a fixed value, make sure that the there are at least 5 more work processes than the total number of all configured work processes.

The number of configurable work processes is specified with the rdisp/configurable_wp_no parameter. As of kernel 7.42, the parameter is set to the following formula:

MAX( $(RDISP/WP_MAX_NO) - 5, $(RDISP/WP_NO_DIA) + $(RDISP/WP_NO_VB) + $(RDISP/WP_NO_VB2) + $(RDISP/WP_NO_ENQ) + $(RDISP/WP_NO_BTC) + $(RDISP/WP_NO_SPO) )

You should not change the rdisp/configurable_wp_no parameter.

Note

With kernel 7.42, the default values of the profile parameters rdisp/wp_max_no and rdisp/configurable_wp_no have been changed from the string "DEFAULT" to formulas. The formulas lead to the same calculations as the string "DEFAULT" in kernel 7.41. However, the profile check in transaction RZ10 reports errors when the string "DEFAULT" is used with kernel 7.42 (or later) because these parameters expect a numeric type. For this reason the parameters should be removed from all profiles instead of setting them to the value "DEFAULT".

Hint

We recommend that you do not set the following parameters into any profile unless you have a compelling reason: rdisp/configurable_wp_no, rdisp/wp_no_enq, rdisp/wp_no_restricted, rdisp/wp_max_no.

We also do not recommended that you change profiles via the basic maintenance in transaction RZ10. The basic maintenance writes a lot of parameters into the profiles that are not required. This unnecessarily increases the complexity of profiles and the risk of inconsistent configuration. In the case that you change profiles via transaction RZ10, we recommend that you use extended maintenance.

For more information, please read the following SAP Note https://me.sap.com/notes/2190597.

Operation Modes Setup

As shown in the figure Setting Up Operation Modes, the operation modes are set up in a number of steps.

Steps to Configure Operation Modes

  1. First, you create the operation modes in transaction RZ04. They are created as empty containers.

  2. Next, all active instances of the system are detected and the work process configuration defined in the instance profiles is assigned to the operation modes as default value.

  3. You can now make allocations for the individual operation modes and individual instances within the range of the total number of work processes taken from the instance profile.

    Hint

    You should make the allocation primarily between the dialog and background work processes, as – for example – the number of spool work processes cannot be changed using operation modes.
  4. You then specify the periods within a day (24 hours) for which the operation modes are valid and when the switch between the different operation modes should happen. You do this specification in the timetable (transaction SM63) .

In transaction RZ04, you can define a normal and an exception operation mode.

A normal operation mode means that work process configuration for an instance is defined for time periods within a 24-hours time frame. No gaps are accepted here. This configuration is valid for each single day.

You must define a timetable for normal operation before a switch of operation modes can take place. The configuration in the instance profile remains active.

An exceptional operation means that for a very specific time period a different work process configuration is required, for example, when there is activity planned like import of transports or a client copy. You can define an exceptional operation mode for a specific day when the planned activity is going to happen. The exception operation can only be defined as a unique event. After the time period is over, the system switches back to the normal operation mode.

Optional: Setting Up Operation Modes

Business Example

Configuring the work processes using profile files usually meets the requirements for day operation. As an administrator, you want to make use of the operation modes in the SAP system to optimize the performance of the system for the different requirements during the day and during the night.

Task 1: Create Operation Modes

You want to create the operation modes for day and night operation.

Steps

  1. Create two operation modes Daymode and Nightmode in CCMS: Edit Operation Modes and Instances (transaction RZ04).

    1. Start transaction RZ04 to create operation modes.

    2. On the CCMS: Edit Operation Modes and Instances screen, choose Create operation mode.

    3. Enter the name of day operation mode (for example, Daymode) and a short description.

    4. Choose Save in the bottom right-hand corner.

    5. Repeat the procedure for the night operation mode. Enter, for example, Nightmode and then choose Save.

      Result

      When you have finished, you should see two operation modes on the CCMS: Edit Operation Modes and Instances screen.
  2. Detect the work process configuration for all application server instances of your system.

    1. On the CCMS: Edit Operation Modes and Instances screen, choose Instances/operation modes to switch to the instances/operation modes view.

      Note

      Since this is the initial setup of operation modes, all active AS instances in the system must be detected first. This is why the table appears empty.
    2. To detect the work process distribution for the instances of your system, choose SettingsBased on current statusNew instancesGenerate.

      Result

      The work processes defined in the instance profiles are assigned to the operation modes.
    3. Choose Save in the bottom right-hand corner to activate your entries.

  3. Change the distribution of the work processes for Daymode of the AAS instances in your system. Decrease the number of background work processes by 2 and increase the number of dialog work processes by 2 as well.

    1. In the section, where the AAS instance configuration is displayed, double-click operation mode Daymode to change the distribution of the work processes for it.

    2. In dialog box CCMS: Maintain Work Process Distribution, place the cursor in the number field of the background work process type.

    3. Change the number by choosing - to decrease it by 2.

      You may need to scroll down a bit to see the buttons.

    4. In dialog box CCMS: Maintain Work Process Distribution, place the cursor in the number field of the dialog work process type.

    5. Change the number by choosing + to increase it by 2.

    6. Choose Save.

  4. Change the distribution of the work processes for Nightmode of the AAS instances in your system. Decrease the number of dialog work processes by 4 and increase the number of background work processes by 4 as well.

    Note

    There should be at least two dialog and two background work processes in all operation modes.

    1. In the section, where the AAS instance configuration is displayed, double-click operation mode Nightmode to change the distribution of the work processes for it.

    2. In dialog box CCMS: Maintain Work Process Distribution, place the cursor in the number field of the dialog work process type.

    3. Change the number by choosing - to decrease it by 4.

      You may need to scroll down a bit to see the buttons.

    4. In dialog box CCMS: Maintain Work Process Distribution, place the cursor in the number field of the background work process type.

    5. Change the number by choosing + to increase it by 4.

    6. Choose Save.

    7. On the CCMS: Edit Operation Modes and Instances screen, choose Save in the bottom right-hand corner.

      Result

      This saves the new work process distribution for all operation modes.

Task 2: Schedule Operation Modes

You want to schedule the operation modes in the timetable so the system knows when they should start and end.

Steps

  1. In the operation mode calendar (transaction SM63), schedule the normal operation where you define when the operation modes, which you have created, should begin and end.

    1. Start transaction SM63.

      Alternatively, in transaction RZ04 on the initial screen CCMS: Edit Operation Modes and Instances, where you create new modes, select Operation modeTimetable.

    2. On the Display/Maintain Operation Mode Set screen, select the radio button Normal operation (24 hr).

    3. Choose Change.

    4. Double-click the relevant time lines to select the start and end of the time interval for the operation mode Daymode. The time line changes from blue to black.

      For example, you can first select the time line 08.00 - 09.00 to define that the day mode begins at 8 o’clock in the morning. You can then select the time line 22.00 - 23.00 to define that the day mode ends at 11 o’clock in the evening. The entire time frame changes from blue to black.

    5. Choose Assign.

    6. Use the F4 value help to select operation mode Daymode.

    7. Choose Continue.

    8. Follow the same procedure to assign the operation mode Nightmode.

      You can only select the time lines that have not been assigned yet.

    9. Assign to the Nightmode.

    10. Choose Continue.

      Consider that the 24-hours cycle cannot contain any gaps.

    11. After you have assigned the entire 24-hour cycle to your operation modes, choose Save in the bottom right-hand corner.

      Result

      There is a message in the status bar saying Operation mode set was saved.

Operation Mode Switch

When operation modes are switched, the work processes are redistributed automatically without stopping and restarting the instances. Only the work process types are changed. For example, a work process used as a dialog process can be switched for use as a background process.

The new process type is not activated until the process is free. This means that a process might not be switched immediately. Instead, a process is set to be switched when next possible. For example, if all background processes to be switched to dialog processes still have jobs, the processes are switched one by one when the jobs are completed. Processing is not interrupted. Normal system operation continues uninterrupted during the operation mode switch.

Note

Operation mode switches are recorded in the system log. The old process type and the new process type are recorded for each work process that is switched.

The operation mode switch is performed automatically according to the configuration in he time table (transaction SM63. If you have set up a normal operation, the switch is repeated within a 24-hour cycle every day. If you have configured the exceptional operation mode, the switch is performed automatically for the configured period of time on the date that you have defined.

You can also switch the operation modes manually in the Control Panel (transaction RZ03). You can do this at any time regardless the time table. However, you must always ensure that a manual operation mode switch does not interrupt system operation, for example, because there are too few dialog processes available.

You can switch the operation mode either for all instances by choosing ControlSwitch operation modeAll servers, or for a selected instance by choosing ControlSwitch operation modeSelected servers.

You can also simulate the operation mode-switching first by choosing ControlSwitch operation modeSimulation. The system then checks which instances can be switched.

You can also trigger an operation mode switch via an ABAP program using a function module (RZL_PERFORM_BA_SWITCH).

For more information, please check the official documentation on the SAP Help Portal: https://help.sap.com/docs/ABAP_PLATFORM_NEW/b17bd20044a44edb9aa7830ee52ffac3/04520e506567031de10000000a44538d.html

Optional: Switching Operation Modes Manually

You want to test the operation modes and the new work process distribution before the system switches to another operation mode according to the calendar. So you want to switch between the modes manually.

Steps

  1. Switch manually to the Nightmode via the Control Panel (transaction RZ03).

    1. Start transaction RZ03.

    2. Choose Choose operation mode.

    3. Select Nightmode.

    4. Choose Choose.

      Result

      On the input screen CCMS Control Panel: Display Server States and Alerts in the line Active Operation Mode in Accordance with Time Table, Nightmode is now displayed. In the Configuration alerts column, you can see the message Operation mode differs for both instances.
    5. In the menu bar, choose ControlSwitch operation modeAll servers to switch to the mode manually.

    6. Confirm the dialog Switch all servers with Yes.

      Result

      You should then no longer see the configuration alert. That is, all processes have been switched according to the configuration of the operation mode Nightmode.
  2. Observe the change in the work process distribution by using transaction SM50. Remember that you made the changes on the AAS instance, so you have to check the distribution there. You may have to log on to the AAS instance via transaction SM51.

    1. Start transaction SM51.

    2. Select the AAS instance.

    3. Choose Work Processes from the application panel.

    4. Check the changed distribution of the work processes in the process overview.

      Result

      You can see that individual work process types have changed according to the work process distribution in the selected operation mode. Especially, you should see the increased number of background work processes, and the decreased number of dialog work processes. If you did not allocate all configurable work processes during the mode switching, additional dynamic work processes have been configured (Sum < Con). They are not visible in SM50.

Dynamic and Reserved Work Processes

As already described in this lesson, there are two special types of work processes: reserved and dynamic work processes. The number of those special work processes in the system is defined by profile parameters.

Operation mode switching enables you to adjust the number configurable work processes without changing the profile parameters. When setting up operation modes and performing the distribution of work processes, if you do not allocate all configurable work processes to the different work process types, the remaining work processes become dynamic work processes.

The figure Operation Mode Switching with Dynamic Work Processes shows that if you reduce 2 dialog work processes and 1 update work process, and increase the batch (background) work processes by 1 for the Operation Mode: Night, you get the following scenario:

In Operation Mode: Night the one reduced dialog work process switches a batch work process. The other reduced dialog work process and the update work process are stopped, because they have become dynamic work processes, since not all the configurable work processes were allocated to the different types. When Operation Mode: Day is switched again, the increased batch work process becomes a dialog work process again, and the two dynamic work processes become an dialog and a update work process.

Work Processes in the Operation Mode Switch

Operation mode switching and allocation of the work processes are defined in transaction RZ04. The figure Work Process Allocation During Operation Mode Switching shows the Night and Day scenario for the instances of SAP system S4Q. In Night operation mode, the number of dialog work processes is reduced and the number of background work processes is increased. The total number of all active work processes is indicated by the Sum column. The number of all configurable work process is shown in the Con column. The Max column indicates how many work process can be started dynamically. The default value is 5 more than all configurable work processes. The configurable and maximum number of work processes cannot be changed.

If the number in the Sum column is less than in the Con column, it means that not all configurable work processes are allocated to the different work process types. All the work processes that have not been allocated become dynamic work processes in addition to the default 5.

You cannot arbitrarily change the work process distribution.

Work Process Types and Type of Changeability

Work Process TypeType of changeability (+ = increase number, - = decrease number)
Dialog+: Possible (at least 2D WPs remain) -: Possible
ReservedCannot be changed
Background+: Possible -: Possible
Class ADefines the subset of the B WPs that are only to process class A background jobs.
Update+: Possible, if there is at least 1 V-WP -: Possible, if at least 1 V-WP remains
U2 update+: possible, if there is at least 1 U2-WP -: Possible, if at least 1 U2-WP remains
SpoolCannot be changed
SumOnly indirectly changeable
ConfigurableCannot be changed
MaximumCannot be changed

Note

If you change the allocation, you should primarily change between the dialog and background work processes.

The figure Process Overview During Mode Switching with Dynamic Work Processes shows the impact of set profile parameter value and the operation mode switching between day and night. The work processes that have been switched to dynamic work processes, and therefore were stopped, are not visible in transaction SM50. There, you will find corresponding gaps in the work process numbering.

Monitoring and Consistency Checks

In transaction RZ03, you can also monitor the instances and the operation modes.

There, you can use the following functions:

  • Check the status of all instances and of the operation modes.

  • Manually switch an operation mode.

  • Display an overview of the distributed work processes.

  • Switch to the alert monitor.

You can display a detailed analysis of the status of the individual instances by selecting the instance and choosing MonitoringStatus details.

There you can see detailed information about the instance and the current work process configuration from the active operation mode.

By choosing MonitoringAlert Monitor, you can switch to the transaction RZ20 and monitor the alerts.

As the figure Profile Consistency Checks shows, inconsistencies in the SAP system may prevent you from switching between operation modes. Such inconsistencies can occur if the number of work processes is defined differently in different places in the system, namely the instance profiles at operating system level, the instance profile in the database, and the definition of the operation modes themselves.

If, for example, the number of work processes in the profiles is changed, the system can no longer switch operation modes until after a restart of the instance. You must therefore adjust the configuration of the operation modes after any change to the work process distribution in the profiles.

Log in to track your progress & complete quizzes