nodetool toppartitions
Samples the activity in a table during the specified duration and reports the most active partitions.
For each sampler, nodetool toppartitions reports:
-
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.
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>
Syntax conventions | Description |
---|---|
UPPERCASE |
Literal keyword. |
Lowercase |
Not literal. |
<`Italics>` |
Variable value. Replace with a valid option or user-defined value. |
|
Optional.
Square brackets ( |
|
Group.
Parentheses ( |
|
Or.
A vertical bar ( |
|
Repeatable.
An ellipsis ( |
|
Single quotation ( |
|
Map collection.
Braces ( |
|
Set, list, map, or tuple.
Angle brackets ( |
|
End CQL statement.
A semicolon ( |
|
Separate the command line options from the command arguments with two hyphens ( |
|
Search CQL only: Single quotation marks ( |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrconfig files. |
Definition
The short- and long-form options 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 an 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