Monday, September 5, 2016

SAP HANA CPU

Home


1. SAP HANA CPU problems?

The administration overview screen or the load graph of SAP HANA Studio shows a high current or historic CPU consumption.

Alert Name SAP Note Description
5 Host CPU Usage 1909670 Determines the percentage CPU idle time on the host and therefore whether or not CPU resources are running low.




SQL: "HANA_Configuration_MiniChecks" (SAP Notes 1969700, 1999993) returns a potentially critical issue (C = 'X') for one of the following individual checks:
Check ID Details
210 Minimum CPU rate (MHz)
211 Hosts with varying CPU rates
220 Current CPU utilization (%)
221 Peak CPU utilization (%, last day)
222 Time since CPU utilization > 95 % (h)
226 Peak system CPU utilization (%, last day)



2. High CPU consumption generally an issue?

A high CPU consumption can be normal and acceptable, because SAP HANA uses available CPUs efficiently by parallelizing complex operations. 
Therefore, a high CPU consumption can be intended and a consequence of a massively parallelized processing of complex operations. 
If on the other hand simple database requests or other processes consume a high amount of CPU, this can result in a critical CPU bottleneck 
situation which can be avoided. 

3. How to collect information about the CPU consumption?

The following options exist to check the current CPU utilization of the SAP HANA database server:

SAP HANA Studio -> Administration -> Overview -> CPU Usage
SAP HANA Studio -> Administration -> Performance -> Load -> [System] CPU

4. How to additional CPU resource tracking be activated?

As of SAP HANA SPS 12 a CPU approximation based on the states of active threads is used. 
When an active thread doesn't have to wait (e.g. for locks, I/O or network), it is supposed to consume CPU. 
See SAP Note 2114710 for more information related to SAP HANA threads. As a consequence, you always have CPU figures available without 
having to activate specific measurements. Indeed, there is no other way to activate CPU time measurement mode with SAP HANA SPS 12 and higher.

With SAP HANA SPS <= 11 CPU consumption isn't measured per default, but you can activate CPU time measurement with the following parameters:

Parameter  Default Activation via Description
global.ini -> [resource_tracking] -> enable_tracking  off on General activation of resource tracking functionality
global.ini -> [resource_tracking] -> cpu_time_measurement_mode  off fast (SPS 08 and below)
on (SPS 09 - 11)
Activation of CPU specific data collection

Be aware that the activation of the CPU time measurement can be expensive in terms of system CPU consumption and performance, so you should pay attention for these side-effects and deactivate the time measurement if required.

The following monitor view columns contain CPU information:

M_SERVICE_THREADS.CPU_TIME_SELF
M_SERVICE_THREADS.CPU_TIME_CUMULATIVE
M_EXPENSIVE_STATEMENTS.CPU_TIME



5. Difference between system, user and I/O wait CPU consumption?

CPU utilization is typically separated in system CPU, user CPU and I/O wait CPU consumption:

CPU utilization type Description
User CPU consumption originating from coding outside of the operating system kernel, e.g.:
Expensive operation in SAP HANA like scan of large table or counting a high amount of distinct values
Expensive operation of non-SAP HANA product running on same host
System CPU consumption originating from the operating system kernel, e.g.:
Operating system background activities like memory defragmentation
Implicit OS calls of SAP HANA like active waits for locks or I/O requests
I/O Wait CPUs waiting for I/O requests to complete, can usually be considered as idle time




1 comment: