Capture & Replay
SAP HANA capture and replay was first introduced with the initial release of SAP HANA 1.0 SPS12. One of the main goals is to reduce the manual testing effort of the end-users e.g. during a regression testing from one SAP HANA release to another by providing an on-site tool which captures the workload of a SAP HANA database and replays it on another, which is for example on a higher release. Please also have a look at the great blog posts below to get more information about the capabilities and simplifications of SAP HANA Capture and Replay:
- Introducing the new SAP HANA capture and replay tool, available with SAP HANA SPS12
- Introducing enhancements to SAP HANA capture and replay in SAP HANA 1.0 SPS12 Revision 122.14 and SAP HANA 2.0 SPS02
- SAP HANA 2.0 SPS 00 What’s New: Performance Monitoring and Analysis – by the SAP HANA Academy
- A short overview of the SAP HANA Performance Management Tools in SAP HANA 2.0 SPS00
To perform a replay, you need a so called replayer service (hdbwlreplayer), which is started and running on OS level. The replayer is using SAP HANA binaries to execute the captured workload on a target database. In many cases, only one replayer service is sufficient to execute a replay successfully, but sometimes you need more than one. Generally, multiple replayers can be used for all replaying purposes but especially for a better scalability and performance in large workload scenarios. Distributing and dividing all involved components (Target Instance, Control Instance, Replayer(s)) on different hosts and systems will reflect the initial captured workload as realistic as possible and reduce the effect which the resource consumption of the components might have on a replay. The following sections will represent an exemplary setup of distributed multiple replayers running on SAP HANA, Express Edition with a central Control Instance.
Please note that within the following sections, the standard setup with SAP HANA Cockpit 2.0 as a central monitoring tool is not described but it is expected to be installed for this scenario. The replay results which are stored on the Control Instance can be displayed with SAP HANA Cockpit 2.0. All further information about installing SAP HANA Cockpit can be found in the SAP HANA Administration Guide.
Usage of SAP HANA, Express Edition
Some of you might be wondering why I used SAP HANA Express Edition for this setup? That’s easy: Because SAP HANA Express Edition is free of charge up to 32GB RAM and it can be easily and quickly installed on various platforms. Furthermore, it offers all necessary functionalities to successfully perform a replay and therefore it meets the requirements of a replayer for our purposes. For more information about SAP HANA, Express Edition please have a look at What is SAP HANA, Express Edition?
- Host ld0000 Capture Instance (SID: TI0): Captured system e.g. production system
- Host ld0001 Target Instance (SID: TI1, Instance Number 02): The SAP HANA system where the replay should be executed on, e.g. a test system with the newest SAP HANA Revision
- Host ld0002 Control Instance (SID: CD1, Instance Number 01, Tenant CD1): The SAP HANA system which handles all replayers and is controlling the overall replay process. Afterwards you will find the replay results stored on that system. Results can be visualized with SAP HANA Cockpit 2.0.
- Host ld0003 Replayer #1 (SID: RP1): SAP HANA, Express Edition system where replayer #1 is running (on OS level). Please also see SAP HANA Capture and Replay Guide – “Setting up and configuring a Replayer”
- Create User Store on OS-Level of ld0003
Example: hdbuserstore -i SET CD1USERSTORE ld0002:30115 SYSTEM
hdbuserstore -i SET <User store name> <Host of Control DB>:3<Instance Number of Control DB>15 <Control DB user>
- Start Replayer on OS-Level of ld0003
Example: hdbwlreplayer -controlhost ld0002 -controlinstnum 01 -controladminkey SYSTEM,CD1USERSTORE -controldbname CD1 -port 12345 &
hdbwlreplayer -controlhost <target instance host> -controlinstnum <target instance number> -controladminkey <user>,<user store name> -controldbname <target instance SID> -port 12345 &
- Create User Store on OS-Level of ld0003
- Host ld0004 Replayer #2 (SID: RP2): SAP HANA, Express Edition system where replayer #2 is running (on OS level).
- Create User Store on OS-Level of ld0004
- Start Replayer on OS-Level of ld0004
- Host ldnnnn Replayer n…
- Create User Store on OS-Level of ldnnnn
- Start Replayer on OS-Level of ldnnnn
Pre-processing Steps & Replay
- Start Preprocessing on Control Instance (ld0002) via SAP HANA Cockpit 2.0. Please have a look at the following SAP HANA Capture and Replay Guide or the SAP HANA Administration Guide on how to pre-process. For any further information regarding Capture & Replay please also have a look at the official SAP HANA Performance Management Tools Note 2362820.
- Either share the pre-processed files (default directory is /usr/sap/<ControlDBSID>/HDB<Instance>/<HOST>/trace/<CapturedSID_CaptureID> – e.g.
on a central storage where the replayers have also access on
or copy the pre-processed files from the Control Instance to the systems on which the specific replayers are running. This is not recommended because of the manual effort of copying as well as that you must repeat the copy steps as soon as there are any changes on the pre-processed files on the Control Instance.
- Regardless if you are using a central storage of if you have copied the files, temporary data is stored into the pre-process folder (in our case the folder “TI0_1508925191761765464”) meanwhile the replay is ongoing. Therefore, please execute the following command before the replay is being started:
chmod -R 777 /<path_to_pre-processed_folder>/TI0_1508925191761765464
Note: The directory path to this central storage must be the same on Control DB and replayers because the replay will use the so called “Preprocess Destination” on each replayer. The directory can be configured via SAP HANA Cockpit 2.0 -> access Control DB -> access Replay Tile -> access Replay Candidates -> click “Configure Replay”. Please refresh the page afterwards and start the preprocessing for the specific capture file.
Note: Access permission to the preprocessed files must be configured for the specific <sid>adm of the SAP HANA instance where the replayer is running, otherwise the replay will fail with the following error message:
Note: When using SAP HANA, Express Edition for configuring multiple replayers, please be aware that the global allocation limit of each SAP HANA, Express Edition installation must be modified to provide sufficient memory for the replayer process. Please see SAP HANA Capture and Replay Guide for further information regarding sizing.
The global allocation limit can be modified in the ini file of each installation. Please note that the use of replayers does not require the SAP HANA, Express Edition installation to be up and running, but is still affected by the global allocation limit defined for it. Please note that when changing the global allocation limit of SAP HANA, Express Edition installations, the database itself can exceed the maximum memory allowed free of charge. This can result in a lockdown of the database itself by the license manager, which will not impact the replayer process, but will render the database installation unusable.
- As soon as all systems and replayers are installed and started, the replay can be configured via SAP HANA Cockpit 2.0. This can be done by connecting the SAP HANA Cockpit 2.0 to the Control DB and configuring and starting a replay. Please have a look at the SAP HANA Capture and Replay Guide or the SAP HANA Administration Guide on how to configure a replay.
About the author
Dominik Zapf is a team member of SHOT, the SAP HANA Optimization Team. SHOT is part of SAP HANA Development and offers dedicated project-based and strategic SAP HANA support for ISVs and startups primarily in regard to functionality and performance.