nodetool toppartitions

Samples database reads and writes and reports the most active partitions in a specified table.

Synopsis

nodetool [ options ] toppartitions
    [ -a samplers ] [ -k topcount ] [ -s size ] [ -- ]
    keyspace table duration

Tarball and Installer No-Services path:

<installation_location>/resources/cassandra/bin
Options
Short Long Description

-h

--host

Hostname or IP address.

-p

--port

Port number.

-pwf

--password-file

Password file path.

-pw

--password

Password.

-u

--username

Remote JMX agent username.

-a samplers

Comma separated list of samplers to use (default: all)

-k topCount

The number of the top partitions to list (default: 10)

-s size

The capacity of stream summary. A value closer to the actual cardinality of partitions yields more accurate results. (default: 256)

keyspace

Name of keyspace.

table

Name of table.

duration

The duration in milliseconds

--

Separates an option from an argument that could be mistaken for an option.

Description

The nodetool toppartitions command samples the activity in a table during the specified duration and prints lists of the most active partitions during that time period. To run this command you must specify the keyspace and table to focus on and the time interval (in milliseconds) during which DataStax Enterprise samples the table’s activity.

Examples

Sample the most active partitions for the table test.users for 1,000 milliseconds

nodetool toppartitions test users 1000

The output of nodetool toppartitions is similar to the following:

WRITES Sampler:
  Cardinality: ~2 (256 capacity)
  Top 4 partitions:
	Partition                Count       +/-
	4b504d39354f37353131        15        14
	3738313134394d353530        15        14
	4f363735324e324e4d30        15        14
	303535324e4b4d504c30        15        14

READS Sampler:
  Cardinality: ~3 (256 capacity)
  Top 4 partitions:
	Partition                Count       +/-
       4d4e30314f374e313730        42        41
	4f363735324e324e4d30        42        41
	303535324e4b4d504c30        42        41
	4e355030324e344d3030        41        40

For each of the samplers used (WRITES and READS in the example), toppartitions reports:

  • The cardinality of the sampled operations (that is, the number of unique operations in the sample set)

  • The n partitions in the specified table that had the most traffic in the specified time period (where n is the value of the -k argument, or ten if -k is not explicitly set in the command).

    For each Partition, toppartitions reports:

    Partition

    The partition key

    Count

    The number of operations of the specified type that occurred during the specified time period.

    +/-

    The margin of error for the Count statistic

    To keep the toppartitions reporting from slowing performance, the database does not keep an exact count of operations, but uses sampling techniques to create an approximate number. (This example reports on a sample cluster; a production system might generate millions of reads or writes in a few seconds.) The +/- figure allows you to judge the accuracy of the toppartitions reporting.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com