Amazon EMR
Developer Guide

Monitor Performance with Ganglia

This documentation is for AMI versions 2.x and 3.x of Amazon EMR. For information about Amazon EMR releases 4.0.0 and above, see the Amazon EMR Release Guide. For information about managing the Amazon EMR service in 4.x releases, see the Amazon EMR Management Guide.

The Ganglia open source project is a scalable, distributed system designed to monitor clusters and grids while minimizing the impact on their performance. When you enable Ganglia on your cluster, you can generate reports and view the performance of the cluster as a whole, as well as inspect the performance of individual node instances. For more information about the Ganglia open-source project, go to

Add Ganglia to a Cluster

To add Ganglia to a cluster using the console

  1. Open the Amazon EMR console at

  2. Choose Create cluster.

  3. Under the Additional Applications list, choose Ganglia and Configure and add.

  4. Proceed with creating the cluster with configurations as appropriate.

To add Ganglia to a cluster using the AWS CLI

In the AWS CLI, you can add Ganglia to a cluster by using create-cluster subcommand with the --applications parameter. This installs Ganglia using a bootstrap action, making the --bootstrap-action parameter unnecessary. If you specify only Ganglia using the --applications parameter, Ganglia is the only application installed.

  • Type the following command to add Ganglia when you create a cluster and replace myKey with the name of your EC2 key pair.

    • Linux, UNIX, and Mac OS X users:

      aws emr create-cluster --name "Test cluster" --ami-version 3.11.0 --applications Name=Hue Name=Ganglia Name=Hive Name=Pig \
      --use-default-roles --ec2-attributes KeyName=myKey \
      --instance-type m3.xlarge --instance-count 3 
    • Windows users:

      aws emr create-cluster --name "Test cluster" --ami-version 3.11.0 --applications Name=Hue Name=Ganglia Name=Hive Name=Pig --use-default-roles --ec2-attributes KeyName=myKey --instance-type m3.xlarge --instance-count 3 

    When you specify the instance count without using the --instance-groups parameter, a single master node is launched, and the remaining instances are launched as core nodes. All nodes use the instance type specified in the command.


    If you have not previously created the default EMR service role and EC2 instance profile, type aws emr create-default-roles to create them before typing the create-cluster subcommand.

    For more information about using Amazon EMR commands in the AWS CLI, see

View Ganglia Metrics

Ganglia provides a web-based user interface that you can use to view the metrics Ganglia collects. When you run Ganglia on Amazon EMR, the web interface runs on the master node and can be viewed using port forwarding, also known as creating an SSH tunnel. For more information about viewing web interfaces on Amazon EMR, see .

To view the Ganglia web interface

  1. Use SSH to tunnel into the master node and create a secure connection. For information about how to create an SSH tunnel to the master node, see Option 2, Part 1: Set Up an SSH Tunnel to the Master Node Using Dynamic Port Forwarding .

  2. Install a web browser with a proxy tool, such as the FoxyProxy plug-in for Firefox, to create a SOCKS proxy for domains of the type *ec2**. For more information, see Option 2, Part 2: Configure Proxy Settings to View Websites Hosted on the Master Node.

  3. With the proxy set and the SSH connection open, you can view the Ganglia UI by opening a browser window with http://master-public-dns-name/ganglia/, where master-public-dns-name is the public DNS address of the master server in the EMR cluster.

Ganglia Reports

When you open the Ganglia web reports in a browser, you see an overview of the cluster’s performance, with graphs detailing the load, memory usage, CPU utilization, and network traffic of the cluster. Below the cluster statistics are graphs for each individual server in the cluster. In the preceding cluster creation example, we launched three instances, so in the following reports there are three instance charts showing the cluster data.

Ganglia cluster report

The default graph for the node instances is Load, but you can use the Metric list to change the statistic displayed in the node-instance graphs.

Metric list

You can drill down into the full set of statistics for a given instance by selecting the node from the list or by choosing the corresponding node-instance chart.

Node list

This opens the Host Overview for the node.

Host overview

If you scroll down, you can view charts of the full range of statistics collected on the instance.

Instance statistics

Hadoop and Spark Metrics in Ganglia

Ganglia reports Hadoop metrics for each instance. The various types of metrics are prefixed by category: distributed file system (dfs.*), Java virtual machine (jvm.*), MapReduce (mapred.*), and remote procedure calls (rpc.*).

Ganglia metrics for Spark generally have prefixes for YARN application ID and Spark DAGScheduler. So prefixes follow this form:

  • DAGScheduler.*

  • application_xxxxxxxxxx_xxxx.driver.*

  • application_xxxxxxxxxx_xxxx.executor.*

You can view a complete list of these metrics by choosing the Gmetrics link, on the Host Overview page.