Rechercher dans le manuel MySQL

22.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 Mac OS X, 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 22.358 Command-line options for the ndb_top program

Format Description Added, Deprecated, or Removed

--color,

-c

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

All NDB 8.0 releases

--graph,

-g

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

All NDB 8.0 releases

--help,

-?

Show program usage information

All NDB 8.0 releases

--host[=name],

-h

Host name or IP address of MySQL Server to connect to

All NDB 8.0 releases

--measured-load,

-m

Show measured load by thread

All NDB 8.0 releases

--node-id[=#],

-n

Watch node having this node ID

All NDB 8.0 releases

--os-load,

-o

Show load measured by operating system

All NDB 8.0 releases

--passwd[=password],

-p

Connect using this password

All NDB 8.0 releases

REMOVED: NDB 7.6.4

--password[=password],

-p

Connect using this password

All NDB 8.0 releases

--port[=#],

-t (<=7.6.5),

-P (>=7.6.6)

Port number to use when connecting to MySQL Server

All NDB 8.0 releases

--sleep-time[=seconds],

-s

Time to wait between display refreshes, in seconds

All NDB 8.0 releases

--socket,

-S

Socket file to use for connection.

All NDB 8.0 releases

--sort,

-r

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

All NDB 8.0 releases

--text,

-x (<=7.6.5),

-t (>=7.6.6)

Display data using text

All NDB 8.0 releases

--user[=name],

-u

Connect as this MySQL user

All NDB 8.0 releases


In NDB 7.6.6 and later, ndb_top also supports the common NDB program options --defaults-file, --defaults-extra-file, --print-defaults, --no-defaults, and --defaults-group-suffix. (Bug #86614, Bug #26236298)

Additional Options

  • --color, -c

    Property Value
    Command-Line Format --color
    Type Boolean
    Default Value TRUE

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

  • --graph, -g

    Property Value
    Command-Line Format --graph
    Type Boolean
    Default Value TRUE

    Display data using graphs; use --skip-graphs to disable. This option or --text must be true; both options may be true.

  • --help, -?

    Property Value
    Command-Line Format --help
    Type Boolean
    Default Value TRUE

    Show program usage information.

  • --host[=name], -h

    Property Value
    Command-Line Format --host[=name]
    Type String
    Default Value localhost

    Host name or IP address of MySQL Server to connect to.

  • --measured-load, -m

    Property Value
    Command-Line Format --measured-load
    Type Boolean
    Default Value FALSE

    Show measured load by thread. This option or --os-load must be true; both options may be true.

  • --node-id[=#], -n

    Property Value
    Command-Line Format --node-id[=#]
    Type Integer
    Default Value 1

    Watch the data node having this node ID.

  • --os-load, -o

    Property Value
    Command-Line Format --os-load
    Type Boolean
    Default Value TRUE

    Show load measured by operating system. This option or --measured-load must be true; both options may be true.

  • --passwd[=password], -p

    Property Value
    Command-Line Format --passwd[=password]
    Type Boolean
    Default Value NULL

    Connect using this password.

    This option is deprecated in NDB 7.6.4. It is removed in NDB 7.6.6, where it is replaced by the --password option. (Bug #26907833)

  • --password[=password], -p

    Property Value
    Command-Line Format --password[=password]
    Type Boolean
    Default Value NULL

    Connect using this password.

    This option was added in NDB 7.6.6 as a replacement for the --passwd option used previously. (Bug #26907833)

  • --port[=#], -t (NDB 7.6.6 and later: -P)

    Property Value
    Command-Line Format --port[=#]
    Type Integer
    Default Value 3306

    Port number to use when connecting to MySQL Server.

    Beginning with NDB 7.6.6, the short form for this option is -P, and -t is repurposed as the short form for the --text option. (Bug #26907833)

  • --sleep-time[=seconds], -s

    Property Value
    Command-Line Format --sleep-time[=seconds]
    Type Integer
    Default Value 1

    Time to wait between display refreshes, in seconds.

  • --socket=path/to/file, -S

    Property Value
    Command-Line Format --socket
    Type Path name
    Default Value [none]

    Use the specified socket file for the connection.

    Added in NDB 7.6.6. (Bug #86614, Bug #26236298)

  • --sort, -r

    Property Value
    Command-Line Format --sort
    Type Boolean
    Default Value TRUE

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

  • --text, -x (NDB 7.6.6 and later: -t)

    Property Value
    Command-Line Format --text
    Type Boolean
    Default Value FALSE

    Display data using text. This option or --graph must be true; both options may be true.

    Beginning with NDB 7.6.6, the short form for this option is -t and support for -x is removed. (Bug #26907833)

  • --user[=name], -u

    Property Value
    Command-Line Format --user[=name]
    Type String
    Default Value root

    Connect as this MySQL user.

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 22.25 ndb_top Running in Terminal

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


Find a PHP function

Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-mysql-cluster-programs-ndb-top.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:en Manuel MySQL : https://dev.mysql.com/

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut