rackerlabs / recap

A system status reporting tool
GNU General Public License v2.0
91 stars 55 forks source link

resources iotop only show processes #218

Closed mikegriffin closed 5 years ago

mikegriffin commented 5 years ago

It might be easier to read the resources file when iotop is enabled if we pass -P by default.

You can see the clutter on a server running a daemon with a lot of threads (eg mysqld), where -P will show only a single line for all threads of a process (consolidated)

tonyskapunk commented 5 years ago

Hi @mikegriffin, thanks for creating this. As you mention using -P will depict a "consolidated" view in the iotop report as it will report per process and not per threads. The difference would be exactly that just the amount of threads and their ID. But I can see how process ID has more value than the Thread ID.

Here a difference on output using the first one Process the other one the current default which is threads.

Process -P:

Total DISK READ: 75.69 K/s | Total DISK WRITE: 67.79 M/s
    TIME  PID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
17:33:26  2731 be/3 root        0.00 B/s   37.84 K/s  0.00 %  2.32 % [jbd2/sdb1-8]
17:33:26 22843 ?dif root       75.69 K/s   66.63 M/s  0.00 %  0.08 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:33:26  6615 be/4 root        0.00 B/s 1298.04 K/s  0.00 %  0.01 % mysqld --defaults-file=/var/lib/mysql3/my.cnf --basedir=/usr --datadir=/var/lib/mysql3/data --plugin-dir=/usr/lib64/mysql/plugin --user=root --log-error=/var/lib/mysql3/logs/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql3/data/mysql.pid --socket=/var/lib/mysql3/data/mysql.sock --port=3307

Threads:

Total DISK READ: 0.00 B/s | Total DISK WRITE: 131.75 M/s
    TIME  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
17:34:20  2731 be/3 root        0.00 B/s    0.00 B/s  0.00 %  3.38 % [jbd2/sdb1-8]
17:34:20 22894 be/0 root        0.00 B/s   30.28 M/s  0.00 %  0.70 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20 22891 be/4 root        0.00 B/s  284.70 K/s  0.00 %  0.64 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20 22895 be/0 root        0.00 B/s   30.69 M/s  0.00 %  0.63 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20 22896 be/0 root        0.00 B/s   31.02 M/s  0.00 %  0.59 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20 22890 be/4 root        0.00 B/s  356.82 K/s  0.00 %  0.56 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20 22892 be/4 root        0.00 B/s  318.86 K/s  0.00 %  0.52 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20 22889 be/4 root        0.00 B/s  159.43 K/s  0.00 %  0.46 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20 22893 be/0 root        0.00 B/s   18.30 M/s  0.00 %  0.40 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20 23137 be/4 root        0.00 B/s 1457.64 K/s  0.00 %  0.05 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20  1044 be/4 root        0.00 B/s   30.37 K/s  0.00 %  0.00 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20  1045 be/4 root        0.00 B/s   18.68 M/s  0.00 %  0.00 % mysqld --defaults-file=/var/lib/mysql/my.cnf --basedir=/var/lib/mysql --datadir=/var/lib/mysql/data --plugin-dir=/var/lib/mysql/lib/plugin --user=root --log-error=/var/lib/mysql/data/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql/data/mysql.pid --socket=/var/lib/mysql/data/mysql.sock --port=3309
17:34:20 23367 be/4 root        0.00 B/s   34.16 K/s  0.00 %  0.02 % mysqld --defaults-file=/var/lib/mysql2/my.cnf --basedir=/usr --datadir=/var/lib/mysql2/data --plugin-dir=/usr/lib64/mysql/plugin --user=root --log-error=/var/lib/mysql2/logs/mysqld.log --open-files-limit=65535 --pid-file=/var/lib/mysql2/data/mysql.pid --socket=/var/lib/mysql2/data/mysql.sock --port=3308

Above the main difference is the mysql instance running on port 3309 has multiple threads.

tonyskapunk commented 5 years ago

The change does not break any other distro so I'm including it in the next release.

Some examples: