Use Intel® VTune™ Amplifier to profile native or Java* applications running in an LXC*, Docker, Mesos*, or Singularity* container on a Linux system.
VTune Amplifier automatically detects an application running in the container. No container configuration specific for performance analysis is required. But to run certain VTune Amplifier analysis types (Hotspots or Threading), make sure to run the container with the ptrace support enabled:
host> docker run --cap-add=SYS_PTRACE -td myimage
or launch the container in the privileged mode:
host> docker run --privileged -td myimage
Configure and Run an Analysis for a Container Target
Create a VTune Amplifier project on the host system.
From the WHERE pane of the Configure Analysis window, select the Local Host system to start analysis from your host Linux system or Remote Linux (SSH) to start analysis from a remote Linux system connected to your host system via SSH. For the remote Linux targets, make sure to configure SSH connection.
From the WHAT section, specify your analysis target. For container target analysis, the following target types are supported: Attach to Process and Profile System.
Configure your process or system target as usual using available configuration options.
In the Profile System mode, VTune Amplifier profiles all applications running in the same container or in different containers simultaneously. So, the standard limitation for the system-wide profiling of the managed code is not applicable to Java applications running in the containers.
You can attach the VTune Amplifier running under the superuser account to a Java process or a C/C++ application with embedded JVM instance running under a low-privileged user account. For example, you may attach the VTune Amplifier to Java based daemons or services.
The dynamic attach mechanism is supported only with the Java Development Kit (JDK).
From the HOW section, select an analysis and customize the analysis options, if required.
Click Start to launch the analysis.
Alternatively, you may configure and run any of these analyses using the VTune Amplifier command line interface (amplxe-cl). For example, to run a system-wide Hotspots analysis locally, enter:
host> amplxe-cl -collect hs -knob collector-type:hw-events -analyze-system -d 60
To run Hotspots analysis in the Attach to Process mode on a remote system, enter:
host> amplxe-cl -target-system=ssh:email@example.com -collect hs -knob collector-type:hw-events --target-process=java -d 60
The collected result opens in the default Hotspots viewpoint, where paths to container modules show up with prefixes (for instance, docker or lxc):