One of the biggest challenges with SAP HANA databases are the duration of the startups. Here we have to separate the available time and the reload time.
In my career as consultant I’ve seen a lot of HANA databases with pretty long startup times with more than 1 hour. This is also the reason why SAP introduced the fast restart option with SPS4. But which possibilities are there to speed up which phase with which release? Because a lot of DBs are still not on SPS4 and can not profit from new features. How you can identify the bottleneck?
In my career as consultant I’ve seen a lot of HANA databases with pretty long startup times with more than 1 hour. This is also the reason why SAP introduced the fast restart option with SPS4. But which possibilities are there to speed up which phase with which release? Because a lot of DBs are still not on SPS4 and can not profit from new features. How you can identify the bottleneck?
To understand which phase is your pain point, we have to understand how the DB starts and which phase can be optimized.
In any case we assume that the DB was stopped normally which includes a global save point at the end of the shutdown phase.
In any case we assume that the DB was stopped normally which includes a global save point at the end of the shutdown phase.
High level overview: (https://blogs.sap.com/2019/04/02/sap-hana-startup/)
1. Open the data files
2. load converter tables from the last savepoint (mapping of logical pages to physical pages in the data file)
3. load the list of open transactions from the last savepoint
4. load RS tables
5. replay redo log entries
6. Roll back uncommited transactions
7. Perform global savepoint
2. load converter tables from the last savepoint (mapping of logical pages to physical pages in the data file)
3. load the list of open transactions from the last savepoint
4. load RS tables
5. replay redo log entries
6. Roll back uncommited transactions
7. Perform global savepoint
Phases in detail
For our little deep dive this information are not enough.
Details for every phase: 2222217 – How-To: Troubleshooting SAP HANA Startup Times
Details for every phase: 2222217 – How-To: Troubleshooting SAP HANA Startup Times
To give you an example I setup a test environment with a 8TB HANA DB with HANA 2.0 SPS3 Rev. 36.
Hint: To find the begin of a start phase search for “==== Starting hdbindexserver“.
#as sidadm
cdtrace
grep "==== Starting hdbindex" *
view index*.trc
PersistentSpaceImpl.cpp / PersistenceManager
FileIDMapping.cpp / ContainerDirectory
=> in this phase the container directory is read from disk and memory structures for statistics are set up.
VirtualFileStatsProxy.cpp / PMRestart
=> this phase is single threaded! Try to reduce the LOB files. Here is room for some improvement (parallelism) @SAP
The reason for this long phase are 1,6TB of HybridLOBs.
Here are the Flame Graph of this phase:
AbsolutePageAccessImpl / RowStorePageAccess / CheckpointMgr.cc / Service_Startup
=> loading RS pages
RecoveryHandlerImp.cpp / Logger
PersistenceManagerImpl.cpp / PersistenceManager
=> here the global savepoint is written
IntegrityCheckerTimer.h / Service_Startup
=> RowStore consistency check which can be affected with parameter consistency_check_at_startup:
“Configure row store consistency check during SAP HANA startup: This parameter is used to configure a row store consistency check via CHECK_TABLE_CONSISTENCY during SAP HANA startup. It’s a list parameter and the allowed values are ‘table’, ‘page’ and ‘index’, which perform consistency checks on ‘table’, ‘page’ and ‘index’ respectively. This consistency check can be disabled by setting the parameter value to ‘none’.”
TRexApiSystem.cpp / TableReload
=> reload with 5 threads. With enough CPUs you can improve this phase with more parallel threads
=> lazy reload finished
Background info RS
Since HANA 1.0 SPS09 there is a hidden parameter keep_shared_memory_over_restart which keeps the Row Store in memory also after a DB restart. Therefor you will see a process called hdbrsutil which keeps the tables attached to the shared memory. (2159435 – How-To: Keeping SAP HANA Row Store in Memory when restarting)
Since HANA 1.0 SPS09 there is a hidden parameter keep_shared_memory_over_restart which keeps the Row Store in memory also after a DB restart. Therefor you will see a process called hdbrsutil which keeps the tables attached to the shared memory. (2159435 – How-To: Keeping SAP HANA Row Store in Memory when restarting)
Background info CS
Since HANA 2.0 SPS4 there were some changes in the startup of RS and CS tables. The load of LOBs is optimized and there is a new feature which is called fast restart option. Since Rev. 35 there is also the possibility to use pmem if you have the correct hardware (cascade lake).
Since HANA 2.0 SPS4 there were some changes in the startup of RS and CS tables. The load of LOBs is optimized and there is a new feature which is called fast restart option. Since Rev. 35 there is also the possibility to use pmem if you have the correct hardware (cascade lake).
SPS3 vs SPS4
- Compared you can see exact same DBs
- No load (=no application server online) on both systems while testing
- The startup was tested 3 times per release
- The best and worst were not used
- no parameter improvements
- SPS4 without fast restart options
- result: round about 10min faster till available
- improvements in virtual file statistics with SPS4
- Reload of CS slower with SPS4
The second part will describe the fast restart option of SPS4. How it works and how easy you can set it up.
Thank you for taking the time to share this important information with us.
ResponderExcluirprocess of lead generation