記事ディレクトリ
システムパフォーマンスの監視 (2)
メモリー
メモリ使用量を参照
[root@xiaoyang ~] free -h
total used free shared buff/cache available
Mem: 3.7G 240M 2.8G 11M 705M 3.2G
Swap: 2.0G 0B 2.0G
[root@xiaoyang ~]#
Mem 物理メモリ
スワップ スワップ パーティション
合計 = 使用済み+フリー+共有+バフ/キャッシュ
バッファ: メモリ内のゼロ時点でデータが格納される場所 メモリからディスクへのデータ -> 書き込み操作
キャッシュ: メモリ内には、ディスクからメモリへのゼロタイムデータ -> 読み取り操作時にデータが保存される場所です。
利用可能: 空き空き領域 + 次のプロセスに提供できるバフ/キャッシュの空き領域
スワップ 物理メモリが不足した場合、ディスクから転送されます
これはスワップ パーティションです。ディスクから領域の一部を取り出してメモリとして使用します。過去には暗黙のルールがありました。スワップ パーティションは物理メモリの 2 倍に設定することをお勧めします。
[root@xiaoyang ~] cat /proc/sys/vm/swappiness
30
[root@xiaoyang ~]#
仮想メモリ 仮想メモリ = 物理メモリ + スワップ パーティション
swappiness 物理メモリが 30% しか残っていない場合にスワップ パーティションを使用する
交換性
ゼロタイムでの変更
[root@xiaoyang ~] cat /proc/sys/vm/swappiness
30
[root@xiaoyang ~] echo 0 >/proc/sys/vm/swappiness 当物理内存只剩下0的时候就使用交换分区
[root@xiaoyang ~] cat /proc/sys/vm/swappiness
0
[root@xiaoyang ~]#
永久的な変更
[root@xiaoyang ~] vim /etc/sysctl.conf
[root@xiaoyang ~] cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
vm.swappiness=0
[root@xiaoyang ~] sysctl -p
vm.swappiness = 0
[root@xiaoyang ~]#
メモリ情報を参照
cat /proc/meminfo
それをクリアし、バッファ/キャッシュキャッシュ
3はうまくいきます
キャッシュを空にしてください:
[root@xiaoyang ~] sync ; echo 3 >/proc/sys/vm/drop_caches
[root@xiaoyang ~] free -h
total used free shared buff/cache available
Mem: 3.7G 231M 3.4G 11M 52M 3.3G
Swap: 2.0G 0B 2.0G
[root@xiaoyang ~]#
上記の動作ではキャッシュ内のデータがクリアされますが、これは危険であり、データ損失につながります。
dstat、ページイン/ページアウトを確認できます
[root@xiaoyang ~] dstat
You did not select any stats, using -cdngy by default.
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read writ| recv send| in out | int csw
0 0 100 0 0 0| 13k 1497B| 0 0 | 0 0 | 59 104
0 0 100 0 0 0| 0 0 | 60B 818B| 0 0 | 60 97
0 1 100 0 0 0| 0 0 | 60B 338B| 0 0 | 53 83
0 0 100 0 0 0| 0 0 | 120B 398B| 0 0 | 54 87
system の int は割り込みの数です
cswはコンテキストスイッチです
dstat -ma は多くの情報を表示できます
ディスク、CPU などを参照してください。
[root@xiaoyang ~] dstat -ma
------memory-usage----- ----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
used buff cach free|usr sys idl wai hiq siq| read writ| recv send| in out | int csw
252M 0 45.9M 3473M| 0 0 100 0 0 0| 13k 1481B| 0 0 | 0 0 | 59 103
252M 0 45.9M 3473M| 0 0 100 0 0 0| 0 0 | 60B 1034B| 0 0 | 59 96
252M 0 45.9M 3473M| 0 0 100 0 0 0| 0 0 | 60B 418B| 0 0 | 55 91
252M 0 45.9M 3473M| 0 0 100 0 0 0| 0 0 | 60B 418B| 0 0 | 72 105
252M 0 45.9M 3473M| 0 0 100 0 0 0| 0 0 | 60B 418B| 0 0 | 68 97
CPU とメモリを最も多く消費する上位 10 のプロセスを見つける
メソッドは 2 つあり、1 つはトップ ---> P(cpu)
M —-> (記憶)
2 番目のタイプ:
ps aux|詳細
[root@xiaoyang ~]# ps aux|more
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 125384 3896 ? Ss 16:44 0:01 /usr/lib/systemd/systemd --switched-root --system --deserialize
22
root 2 0.0 0.0 0 0 ? S 16:44 0:00 [kthreadd]
root 4 0.0 0.0 0 0 ? S< 16:44 0:00 [kworker/0:0H]
root 5 0.0 0.0 0 0 ? S 16:44 0:00 [kworker/u256:0]
root 6 0.0 0.0 0 0 ? S 16:44 0:00 [ksoftirqd/0]
root 7 0.0 0.0 0 0 ? S 16:44 0:00 [migration/0]
root 8 0.0 0.0 0 0 ? S 16:44 0:00 [rcu_bh]
root 9 0.0 0.0 0 0 ? S 16:44 0:00 [rcu_sched]
root 10 0.0 0.0 0 0 ? S< 16:44 0:00 [lru-add-drain]
root 11 0.0 0.0 0 0 ? S 16:44 0:00 [watchdog/0]
root 12 0.0 0.0 0 0 ? S 16:44 0:00 [watchdog/1]
root 13 0.0 0.0 0 0 ? S 16:44 0:00 [migration/1]
root 14 0.0 0.0 0 0 ? S 16:44 0:00 [ksoftirqd/1]
root 16 0.0 0.0 0 0 ? S< 16:44 0:00 [kworker/1:0H]
root 18 0.0 0.0 0 0 ? S 16:44 0:00 [kdevtmpfs]
root 19 0.0 0.0 0 0 ? S< 16:44 0:00 [netns]
root 20 0.0 0.0 0 0 ? S 16:44 0:00 [khungtaskd]
root 21 0.0 0.0 0 0 ? S< 16:44 0:00 [writeback]
root 22 0.0 0.0 0 0 ? S< 16:44 0:00 [kintegrityd]
root 23 0.0 0.0 0 0 ? S< 16:44 0:00 [bioset]
root 24 0.0 0.0 0 0 ? S< 16:44 0:00 [bioset]
root 25 0.0 0.0 0 0 ? S< 16:44 0:00 [bioset]
root 26 0.0 0.0 0 0 ? S< 16:44 0:00 [kblockd]
root 27 0.0 0.0 0 0 ? S< 16:44 0:00 [md]
root 28 0.0 0.0 0 0 ? S< 16:44 0:00 [edac-poller]
[root@xiaoyang ~]#
[root@xiaoyang ~] ps aux|tail -n +2|sort -k3 -rn|head
root 675 0.1 0.1 273192 4884 ? Ssl 16:44 0:16 /usr/bin/vmtoolsd
root 980 0.0 0.1 222740 4644 ? Ssl 16:44 0:01 /usr/sbin/rsyslogd -n
root 977 0.0 0.5 574284 19468 ? Ssl 16:44 0:02 /usr/bin/python2 -Es /usr/sbin/tuned -l -P
root 976 0.0 0.1 112900 4344 ? Ss 16:44 0:00 /usr/sbin/sshd -D
root 9 0.0 0.0 0 0 ? S 16:44 0:00 [rcu_sched]
root 8 0.0 0.0 0 0 ? S 16:44 0:00 [rcu_bh]
root 783 0.0 0.1 102904 5540 ? S 16:44 0:00 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-ens33.pid -lf /var/lib/NetworkManager/dhclient-9cabfa34-d47b-4024-85ee-2ed52a00621c-ens33.lease -cf /var/lib/NetworkManager/dhclient-ens33.conf ens33
root 704 0.0 0.0 99208 2708 ? Ss 16:44 0:00 login -- root
root 701 0.0 0.0 126388 1628 ? Ss 16:44 0:00 /usr/sbin/crond -n
root 7 0.0 0.0 0 0 ? S 16:44 0:00 [migration/0]
[root@xiaoyang ~]# ps aux|tail -n +2|sort -k3 -rn|head |awk '{print $11,$3}'
/usr/bin/vmtoolsd 0.1
/usr/sbin/rsyslogd 0.0
/usr/bin/python2 0.0
/usr/sbin/sshd 0.0
[rcu_sched] 0.0
[rcu_bh] 0.0
/sbin/dhclient 0.0
login 0.0
/usr/sbin/crond 0.0
[migration/0] 0.0
CPU 使用率が 100%、メモリ使用率が 100% になるとどのような影響がありますか?
行き詰まって止まってしまった
異常なビジネス プログラム: 古いユーザーはフリーズし、新しいユーザーは接続できません
通信網
ポートスキャンツール
[root@xiaoyang ~]# yum install nc nmap fping telnet -y
最初にインストールしてください
ノースカロライナ州
[root@xiaoyang ~]# nc -z 8.219.110.232 22 相手にデータを送信しません
-z ゼロ I/O モード、接続ステータスのみをレポートします。 接続できるかどうかをレポートします。
次に、 echo $? を見て戻り値を確認します。
-w、--待ってください
[root@xiaoyang ~] nc -z -w 1 8.219.110.232 2233
[root@xiaoyang ~] echo $?
1
[root@xiaoyang ~]#
Baidu をテストすることもできます
nc -z -w 1 www.baidu.com 80
エコー$?
nmap
[root@xiaoyang lianxi] nmap 192.168.209.143
Starting Nmap 6.40 ( http://nmap.org ) at 2023-05-08 22:41 CST
Nmap scan report for 192.168.209.143
Host is up (0.0000030s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
22/tcp open ssh
Nmap done: 1 IP address (1 host up) scanned in 2.03 seconds
[root@xiaoyang lianxi]#
fping
ネットワークセグメント内のどのIPが使用されているか、どのIPが使用されていないかを検出できます。
[root@xiaoyang lianxi] fping -g 192.168.209.0/24
カール
[root@xiaoyang lianxi] curl www.baidu.com
テルネット
[root@xiaoyang lianxi] telnet www.baidu.com 80
Trying 14.119.104.254...
Connected to www.baidu.com.
Escape character is '^]'.
^Cq^C^C
Connection closed by foreign host.
[root@xiaoyang lianxi]#
他の人のポートを見てください
NC
NMAP
タレント
あなたのポートを見てください
netstat
lsof
ss
ネットワークトラフィック
ethtool ローカル ネットワーク カードと他のデバイス間の速度マッチングを表示します。
エスツール ens33
dstat—「CPU 使用率、メモリ使用率、ディスク I/O、ネットワーク トラフィックを表示します」
dstat は、システムのパフォーマンスとリソースの使用状況を監視するためのコマンドライン ツールです。CPU 使用率、メモリ使用量、ディスク I/O、ネットワーク トラフィックなどを表示できます。dstat は、システム管理者がシステム パフォーマンスのボトルネックとリソースのボトルネックを迅速に特定し、システム パフォーマンスを最適化するのに役立ちます。
dstat -ma
-N はどのポートを調べるかを指定できます
dstat -N ens33 22
iftop — ネットワーク トラフィックと帯域幅の使用状況を監視するために使用されます
iftop は、ネットワーク トラフィックと帯域幅の使用状況を監視するために使用できるネットワーク監視ツールです。ネットワーク インターフェイスの伝送ステータスをリアルタイムで表示するため、ユーザーはネットワークのボトルネックや異常なトラフィックを迅速に特定できます。iftop は、Linux、Unix、macOS などのオペレーティング システム上で実行できます。
yum install iftop -y
[root@xiaoyang lianxi] iftop
interface: ens33
IP address is: 192.168.209.143
MAC address is: 00:0c:29:9f:59:8a
[root@xiaoyang lianxi]#
一目 - 「CPU、メモリ、ディスク、ネットワーク、プロセスを監視する」
Glances は、クロスプラットフォームのリアルタイム システムおよびリソース監視ツールであり、CPU、メモリ、ディスク、ネットワーク、プロセスなどのシステム リソースの使用状況を監視するために使用できます。グランスは端末で使用することも、Web インターフェイスを通じて監視することもできます。Linux、Windows、macOS などを含む複数のオペレーティング システムをサポートしています。
yum インストール Glance -y
[root@xiaoyang lianxi]# 一目見た
nethogs —> ネットワーク トラフィックを監視する
nethogs は、ネットワーク トラフィックを監視するための Linux 上のコマンド ライン ツールで、各プロセスのネットワーク帯域幅の使用状況をリアルタイムで表示できます。プロセス、ユーザー、プロトコルなどでフィルタリングおよび並べ替えることができるため、システム内のどのプロセスがネットワーク帯域幅を占有しているか、およびそれらのプロセスが占有している帯域幅をユーザーが理解できるようになります。
yum install nethogs -y
sz,rz—「ファイルの送信と転送」
sz は Windows にファイルを送信することです
rz はファイルを受信します
[root@xiaoyang lianxi] rz
[root@xiaoyang lianxi] ls
1.txt hehaotian.txt lu monitor.sh taohuadao
2.txt hehaotian.txt,bak lu2 name.txt test_big_file2.txt
3-7 hehaotian.txt.bakkup lu3 nginx.log test_big_file.txt
big_file.sh hehaotian.txt=SUFFIX lu4 nohup.out user_pwd.txt
bill.txt hengshan lu8 passwd web.txt
create_user.sh honghuamiji lu.c sc.txt wulin
gaohui.sh ifcfg-ens33 mail.txt sshd_config 啦啦啦(1).txt
gaohui.txt ip.txt monitor.log state.txt
[root@xiaoyang lianxi] sz monitor.sh
[root@xiaoyang lianxi]#
いくつかの問題
ネットワークの速度はどこで判断できるのでしょうか?
各リンクの最大帯域幅
スイッチやルーターによって速度が制限される場合がある
ファイアウォールにより速度が制限される場合がある
1. ハードウェア自体の速度
2. 制限するかどうか
このマシンでどのポートが開いているかがわかっている場合
ssを直接入力
ss -anplut
ss -an
netstat -anplut
[root@xiaoyang ~] netstat -anplut
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 976/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1212/master
tcp 0 36 192.168.209.143:22 192.168.209.1:53099 ESTABLISHED 2004/sshd: root@pts
tcp 0 0 192.168.209.143:22 192.168.209.1:53097 ESTABLISHED 1985/sshd: root@pts
tcp6 0 0 :::22 :::* LISTEN 976/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1212/master
udp 0 0 0.0.0.0:68 0.0.0.0:* 783/dhclient
udp 0 0 127.0.0.1:323 0.0.0.0:* 686/chronyd
udp6 0 0 ::1:323 :::* 686/chronyd
[root@xiaoyang ~]#
そうでない場合は、net-tools をインストールします
lsof コマンド
[root@xiaoyang ~] lsof -i:22
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 976 root 3u IPv4 20857 0t0 TCP *:ssh (LISTEN)
sshd 976 root 4u IPv6 20859 0t0 TCP *:ssh (LISTEN)
sshd 1985 root 3u IPv4 33978 0t0 TCP xiaoyang:ssh->192.168.209.1:53097 (ESTABLISHED)
sshd 2004 root 3u IPv4 34028 0t0 TCP xiaoyang:ssh->192.168.209.1:53099 (ESTABLISHED)
[root@xiaoyang ~]# lsof -p 884
どのプロセスがこのファイルにアクセスするかを確認する
[root@xiaoyang ~] lsof /root
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
bash 1443 root cwd DIR 253,0 4096 33574977 /root
bash 1987 root cwd DIR 253,0 4096 33574977 /root
bash 2006 root cwd DIR 253,0 4096 33574977 /root
lsof 2387 root cwd DIR 253,0 4096 33574977 /root
lsof 2388 root cwd DIR 253,0 4096 33574977 /root
[root@xiaoyang ~]#
サービスがポートごとに実行されているかどうかを確認する
監視ステータスの表示:
[root@xiaoyang ~] netstat -anplut|grep LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 976/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1212/master
tcp6 0 0 :::22 :::* LISTEN 976/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1212/master
[root@xiaoyang ~]#
スイッチ、ルーターの各ポートのネットワークトラフィックを確認する方法
監視ソフトウェアを使用する
ザビックス
プロメテウス
ルーターとスイッチで snmp プロトコルの簡易ネットワーク管理プロトコルを有効にする必要があります。
エスツール ens33
NIC が 100M か 1000M かを確認するにはどうすればよいですか?
速度: 1000Mb/秒
エスツール ens33
[root@xiaoyang ~] ethtool ens33
Settings for ens33:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: off (auto)
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
ディスク
読み取りおよび書き込み速度 IO 速度の入出力
tps
iops
サール
sar コマンドは、CPU 使用率、メモリ使用率、ディスク I/O、ネットワーク トラフィックなど、システムのさまざまなパフォーマンス データを収集し、指定した時刻にこれらのデータを記録およびカウントするために使用されるシステム パフォーマンス分析ツールです。これにより、ユーザーはシステムのパフォーマンス状態をよりよく理解し、システムのパフォーマンスを最適化できます。
[root@xiaoyang lianxi] sar -d 1 3
Linux 3.10.0-1160.el7.x86_64 (xiaoyang) 2023年05月08日 _x86_64_ (2 CPU)
23时05分59秒 DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
23时06分00秒 dev11-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23时06分00秒 dev8-0 179.00 0.00 171960.00 960.67 0.08 0.46 0.44 7.90
23时06分00秒 dev253-0 179.00 0.00 171960.00 960.67 0.08 0.46 0.44 7.90
23时06分00秒 dev253-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23时06分00秒 DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
23时06分01秒 dev11-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23时06分01秒 dev8-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23时06分01秒 dev253-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23时06分01秒 dev253-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23时06分01秒 DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
23时06分02秒 dev11-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23时06分02秒 dev8-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23时06分02秒 dev253-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23时06分02秒 dev253-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
平均时间: DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
平均时间: dev11-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
平均时间: dev8-0 59.67 0.00 57320.00 960.67 0.03 0.46 0.44 2.63
平均时间: dev253-0 59.67 0.00 57320.00 960.67 0.03 0.46 0.44 2.63
平均时间: dev253-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
[root@xiaoyang lianxi]#
tps は 1 秒あたりの送信数です
%util のビジー度が高くなるほど、ディスクのビジー度も高くなります。
1 秒あたりの読み取りおよび書き込み速度 tps
100% の確率でマシンがフリーズします
iostat—「ディスク IO の読み取りおよび書き込み速度とビジー状態を表示する」
iostat -x ディスク IO の読み取りおよび書き込み速度とビジー状態を表示します。
[root@xiaoyang lianxi] iostat -x
Linux 3.10.0-1160.el7.x86_64 (xiaoyang) 2023年05月08日 _x86_64_ (2 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.01 0.00 0.07 0.00 0.00 99.92
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
scd0 0.00 0.00 0.00 0.00 0.04 0.00 114.22 0.00 1.39 1.39 0.00 0.94 0.00
sda 0.00 0.02 0.40 0.23 14.80 8.29 72.66 0.00 0.47 0.48 0.46 0.27 0.02
dm-0 0.00 0.00 0.31 0.25 13.41 8.20 77.18 0.00 0.54 0.60 0.48 0.29 0.02
dm-1 0.00 0.00 0.00 0.00 0.09 0.00 50.09 0.00 0.14 0.14 0.00 0.09 0.00
[root@xiaoyang lianxi]#
ディスク領域の使用状況を確認します。 df -Th
[root@xiaoyang ~] dd if=/dev/zero of=/test.dd bs=1M count=1000
记录了1000+0 的读入
记录了1000+0 的写出
1048576000字节(1.0 GB)已复制,0.44042 秒,2.4 GB/秒
[root@xiaoyang ~] df -Th
文件系统 类型 容量 已用 可用 已用% 挂载点
devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs tmpfs 1.9G 12M 1.9G 1% /run
tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 17G 4.8G 13G 28% /
/dev/sda1 xfs 1014M 151M 864M 15% /boot
tmpfs tmpfs 378M 0 378M 0% /run/user/0
[root@xiaoyang ~]# ^C
[root@xiaoyang ~] rm -rf test.dd 删除产生的零时大文件
[root@xiaoyang ~] df -Th
文件系统 类型 容量 已用 可用 已用% 挂载点
devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs tmpfs 1.9G 12M 1.9G 1% /run
tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 17G 4.8G 13G 28% /
/dev/sda1 xfs 1014M 151M 864M 15% /boot
tmpfs tmpfs 378M 0 378M 0% /run/user/0
[root@xiaoyang ~]#
lsblk —> ディスクの大きさを確認できます
ディスクの大きさだけを確認する
df -Th --> ディスク容量の表示
ディスク容量の表示
iotop ----> どのプロセスが大量のディスクプロセスの読み取りと書き込みを行っているかを確認します
どのプロセスが多くのディスクプロセスの読み取りと書き込みを行っているかを確認できます
結論は
CPU
メモリー
ネットワーク帯域幅
ディスク容量とIO (tps/iops)
TPSとは何ですか?
1 秒あたりのアクセス速度 (読み取り、書き込み)
%util とは何ですか?
忙しさ
サーバーへのユーザーのアクセスが非常に遅いです。理由とトラブルシューティング方法を分析してください。
彼がサードパーティにアクセスした場合、すぐにそれは私たちの問題です
「CPU」を参照
記憶を見る
帯域幅を見てください
IOの読み取りおよび書き込みスペースと容量を確認します。
一度に見るにはどのコマンドを使用するか —> 一目で確認
すべてが正常であれば、ロードバランサまたはオペレータに問題があります
ポート番号を確認してください
コマンド「netstat -tunlp」を使用して、すべてのポートと対応するプロセスの現在の使用状況を表示します。このうち、「-t」は TCP プロトコル、「-u」は UDP プロトコル、「-n」はドメイン名解決を使用しないこと、「-l」はリスニングポートのみをリストすること、「-p」はドメイン名解決を表示することを意味します。プロセス名とプロセスID。