Solutions

Stay on top of everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Learn

Stay on top of everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Community

Stay on top of everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Company

Stay on top of everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

 
Knowledgebase:
Using perf to understand performance
27 April 2017 06:17 PM

Abstract

perf is a tool that can help analyze the performance of a process on Linux.

Discussion

Often, pstack is recommended as a way of understanding the behavior of MarkLogic Server. pstack works by pausing the MarkLogic process and printing out an execution stack trace; this effectively gives a point-in-time view of what the process is doing. When repeated over time, this gives a time-sliced view of the process.

Another tool for understanding performance is perf. perf works by sampling the process, rather than pausing it, and so is more lightweight than pstack, and it gives a statistical view of the process execution.

An typical use would be recording the activity for a minute or so when the CPU is high.

Installation

To install on RHEL/CentOS:

yum install perf

Use

To record and report the data (must be run as root/sudo):

cd /tmp

then

perf record -F 99 -ag -- sleep 60

This will take about one minute and write a file called perf.data in your working directory. Then, create a report as follows:

perf report --header -I --stdio > nodeX

This reads the perf.data and creates a readable report in the file nodeX, which can be submitted for analysis.  Please also run

  perf script > nodeX.script

and submit the nodeX.script file.  The file may be large but should compress well.

A quick way to find what calls are taking the most time is to run

perf top

See also

(3 vote(s))
Helpful
Not helpful

Comments (0)