|
DTrace is a sophisticated framework for developing scripts that aid in troubleshooting performance issues on production systems in real-time. Cloud Analytics, which is available for free in the Joyent Public Cloud, is built off of DTrace. However, you can also use DTrace directly on systems you provision in the Joyent Public Cloud through dtracetools. In this topic: |
At a Glance
This topic shows you how to install the dtracetools package and use it to collect performance data.d |
About the dtracetools Package
The dtracetools package is available through the pkgsrc repository and includes several pre-defined DTrace scripts specifically tailored towards common use cases in the Joyent Public Cloud. The package is installed by default on all available images in the Joyent Public Cloud. All DTrace scripts this package installs are located in /opt/local/bin/ and are prefixed with dtrace-*.
The initial version of dtracetools first appeared in the 2011Q4 pkgsrc branch. You can install dtracetools from pkgsrc by running this:
Helpful DTrace Commands
Here are a few helpful DTrace commands you can use to uncover latency issues with MySQL, MongoDB, and PHP.
Viewing MongoDB Commands per Second
Use dtrace-mongocmd.d:
Viewing MySQL Queries Longer than One millisecond
Use dtrace-mysql_pid_slow.d:
Viewing MySQL Query Latency in a Distribution
Use dtrace-mysql_pid_latency.d:
Viewing MySQL Query Average Execution Time
Use dtrace-mysql_pid_avg.d:
Viewing PHP Function Call Counts
Use dtrace-php_funccalls.d:
Viewing PHP Function Flow
Use dtrace-php_flow.d: