nodetool toppartitions

Samples database reads and writes and reports the most active partitions.

Samples the activity in a table during the specified duration and reports the most active partitions.

For each sampler, nodetool toppartitions reports:
  • Cardinality

    The number of unique operations in the sample set.

  • The n partitions

    The number of 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.

  • Partition
    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.
    Note: 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.

Synopsis

nodetool [connection_options] toppartitions
[-a reads | -a writes] [-k num_partitions] [-s size] [--]
keyspace_name table_name duration
Table 1. Legend
Syntax conventions Description
UPPERCASE Literal keyword.
Lowercase Not literal.
Italics Variable value. Replace with a valid option or user-defined value.
[ ] Optional. Square brackets ( [ ] ) surround optional command arguments. Do not type the square brackets.
( ) Group. Parentheses ( ( ) ) identify a group to choose from. Do not type the parentheses.
| Or. A vertical bar ( | ) separates alternative elements. Type any one of the elements. Do not type the vertical bar.
... Repeatable. An ellipsis ( ... ) indicates that you can repeat the syntax element as often as required.
'Literal string' Single quotation ( ' ) marks must surround literal strings in CQL statements. Use single quotation marks to preserve upper case.
{ key:value } Map collection. Braces ( { } ) enclose map collections or key value pairs. A colon separates the key and the value.
<datatype1,datatype2> Set, list, map, or tuple. Angle brackets ( < > ) enclose data types in a set, list, map, or tuple. Separate the data types with a comma.
cql_statement; End CQL statement. A semicolon ( ; ) terminates all CQL statements.
[ -- ] Separate the command line options from the command arguments with two hyphens ( -- ). This syntax is useful when arguments might be mistaken for command line options.
' <schema> ... </schema> ' Search CQL only: Single quotation marks ( ' ) surround an entire XML schema declaration.
@xml_entity='xml_entity_type' Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrconfig files.

Definition

The short form and long form parameters are comma-separated.

Connection options

-h, --host hostname
The hostname or IP address of a remote node or nodes. When omitted, the default is the local machine.
-p, --port jmx_port
The JMX port number.
-pw, --password jmxpassword
The JMX password for authenticating with secure JMX. If a password is not provided, you are prompted to enter one.
-pwf, --password-file jmx_password_filepath
The filepath to the file that stores JMX authentication credentials.
-u, --username jmx_username
The username for authenticating with secure JMX.

Command arguments

--
Separates an option from an argument that could be mistaken for a option.
-a samplers
Sampler to use. Available options are reads or writes.
duration
Duration in milliseconds.
-k num_partitions
Number of top partitions. Default is 10.
keyspace_name
The keyspace name.
-s size
Capacity of stream summary. A value closer to actual cardinality of partitions yields more accurate results. Default is 256.
table_name
The table name.

Examples

Sample the most active partitions for the cyclist_id table in the cycling keyspace for 1,000 milliseconds.

nodetool toppartitions cycling cyclist_id 1000

Results:

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

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

Sample the most active two partitions for writes in the cyclist_id table in the cycling keyspace for 1,000 milliseconds.

nodetool toppartitions -a writes -k 2 cycling cyclist_id 1000

Results:

Keyspace/table: cycling/cyclist_id
WRITES Sampler:
  Cardinality: ~2 (256 capacity)
  Top 2 partitions:
    Partition                Count       +/-
    4b504d39354f37353131        15        14
    3738313134394d353530        15        14