nodetool tpstats

Prints usage statistics of thread pools.


The location of the cassandra.yaml file depends on the type of installation:
Package installations /etc/dse/cassandra/cassandra.yaml
Tarball installations installation_location/resources/cassandra/conf/cassandra.yaml

Prints usage statistics of thread pools. The DataStax Enterprise (DSE) database is based on a staged event-driven architecture (SEDA).

The database separates different tasks into stages connected by a messaging service. Each stage has a queue and a thread pool. Some stages skip the messaging service and queue tasks immediately on a different stage when it exists on the same node. The database can back up a queue if the next stage is too busy and lead to performance bottlenecks, as described in Monitoring a DataStax Enterprise cluster.

Reports are updated after SSTables change through compaction or flushing.

Report columns

The nodetool tpstats command report includes the following columns:
The number of Active threads.
The number of Pending requests waiting to be executed by this thread pool.
The number of tasks Completed by this thread pool.
The number of requests that are currently Blocked because the thread pool for the next step in the service is full.
All-Time Blocked
The total number of All-Time Blocked requests, which are all requests blocked in this thread pool up to now.

Report rows

The follow list describes the task or property associated with the task reported in the nodetool tpstats output.

General metrics

The following report aggregated statistics for tasks on the local node:
Completes background tasks like submitting hints and deserializing the row cache.
Running compaction.
Distributing node information via Gossip. Out of sync schemas can cause issues. You may have to sync using nodetool resetlocalschema.
Dispatches a single hints file to a specified node in a batched manner.
Responding to non-client initiated messages, including bootstrapping and schema checking.
Writing memtable contents to disk. May back up if the queue is overruns the disk I/O, or because of sorting processes.
Warning: nodetool tpstats no longer reports blocked threads in the MemtableFlushWriter pool. Check the Pending Flushes metric reported by nodetool tblestats.
Cleaning up after flushing the memtable (discarding commit logs and secondary indexes as needed).
Making unused memory available.
Calculating pending ranges per bootstraps and departed nodes. Reporting by this tool is not useful — see Developer notes.
Activity for the memtable flush writer of each disk.
Performing read repairs. Usually fast, if there is good connectivity between replicas. If Pending grows too large, attempt to lower the rate for high-read tables by altering the table to use a smaller read_repair_chance value, like 0.11.

Thread per core (TPC) task metrics

All actions in the TPC loop are labeled and therefore observable. Tasks marked Pendable are throttled, limited to the value set for tpc_concurrent_requests_limit in the cassandra.yaml (by default, 128). Thread per core messages are prepended with TPC/type, where:
  • TPC/N are metrics for the core number (when --cores is specified).
  • TPC/other are metrics for tasks executed that are not on TPC threads.
  • TPC/all are the aggregate task metrics for all cores.
Unknown task.
Asynchronous frame decoding.
Single-partition read request from a local node generated directly from clients.
Single-partition read request from a remote replica.
Signals read timeout errors.
Single-partition read request that will be first scheduled on an event loop (Pendable)
Single-partition read response.
Partition range read request from a local node generated directly from clients.
Partition range read request from a remote replica.
Partition range read originating from NodeSync.
Range reads to internal tables.
Partition range read response.
Switching thread to read from an iterator.
Switching thread to read from secondary index.
Waiting for data from disk.
Write request from a local node generated directly from clients.
Write request from a remote replica
Writes to internal tables.
Write response
Write issued to defragment data that required too many sstables to read (Pendable)
Switching thread to write in memtable when not already on the correct thread
Write request is waiting for the commit log segment to be allocated
Write request is waiting for commit log to sync to disk
Write request is waiting for space in memtable
Replaying a batch mutation
Store a batchlog entry request (Pendable)
Store a batchlog entry response
Remove a batchlog entry (Pendable)
Acquiring counter lock.
Executing a statement.
Executing compare-and-set (LWT).
Preparation phase of light-weight transaction (Pendable).
Proposal phase of light-weight transaction (Pendable).
Commit phase of light-weight transaction (Pendable).
Truncate request (Pendable).
NodeSync validation of a partition.
Authentication request.
Authorization request.
Unknown timed task.
Scheduled timeout task.
Number of busy spin cycles done by this TPC thread when it has no tasks to perform.
Number of Thread.yield() calls done by this TPC thread when it has no tasks to perform.
Number of LockSupport.park() calls done by this TPC thread when it has no tasks to perform.
Hint dispatch request (Pendable).
Hint dispatch response.
Scheduled network backpressure.

Droppable messages

The database generates the messages listed below, but discards them after a timeout. The nodetool tpstats command reports the number of messages of each type that have been dropped. You can view the messages themselves using a JMX client.

Message Type Stage Notes
BINARY n/a Deprecated
_TRACE n/a (special) Used for recording traces (nodetool settraceprobability) Has a special executor (1 thread, 1000 queue depth) that throws away messages on insertion instead of within the execute
MUTATION MutationStage If a write message is processed after its timeout (write_request_timeout_in_ms) it either sent a failure to the client or it met its requested consistency level and will relay on hinted handoff and read repairs to do the mutation if it succeeded.
COUNTER_MUTATION MutationStage If a write message is processed after its timeout (write_request_timeout_in_ms) it either sent a failure to the client or it met its requested consistency level and will relay on hinted handoff and read repairs to do the mutation if it succeeded.
READ_REPAIR MutationStage Times out after write_request_timeout_in_ms
READ ReadStage Times out after read_request_timeout_in_ms. No point in servicing reads after that point since it would of returned error to client
RANGE_SLICE ReadStage Times out after range_request_timeout_in_ms.
PAGED_RANGE ReadStage Times out after request_timeout_in_ms.
REQUEST_RESPONSE RequestResponseStage Times out after request_timeout_in_ms. Response was completed and sent back but not before the timeout


nodetool [connection_options] tpstats
[-C] [-F json | yaml]
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.


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 user name for authenticating with secure JMX.

Command arguments

-C, --cores
Include data for each core. The number of cores is determined by the tpc_cores.
-F, --format json | yaml
The format for the output. The default is plain text.


Run nodetool tpstats on the host labcluster

nodetool tpstats -C

Command output is:

                Pool Name                                   Active   Pending      Completed   Blocked  All time blocked
                ReadStage                                        0         0            361         0                 0
                ContinuousPagingStage                            0         0              0         0                 0
                MiscStage                                        0         0              0         0                 0
                CompactionExecutor                               0         0         110145         0                 0
                MutationStage                                    0         0            144         0                 0
                GossipStage                                      0         0              0         0                 0
                RequestResponseStage                             0         0              0         0                 0
                ReadRepairStage                                  0         0              0         0                 0
                CounterMutationStage                             0         0              0         0                 0
                MemtablePostFlush                                0         0            522         0                 0
                ValidationExecutor                               0         0              0         0                 0
                MemtableFlushWriter                              0         0            273         0                 0
                ViewMutationStage                                0         0              0         0                 0
                CacheCleanupExecutor                             0         0              0         0                 0
                MemtableReclaimMemory                            0         0            273         0                 0
                PendingRangeCalculator                           0         0              1         0                 0
                AntiCompactionExecutor                           0         0              0         0                 0
                SecondaryIndexManagement                         0         0              0         0                 0
                HintsDispatcher                                  0         0              0         0                 0
                Native-Transport-Requests                        0         0           2734         0                 0
                MigrationStage                                   0         0             33         0                 0
                PerDiskMemtableFlushWriter_0                     0         0            268         0                 0
                Sampler                                          0         0              0         0                 0
                InternalResponseStage                            0         0              0         0                 0
                AntiEntropyStage                                 0         0              0         0                 0
                Message type            Dropped               Latency waiting in queue (micros)
                                                              50%               95%               99%               Max
                READ                          0               N/A               N/A               N/A               N/A
                RANGE_SLICE                   0               N/A               N/A               N/A               N/A
                _TRACE                        0               N/A               N/A               N/A               N/A
                HINT                          0               N/A               N/A               N/A               N/A
                MUTATION                      0               N/A               N/A               N/A               N/A
                COUNTER_MUTATION              0               N/A               N/A               N/A               N/A
                BATCH_STORE                   0               N/A               N/A               N/A               N/A
                BATCH_REMOVE                  0               N/A               N/A               N/A               N/A
                REQUEST_RESPONSE              0               N/A               N/A               N/A               N/A
                PAGED_RANGE                   0               N/A               N/A               N/A               N/A
                READ_REPAIR                   0               N/A               N/A               N/A               N/A
                TRUNCATE                      0               N/A               N/A               N/A               N/A