In this blog, we will explore the concept of workload patterns within the HANA Platform, including how to define and understand these patterns. Our primary focus will be on identifying opportunities to make the HANA workload more comprehensible and manageable through various workload management methods. Gaining an understanding of workload patterns is fundamental, as it lays the groundwork for further investigation into workload-related issues, such as those pertaining to CPU usage, memory allocation, and expensive SQL statements.
In the SAP HANA Platform, a workload pattern represents the distinct characteristics of database operations within a specific timeframe. It includes not only the types of queries executed and their frequency but also the execution times and resource usage like CPU and memory. Additionally, it encompasses the pattern of jobs originating from different applications, such as S/4 HANA or Fiori Launchpad, and those from external systems through RFC.
The combination of these characteristics leads to a complex workload pattern in SAP HANA, which manages both OLTP (Online Transaction Processing) and OLAP (Online Analytical Processing) workloads. Analyzing these patterns is vital for database administrators and developers. It helps prioritize tasks to stabilize the system and then reduce resource consumption and address performance issues, particularly at the query level. Understanding these patterns is the first step in tackling workload complexities in SAP HANA.
To effectively analyze workload patterns in SAP HANA, abstract concepts must be translated into monitorable metrics. This includes CPU utilization, memory consumption, HANA thread samples, locks, and other information gathered by the statistics server. As a starting point for workload analysis, the following monitoring results are particularly insightful:
CPU Utilization: This encompasses both user CPU (used by activities within the HANA platform) and system CPU (primarily related to OS activities). Monitoring CPU utilization is vital as it reveals the overall workload intensity, identifies critical time frames, and indicates the maximum CPU usage.
Memory Consumption: Memory management in HANA is multifaceted, involving not just the data loaded into memory but also aspects like working memory, buffering, and caching. Even the residual memory used by the OS is significant. It’s important to ensure that the memory used by HANA remains well below its allocated limit and that there are no significant fluctuations over time due to issues like expensive statements, unmanaged workloads, or memory leaks.
Thread Samples: Analyzing thread samples is crucial in workload assessment. Detailed thread information helps to correlate CPU and memory data and identify major contributors to workload during peak business hours, such as specific application users, job names, code sources, and the number of threads. Thread samples are used extensively in this blog series to illustrate various examples.
SAP HANA offers a variety of tools to gather crucial workload information without the need for initial scripting. These include the HANA Cockpit, HANA Studio, DBACockpit, Solution Manager, the Health Monitoring tool from SAP Cloud, and the SAP BTP cockpit. For more in-depth insights, however, I recommend becoming familiar with HANA's native monitoring views, which can provide a deeper understanding of the system.
The list of HANA system monitoring view could be found on the SAP help portal: Monitoring Views | SAP Help Portal
For instance, a database administrator seeking detailed thread sample information can use the script "HANA_Threads_ThreadSamples_FilterAndAggregation" from SAP Note 1969700. This script allows the administrator to select specific criteria such as time frame, thread status, application user, or passport action for targeted analysis.
The output from this script is typically a comprehensive table that can easily be exported to an Excel file. I often use pivot tables in Excel to condense and organize this data.
Additionally, creating a pivot chart can be extremely helpful for a visual representation and further analysis of the workload. For this part, please refer to SAP Note 3001300 - How to: Analyze HANA Issues Using Graphical Thread Sample Results for more information.
Understanding what can be gleaned from a workload pattern is crucial. In this section, I’ll illustrate this with two examples that closely mimic real-life analyses. These examples will shed light on the typical appearance of a workload pattern and the insights that can be derived from it. It's important to remember that there's no single, definitive format for a workload pattern. The most effective pattern is one that clearly explains the situation or pinpoints specific issues or concerns.
Example 1 - Analyze the Workload Pattern by Measuring the Contributor of No. of Running Threads
In this example, we've analyzed the workload distribution by capturing specific job information (or statement) and identifying the application users executing these jobs. The measurement was conducted by gathering thread activity from the SAP HANA platform over a designated period. We compiled the top 10 contributors, pairing application user names with their respective job names, and ranked them by the number of running threads they accounted for during this interval. The chart illustrates each user-job combination as a percentage of the total workload within that timeframe.
The number of running threads consumption could also be considered as the number of logical CPUs consumption.
So what can we read from this chart? Let me explain:
With this analysis, we now have a clearer picture of the areas that need further review in the next steps. Much clearer, right?
Example 2 - Workload Pattern Analysis with Aggregated Date Integration
The second example illustrates the workload distribution for top jobs across weekdays and weekends, segmented into daily percentages. This visualization enables us to analyze the workload distribution trends not only on a day-to-day basis but also across the broader spans of the entire week. Additionally, it facilitates a focused analysis comparing between different workdays or between different weekends.The data could be further refined to show hourly distributions or focused on peak business hours, depending on the specific requirements of the analysis. Such granularity can reveal patterns and inform decisions on resource allocation and system optimization tailored to the operational demands of the business.
What insights can the workload pattern provide us this time?
Understanding the nuances in workload distribution is vital for addressing system performance challenges, orchestrating resource allocation, and refining job scheduling to optimize the efficiency of the HANA platform.
The goal of analyzing workload patterns is not solely to evaluate the performance of individual SQL statements but to understand the broader impact a single statement can have on the system. A query might run for an extended period without consuming excessive CPU or memory and could, therefore, seem like a candidate for exclusion from workload analysis. However, this perspective can be misleading.
Long-running jobs can cause issues beyond resource consumption—such as database locks, garbage collection delays, savepoint contentions, or adverse effects on other user operations. In these scenarios, it becomes crucial to scrutinize the query in question for tuning opportunities. Identifying and optimizing such statements is essential to maintain overall system health and prevent disruptions to user activities.
Series on Workload Analysis for HANA Platform
This blog post is part of the 'Series on Workload Analysis for HANA Platform'. In upcoming posts, we will demonstrate how to analyze the issue related to CPU, threads and NUMA Node. Here's what you can look forward to in this series:
Stay tuned as we explore these aspects in detail, providing insights and strategies to optimize your HANA environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
34 | |
13 | |
11 | |
11 | |
10 | |
9 | |
9 | |
9 | |
8 | |
7 |