61965: How to use perf for performance troubleshooting on Linux

use Google Translate

You are facing an issue with Acronis Backup Cloud - Agent for Linux, for example, a backup is running slow and you try to analyze the root cause. We recommend using the perf command line tool to troubleshoot a performance issue.

Follow these steps:

1. The "perf" utility should be shipped with the kernel (See details here http://www.brendangregg.com/perf.html). If you don't have it install it:

  • in RPM-based distributions with:
    # yum update && yum install perf     [CentOS / RHEL / Fedora]
    # dnf update && dnf install perf     [Fedora 23+ releases]
  • in Debian and derivatives:
    # sudo aptitude update && sudo aptitude install linux-tools-$(uname -r) linux-tools-generic
If uname -r in the command above returns extra strings besides the actual version (3.2.0-23-generic in my case), you may have to type linux-tools-3.2.0-23 instead of using the output of uname.

2. Start the affected operation. Wait about 1 hour and run the following command:
# perf record -F 99 -p SERVICE_PROCESS_PID
Replace service_process_PID with the process ID you want to monitor.

3. Wait 10-20 min and press Ctrl-C.

4. Cancel the operation from the Backup console.

5. Run perf report and check the output.

6. Make a screenshot of the output showing the most consuming function. 

Knowing that a particular function occupies the service_process will let us check the root cause further with Acronis support and development team.

Tags: