MySQL 8.0 Reference Manual Including MySQL NDB Cluster 8.0

23.4.29 ndb_top — View CPU usage information for NDB threads

ndb_top displays running information in the terminal about CPU usage by NDB threads on an NDB Cluster data node. Each thread is represented by two rows in the output, the first showing system statistics, the second showing the measured statistics for the thread.

ndb_top is available beginning with MySQL NDB Cluster 7.6.3.

Usage

ndb_top [-h hostname] [-t port] [-u user] [-p pass] [-n node_id]

ndb_top connects to a MySQL Server running as an SQL node of the cluster. By default, it attempts to connect to a mysqld running on localhost and port 3306, as the MySQL root user with no password specified. You can override the default host and port using, respectively, --host (-h) and --port (-t). To specify a MySQL user and password, use the --user (-u) and --passwd (-p) options. This user must be able to read tables in the ndbinfo database (ndb_top uses information from ndbinfo.cpustat and related tables).

For more information about MySQL user accounts and passwords, see Section 6.2, “Access Control and Account Management”.

Output is available as plain text or an ASCII graph; you can specify this using the --text (-x) and --graph (-g) options, respectively. These two display modes provide the same information; they can be used concurrently. At least one display mode must be in use.

Color display of the graph is supported and enabled by default (--color or -c option). With color support enabled, the graph display shows OS user time in blue, OS system time in green, and idle time as blank. For measured load, blue is used for execution time, yellow for send time, red for time spent in send buffer full waits, and blank spaces for idle time. The percentage shown in the graph display is the sum of percentages for all threads which are not idle. Colors are not currently configurable; you can use grayscale instead by using --skip-color.

The sorted view (--sort, -r) is based on the maximum of the measured load and the load reported by the OS. Display of these can be enabled and disabled using the --measured-load (-m) and --os-load (-o) options. Display of at least one of these loads must be enabled.

The program tries to obtain statistics from a data node having the node ID given by the --node-id (-n) option; if unspecified, this is 1. ndb_top cannot provide information about other types of nodes.

The view adjusts itself to the height and width of the terminal window; the minimum supported width is 76 characters.

Once started, ndb_top runs continuously until forced to exit; you can quit the program using Ctrl-C. The display updates once per second; to set a different delay interval, use --sleep-time (-s).

Note

ndb_top is available on macOS, Linux, and Solaris. It is not currently supported on Windows platforms.

The following table includes all options that are specific to the NDB Cluster program ndb_top. Additional descriptions follow the table.

Table 23.49 Command-line options used with the program ndb_top

Format Description Added, Deprecated, or Removed

--color,

-c

Show ASCII graphs in color; use --skip-colors to disable

(Supported in all NDB releases based on MySQL 8.0)

--graph,

-g

Display data using graphs; use --skip-graphs to disable

(Supported in all NDB releases based on MySQL 8.0)

--help,

-?

Show program usage information

(Supported in all NDB releases based on MySQL 8.0)

--host[=name],

-h

Host name or IP address of MySQL Server to connect to

(Supported in all NDB releases based on MySQL 8.0)

--measured-load,

-m

Show measured load by thread

(Supported in all NDB releases based on MySQL 8.0)

--node-id[=#],

-n

Watch node having this node ID

(Supported in all NDB releases based on MySQL 8.0)

--os-load,

-o

Show load measured by operating system

(Supported in all NDB releases based on MySQL 8.0)

--password[=password],

-p

Connect using this password

(Supported in all NDB releases based on MySQL 8.0)

--port[=#],

-P (>=7.6.6)

Port number to use when connecting to MySQL Server

(Supported in all NDB releases based on MySQL 8.0)

--sleep-time[=seconds],

-s

Time to wait between display refreshes, in seconds

(Supported in all NDB releases based on MySQL 8.0)

--socket,

-S

Socket file to use for connection

(Supported in all NDB releases based on MySQL 8.0)

--sort,

-r

Sort threads by usage; use --skip-sort to disable

(Supported in all NDB releases based on MySQL 8.0)

--text,

-t (>=7.6.6)

Display data using text

(Supported in all NDB releases based on MySQL 8.0)

--user[=name],

-u

Connect as this MySQL user

(Supported in all NDB releases based on MySQL 8.0)


Additional Options

Sample Output.  The next figure shows ndb_top running in a terminal window on a Linux system with an ndbmtd data node under a moderate load. Here, the program has been invoked using ndb_top -n8 -x to provide both text and graph output:

Figure 23.26 ndb_top Running in Terminal

Display from ndb_top, running in a terminal window. Shows information for each node, including the utilized resources.

Beginning with NDB 8.0.20, ndb_top also shows spin times for threads, displayed in green.