kernel profiler trace HANA

How to Generate Kernel Profiler trace in HANA

If You are experiencing high memory consumption / out of memory situations . SAP is asking you to provide a Kernel Profiler Trace.

This blog with help you to generate kernel profiler trace in HANA database.

  • start a kernel profiler trace on OS level by running the following command as HANA sidadm

>hdbcons -p <pid_of_the_problematic_tenant_indexserver>

>profiler clear

>profiler start

{wait for 4-5min}

>profiler stop

>profiler print -o profiler_cpu.dot,profiler_wait.dot

 

This will basically create a kernel profiler trace and a HANA runtime dump. The tracefiles will be stored in the HANA tracedirectory.

 

SAMPLE Run – How to generate kernel profiler trace in HANA.

Below example will explain actual run to generate kernel profile trace:

To get <pid_of_the_problematic_tenant_indexserver>: In my case 219109 is the pid of  problematic tenant .

**************************************************************************************************************************
smhadm 219109 218797 7.6 14069424 10366640 \_ hdbindexserver -port 31003

****************************************************************************************************************************

 

<HOSTNAME> :/usr/sap/<SID>/SYS/global/sapcontrol/snapshots> hdbcons -p 219109
SAP HANA DB Management Client Console (type ‘\?’ to get help for client commands)
Try to open connection to server process with PID 219109
SAP HANA DB Management Server Console (type ‘help’ to get help for server commands)
Executable: hdbindexserver (PID: 219109)
[OK]

> profiler clear
## Start command at: 2019-07-22 16:45:58.364
No data to be cleared.
[OK]
## Finish command at: 2019-07-22 16:45:58.370 command took: 63.000 usec

> profiler start
## Start command at: 2019-07-22 16:46:06.689
Wait Time: 1ms
[OK]
## Finish command at: 2019-07-22 16:46:07.059 command took: 370.528 msec

> profiler stop
## Start command at: 2019-07-22 16:46:20.691
[OK]
## Finish command at: 2019-07-22 16:46:20.701 command took: 10.020 msec

> profiler print -o profiler_cpu.dot,profiler_wait.dot
## Start command at: 2019-07-22 16:46:42.893
Minimum percentage for respecting a node: 1%
Minimum percentage (of heaviest edge) for respecting an edge: 1%
[WARNING] There were 49 sample runs with too low wait time (total delay: 0s). This might reduce the quality of profiling.
831 samples
315 different samples
561008B currently in profiler allocator
561008B currently in profiler allocator
[WARNING] Profiler has no timeline data stored.
898928B currently in profiler allocator
Finished printing graph.
Samples are still in memory. Use ‘profiler clear’ to free this memory.

‘dot -Tpdf -o <pdffile> profiler_cpu.dot’ to generate a PDF file
‘dot -Tgif -o <giffile> profiler_cpu.dot’ to generate a picture

‘dot -Tpdf -o <pdffile> profiler_wait.dot’ to generate a PDF file
‘dot -Tgif -o <giffile> profiler_wait.dot’ to generate a picture
[OK]
## Finish command at: 2019-07-22 16:46:44.582 command took: 1.689 sec

Output files in trace directory:

-rw-r–r– 1 smhadm sapsys 105435 Jul 22 16:46 profiler_cpu.dot
-rw-r–r– 1 smhadm sapsys 74972 Jul 22 16:46 profiler_wait.dot

Leave a Reply

Your email address will not be published. Required fields are marked *