#author("2025-02-18T03:23:48+00:00","default:sysosa","sysosa") Topコマンドあれこれ windowsのタスクマネージャと同等な情報を得るには? &ref(2013y07m09d_000838265.png,nolink); ***top [#d18643a6] プロセスの負荷状況とか経過時間が見られる。あとswapとか実メモリの使用量など #code{{ top - 16:52:54 up 16 min, 1 user, load average: 0.02, 0.03, 0.02 Tasks: 96 total, 1 running, 95 sleeping, 0 stopped, 0 zombie Cpu0 : 0.2%us, 0.1%sy, 0.0%ni, 99.5%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st Cpu1 : 0.1%us, 0.1%sy, 0.0%ni, 99.6%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st Cpu2 : 0.1%us, 0.1%sy, 0.0%ni, 99.5%id, 0.4%wa, 0.0%hi, 0.0%si, 0.0%st Cpu3 : 0.2%us, 0.1%sy, 0.0%ni, 99.4%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 16360912k total, 371368k used, 15989544k free, 22992k buffers Swap: 16777212k total, 0k used, 16777212k free, 237832k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1781 root 20 0 15072 1204 912 R 2.8 0.0 0:00.01 top 1 root 20 0 19276 1508 1224 S 0.0 0.0 0:00.36 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H 7 root RT 0 0 0 0 S 0.0 0.0 0:00.01 migration/0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 9 root 20 0 0 0 0 S 0.0 0.0 0:00.06 rcu_sched }} ***nvtop [#wf9489f2] #code(nonumber){{ dnf install nvtop }} GPUカード毎に稼働率、GPUメモリ使用率が表示される ***cpupowerutils [#c415bd31] haswell cpuのc6/c7の状況を示します。 #code(nonumber){{ [root@s ~]# yum install cpupowerutils [root@s ~]# turbostat cor CPU %c0 GHz TSC SMI %c1 %c3 %c6 %c7 CTMP PTMP %pc2 %pc3 %pc6 %pc7 Pkg_W Cor_W GFX_W 0.03 0.80 3.49 0 0.07 0.01 0.00 99.89 24 25 99.66 0.00 0.00 0.00 5.44 0.00 0.00 0 0 0.10 0.80 3.49 0 0.09 0.01 0.00 99.80 23 25 99.66 0.00 0.00 0.00 5.44 0.00 0.00 0 4 0.02 0.80 3.49 0 0.16 1 1 0.04 0.80 3.49 0 0.04 0.01 0.00 99.92 23 1 5 0.01 0.80 3.49 0 0.07 2 2 0.02 0.80 3.49 0 0.04 0.00 0.00 99.94 24 2 6 0.02 0.80 3.49 0 0.04 3 3 0.04 0.80 3.49 0 0.05 0.00 0.01 99.91 19 3 7 0.03 0.80 3.49 0 0.06 [root@s ~]# }} ***i7z [#re8476a9] #code(nonumber){{ [root@s ~]# cd /opt/src/ [root@s src]# git clone git://github.com/ajaiantilal/i7z.git Initialized empty Git repository in /opt/src/i7z/.git/ remote: Reusing existing pack: 589, done. remote: Total 589 (delta 0), reused 0 (delta 0) Receiving objects: 100% (589/589), 1.41 MiB | 272 KiB/s, done. Resolving deltas: 100% (350/350), done. [root@s src]# [root@s src]# cd i7z/ [root@s i7z]# ls -CF COPYING README.txt i7z.h i7z_rw_registers.rb GUI/ cpuinfo.c i7z_32bit* perfmon-i7z/ MAKEDEV-cpuid-msr doc/ i7z_64bit* put_cores_offline.sh Makefile helper_functions.c i7z_Dual_Socket.c put_cores_online.sh README.md i7z.c i7z_Single_Socket.c test-scripts/ [root@s i7z]# ./i7z_64bit Cpu speed from cpuinfo 3491.00Mhz cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc Linux's inbuilt cpu_khz code emulated now True Frequency (without accounting Turbo) 3491 MHz CPU Multiplier 35x || Bus clock frequency (BCLK) 99.74 MHz Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4] TURBO ENABLED on 4 Cores, Hyper Threading ON True Frequency 3590.74 MHz (99.74 x [36]) Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is 39x/39x/38x/37x Current Frequency 798.30 MHz [99.74 x 8.00] (Max of below) Core [core-id] :Actual Freq (Mult.) C0% Halt(C1)% C3 % C6 % Temp Core 1 [0]: 798.30 (8.00x) 1 99 1 0 24 Core 2 [1]: 785.65 (7.88x) 1 100 0 0 23 Core 3 [2]: 797.92 (8.00x) 1 100 0 0 25 Core 4 [3]: 797.86 (8.00x) 1 100 0 0 21 C0 = Processor running without halting C1 = Processor running with halts (States >C0 are power saver) C3 = Cores running with PLL turned off and core cache turned off C6 = Everything in C3 + core state saved to last level cache Above values in table are in percentage over the last 1 sec [core-id] refers to core-id number in /proc/cpuinfo [root@s i7z]# }} ***iftop [#ja014674] yum --enablerepo=epel install iftop インターフェイスのtopコマンド どのサイトからどんだけのスピード(bps)でどの方向でデータが転送されているかを示す。 #code{{ 12.5kb 25.0kb 37.5kb 50.0kb 62.5kb ------------------------------------------------------------------------------------------- c8.chaperone.jp => c.chaperone.jp 1.66kb 2.48kb 2.48kb <= 416b 675b 675b }} ***iotop [#i7f8aef2] ディスクへの書き込み・読み込みを図るみたい。 #code{{ Total DISK READ: 149.17 K/s | Total DISK WRITE: 39.25 K/s TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND 13824 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % as -Qy --64 -o security/keys/.tmp_request_key.o - 1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init 2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd] }} 下記はpt2を使っていた時 #code{{ Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND 1387 be/4 root 0.00 B/s 1615.11 K/s 0.00 % 0.00 % recpt1 (中略) /video/6ch.ts 1390 be/4 root 0.00 B/s 1827.32 K/s 0.00 % 0.00 % recpt1 (中略) /video/1ch.ts 1395 be/4 root 0.00 B/s 1839.11 K/s 0.00 % 0.00 % recpt1 (中略) /video/4ch.ts 1398 be/4 root 0.00 B/s 1650.48 K/s 0.00 % 0.00 % recpt1 (中略) /video/5ch.ts 1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init }} ***virt-top [#s919c0c7] yum --enablerepo=epel install virt-top #code{{ virt-top 19:15:25 - x86_64 4/4CPU 1197MHz 15977MB 1 domains, 1 active, 1 running, 0 sleeping, 0 paused, 0 inactive D:0 O:0 X:0 CPU: 5.6% Mem: 4096 MB (ゲストによる 4096 MB) ID S RDRQ WRRQ RXBY TXBY %CPU %MEM TIME NAME 7 R 0 0 2M 55K 5.6 25.0 0:23.91 c }} ***powertop [#i531a58d] yum install powertop #code{{ PowerTOP version 1.11 (C) 2007 Intel Corporation Cステイト 平均滞在時間 Pステイト (周波数) C0 (CPU動作状態) ( 0.0%) ポーリング C1 mwait 0.0ms ( 0.0%) C1 mwait 0.0ms ( 0.0%) C2 mwait 0.9ms ( 0.1%) C3 mwait 152.6ms (100.0%) }} ***atop [#iaa73f13] topの詳細版な感じ? #code{{ ATOP - c8 2013/07/07 17:06:08 --------- 30m12s elapsed PRC | sys 3.41s | user 0.63s | #proc 104 | #zombie 0 | #exit 0 | CPU | sys 2% | user 20% | irq 0% | idle 376% | wait 1% | cpu | sys 1% | user 5% | irq 0% | idle 94% | cpu003 w 0% | cpu | sys 1% | user 5% | irq 0% | idle 94% | cpu001 w 0% | cpu | sys 1% | user 5% | irq 0% | idle 94% | cpu000 w 0% | cpu | sys 1% | user 5% | irq 0% | idle 94% | cpu002 w 0% | CPL | avg1 0.18 | avg5 0.50 | avg15 0.42 | csw 615249 | intr 618109 | MEM | tot 15.6G | free 14.7G | cache 682.6M | buff 59.9M | slab 61.4M | SWP | tot 16.0G | free 16.0G | | vmcom 150.7M | vmlim 23.8G | DSK | sda | busy 2% | read 24136 | write 5034 | avio 1.52 ms | DSK | sdc | busy 0% | read 347 | write 0 | avio 2.78 ms | DSK | sdb | busy 0% | read 363 | write 0 | avio 1.29 ms | DSK | sdd | busy 0% | read 363 | write 0 | avio 1.06 ms | NET | transport | tcpi 5236 | tcpo 4703 | udpi 165 | udpo 165 | NET | network | ipi 5434 | ipo 4877 | ipfrw 0 | deliv 5434 | NET | eth0 0% | pcki 9053 | pcko 4903 | si 33 Kbps | so 2 Kbps | *** system and process activity since boot *** PID THR SYSCPU USRCPU VGROW RGROW RDDSK WRDSK ST EXC S CPUNR CPU CMD 1/7 9 1 0.57s 0.00s 0K 0K 0K 0K N- - S 0 0% rcu_sched 38 1 0.38s 0.00s 0K 0K 0K 0K N- - S 1 0% kworker/1:1 1 1 0.34s 0.03s 19276K 1508K 51049K 136K N- - S 0 0% init 1182 1 0.37s 0.00s 0K 0K 0K 0K N- - S 0 0% kworker/0:2 }} ***ftop [#v96048c2] プロセスとファイルとの関係図を表示 yum --enablerepo=epel install ftop #code{{ Sun Jul 7 17:07:49 2013 ftop 1.0 Processes: 34 total, 0 unreadable Press h for help, o for options Open Files: 17 regular, 4 dir, 117 chr, 0 blk, 19 pipe, 99 sock, 15 misc _ PID #FD USER COMMAND -- 360 10 root /sbin/udevd -d | +- 3 -rw -- 389/389 /dev/.udev/queue.bin -- 1422 7 root auditd | +- 5 --W -- 409174/409174 /var/log/audit/audit.log -- 1438 4 root /sbin/rsyslogd -i /var/run/syslogd.pid -c 5 | +- out --W -- 21114/21114 /var/log/secure | +- 3 -r- -- 0/0 /proc/kmsg | +- 4 --W -- 545551/545551 /var/log/messages -- 1533 10 rpcuser rpc.statd | +- 6 --w -- 5/5 /var/run/rpc.statd.pid -- 1709 7 root /usr/sbin/xrdp-sesman | +- 3 --W -- 673/673 /var/log/xrdp-sesman.log -- 1771 10 root /usr/sbin/packagekitd | +- 9 -rw -- 8192/8192 /var/lib/PackageKit/transactions.db }}